feat(income): add account income analytics
This commit is contained in:
@@ -13,6 +13,7 @@ type BreadcrumbTrailProps = {
|
||||
type AccountBreadcrumbsProps = {
|
||||
accountId: string;
|
||||
events: boolean;
|
||||
income: boolean;
|
||||
operations: boolean;
|
||||
};
|
||||
|
||||
@@ -43,7 +44,7 @@ const BreadcrumbTrail: FC<BreadcrumbTrailProps> = (props) => {
|
||||
};
|
||||
|
||||
const AccountBreadcrumbs: FC<AccountBreadcrumbsProps> = (props) => {
|
||||
const { accountId, events, operations } = props;
|
||||
const { accountId, events, income, operations } = props;
|
||||
const { data: accounts } = useBrokerageAccounts();
|
||||
const { t } = useTranslation();
|
||||
const accountName =
|
||||
@@ -66,10 +67,16 @@ const AccountBreadcrumbs: FC<AccountBreadcrumbsProps> = (props) => {
|
||||
{ label: accountName, to: accountPath },
|
||||
{ label: t("breadcrumbs.operations") },
|
||||
]
|
||||
: [
|
||||
{ label: t("breadcrumbs.accounts"), to: "/accounts" },
|
||||
{ label: accountName },
|
||||
]
|
||||
: income
|
||||
? [
|
||||
{ label: t("breadcrumbs.accounts"), to: "/accounts" },
|
||||
{ label: accountName, to: accountPath },
|
||||
{ label: t("breadcrumbs.income") },
|
||||
]
|
||||
: [
|
||||
{ label: t("breadcrumbs.accounts"), to: "/accounts" },
|
||||
{ label: accountName },
|
||||
]
|
||||
}
|
||||
/>
|
||||
);
|
||||
@@ -85,6 +92,10 @@ const AppBreadcrumbs: FC = () => {
|
||||
path: "/accounts/:accountId/events",
|
||||
end: true,
|
||||
});
|
||||
const accountIncome = useMatch({
|
||||
path: "/accounts/:accountId/income",
|
||||
end: true,
|
||||
});
|
||||
const account = useMatch({ path: "/accounts/:accountId", end: true });
|
||||
const accounts = useMatch({ path: "/accounts", end: true });
|
||||
const settings = useMatch({ path: "/settings", end: true });
|
||||
@@ -94,6 +105,7 @@ const AppBreadcrumbs: FC = () => {
|
||||
<AccountBreadcrumbs
|
||||
accountId={accountOperations.params.accountId ?? ""}
|
||||
events={false}
|
||||
income={false}
|
||||
operations
|
||||
/>
|
||||
);
|
||||
@@ -102,6 +114,16 @@ const AppBreadcrumbs: FC = () => {
|
||||
<AccountBreadcrumbs
|
||||
accountId={accountEvents.params.accountId ?? ""}
|
||||
events
|
||||
income={false}
|
||||
operations={false}
|
||||
/>
|
||||
);
|
||||
if (accountIncome)
|
||||
return (
|
||||
<AccountBreadcrumbs
|
||||
accountId={accountIncome.params.accountId ?? ""}
|
||||
events={false}
|
||||
income
|
||||
operations={false}
|
||||
/>
|
||||
);
|
||||
@@ -110,6 +132,7 @@ const AppBreadcrumbs: FC = () => {
|
||||
<AccountBreadcrumbs
|
||||
accountId={account.params.accountId ?? ""}
|
||||
events={false}
|
||||
income={false}
|
||||
operations={false}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user