Skip to content

Commit

Permalink
feat: Add link to net worth analysis in person page
Browse files Browse the repository at this point in the history
ref #242

Signed-off-by: Arturo Volpe <[email protected]>
  • Loading branch information
aVolpe committed Mar 18, 2021
1 parent 47b21b3 commit d19899e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion portal/src/analysis/components/net_worth/Graphs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function Graphs({data, calc}: {
y: data.firstYear.netWorth.amount + calc.nextYearForInversion
}],
}];
}, [data]);
}, [data, calc]);

const incomeIncrease = useMemo(() => {
return [{
Expand Down
13 changes: 12 additions & 1 deletion portal/src/components/person_cards/DDJJ.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
import {Affidavit} from "../../Model";
import {Card, Col, Table, Typography} from "antd";
import {Button, Card, Col, Table, Tooltip, Typography} from "antd";
import Icon from "@ant-design/icons";
import {ReactComponent as Ddjj} from "../../assets/logos/ddjj.svg";
import * as React from "react";
import {formatMoney} from "../../formatters";
import './DDJJ.css'
import {SOURCE_NAME_MAP} from "../../pages/PersonSearchPage";
import {Link} from "react-router-dom";

export function DDJJCard(props: {
affidavit: Affidavit[]
}) {
if (!props.affidavit
|| props.affidavit.length === 0
) return null;

const affidavit = props.affidavit;
const first = props.affidavit[0]
return <>
<Col {...{xxl: 12, xl: 12, lg: 12, md: 12, sm: 24, xs: 24}} className="ddjj">
<Card className="data-box" title={SOURCE_NAME_MAP['declarations']}
actions={[
<Link to={`/analysis/net_worth/${first.document}?name=${first.name}`}>
Realizar análisis de crecimiento Patrimonial
</Link>
]}
extra={<Icon component={Ddjj} className="icon-card"/>}>
<Table<Affidavit>
dataSource={affidavit}
Expand Down

0 comments on commit d19899e

Please sign in to comment.