added mock call for case view
This commit is contained in:
@@ -23,6 +23,7 @@ const AwaitingSubmission = (props) => {
|
||||
showTopThree={
|
||||
props.awaitingSubmission.awaitingSubmission
|
||||
}
|
||||
topThreeType={"awaitingSubmission"}
|
||||
/>
|
||||
</div>
|
||||
<div className="cardVieAll">
|
||||
|
||||
@@ -18,7 +18,10 @@ const MyCases = (props) => {
|
||||
{t("myportal:mycases-card-title")}
|
||||
</h3>
|
||||
<div className="cardModuleContainer">
|
||||
<TopThree showTopThree={props.myCases.myCases} />
|
||||
<TopThree
|
||||
showTopThree={props.myCases.myCases}
|
||||
topThreeType={"myCases"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="cardVieAll">
|
||||
|
||||
@@ -21,6 +21,7 @@ const MyRepresentations = (props) => {
|
||||
<div className="cardModuleContainer">
|
||||
<TopThree
|
||||
showTopThree={props.myRepresentations.myRepresentations}
|
||||
topThreeType={"myRepresentations"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,35 +1,73 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { setCurrentReference } from "../../store/currentView/action";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
const TopThree = (props) => {
|
||||
let { t } = useTranslation();
|
||||
const { showTopThree } = props;
|
||||
const { showTopThree, setCurrentReference, topThreeType } = props;
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
let topthreeRow = [];
|
||||
|
||||
for (var i = 0; i < 3; i++)
|
||||
topthreeRow.push(
|
||||
<div className="cardModuleItem" key={i}>
|
||||
<div className="cardModuleDetails">
|
||||
<div className="cardModuleReference">
|
||||
<b>Case reference:</b>{" "}
|
||||
<Link href="/case">
|
||||
<a>{props.showTopThree.value[i].reference}</a>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="carModuleAddress">
|
||||
<b>Address: </b> {props.showTopThree.value[i].address}
|
||||
for (var i = 0; i < 3; i++) {
|
||||
(function (i) {
|
||||
topthreeRow.push(
|
||||
<div className="cardModuleItem" key={i}>
|
||||
<div className="cardModuleDetails">
|
||||
<div className="cardModuleReference">
|
||||
<b>Case reference:</b>{" "}
|
||||
<Link href="/case">
|
||||
<a
|
||||
data-id={i}
|
||||
onClick={() => {
|
||||
setCurrentReference({
|
||||
"currentReference":
|
||||
showTopThree.value[i].reference,
|
||||
"currentType": topThreeType,
|
||||
});
|
||||
}}
|
||||
>
|
||||
{showTopThree.value[i].reference}
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
{topThreeType != "awaitingSubmission" ? (
|
||||
<div className="carModuleAddress">
|
||||
<b>Address: </b>
|
||||
{showTopThree.value[i].address1}
|
||||
</div>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
|
||||
{topThreeType == "awaitingSubmission" ? (
|
||||
<div className="carModuleAddress">
|
||||
Make Representation on Case Incomplete, not
|
||||
submitted
|
||||
</div>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</div>
|
||||
<div className="cardModuleRemoveCase"> —</div>
|
||||
</div>
|
||||
<div className="cardModuleRemoveCase"> —</div>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
})(i);
|
||||
}
|
||||
|
||||
return <>{topthreeRow}</>;
|
||||
};
|
||||
|
||||
export default TopThree;
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
setCurrentReference: (currentReference) => {
|
||||
dispatch(setCurrentReference(currentReference));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(null, mapDispatchToProps)(TopThree);
|
||||
|
||||
@@ -19,7 +19,10 @@ const WatchedCases = (props) => {
|
||||
{t("myportal:watchedcases-card-title")}
|
||||
</h3>
|
||||
<div className="cardModuleContainer">
|
||||
<TopThree showTopThree={props.watchedCases.watchedCases} />
|
||||
<TopThree
|
||||
showTopThree={props.watchedCases.watchedCases}
|
||||
topThreeType={"watchedCases"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="cardVieAll">
|
||||
|
||||
Reference in New Issue
Block a user