added mock api call for homepage and viewall

This commit is contained in:
2021-07-29 14:51:27 +01:00
parent a0f777e6cb
commit a084b569c9
30 changed files with 884 additions and 112 deletions
+31 -5
View File
@@ -2,11 +2,16 @@ import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import TopThree from "./topthree";
export default function MyRepresentations() {
import { connect } from "react-redux";
import { setCurrentView } from "../../store/currentView/action";
const MyRepresentations = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const { setCurrentView } = props;
return (
<div className="card card-3" id="casescomment-card">
<div className="card-body">
@@ -14,15 +19,36 @@ export default function MyRepresentations() {
{t("myportal:myrepresentations-card-title")}
</h3>
<div className="cardModuleContainer">
<TopThree />{" "}
<TopThree
showTopThree={props.myRepresentations.myRepresentations}
/>
</div>
<div className="cardVieAll">
<Link href="/viewall">
<a>{t("myportal:viewall-link")}</a>
<Link href="/myportal/viewall">
<a
onClick={() => {
setCurrentView({
"viewName": "My Representations",
"viewKey": "myRepresentations",
});
}}
>
{t("myportal:viewall-link")}
</a>
</Link>
</div>
</div>
</div>
);
}
};
const mapDispatchToProps = (dispatch) => {
return {
setCurrentView: (currentView) => {
dispatch(setCurrentView(currentView));
},
};
};
export default connect(null, mapDispatchToProps)(MyRepresentations);