add mock api calls for modules viewall component
This commit is contained in:
@@ -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 WatchedCases() {
|
||||
import { connect } from "react-redux";
|
||||
import { setCurrentView } from "../../store/currentView/action";
|
||||
|
||||
const WatchedCases = (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,35 @@ export default function WatchedCases() {
|
||||
{t("myportal:watchedcases-card-title")}
|
||||
</h3>
|
||||
<div className="cardModuleContainer">
|
||||
<TopThree />
|
||||
<TopThree showTopThree={props.watchedCases.watchedCases} />
|
||||
</div>
|
||||
|
||||
<div className="cardVieAll">
|
||||
<Link href="/viewall">
|
||||
<a>{t("myportal:viewall-link")}</a>
|
||||
<Link href="/myportal/viewall">
|
||||
<a
|
||||
onClick={() => {
|
||||
setCurrentView({
|
||||
"viewName": "Watched Cases",
|
||||
"viewKey": "watchedCases",
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("myportal:viewall-link")}
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
setCurrentView: (currentView) => {
|
||||
console.log(currentView);
|
||||
dispatch(setCurrentView(currentView));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(null, mapDispatchToProps)(WatchedCases);
|
||||
|
||||
Reference in New Issue
Block a user