feat: add quiet reading with rare confirmations
Part of the quiet-user-feedback change; docs and specs land in their own repositories.
This commit is contained in:
@@ -1,26 +1,16 @@
|
||||
import type { FC } from "react";
|
||||
|
||||
import { Stack } from "@mantine/core";
|
||||
import { StateView } from "@wealthledger/ui";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import {
|
||||
InvestmentRefreshState,
|
||||
type InvestmentRefreshStateProps,
|
||||
} from "@/features/tbank-connection";
|
||||
|
||||
const AccountsPageEmpty: FC<InvestmentRefreshStateProps> = (props) => {
|
||||
const AccountsPageEmpty: FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<Stack>
|
||||
<InvestmentRefreshState {...props} />
|
||||
|
||||
<StateView
|
||||
text={t("accounts.emptyText")}
|
||||
title={t("accounts.emptyTitle")}
|
||||
/>
|
||||
</Stack>
|
||||
<StateView
|
||||
text={t("accounts.emptyText")}
|
||||
title={t("accounts.emptyTitle")}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import type { FC } from "react";
|
||||
|
||||
import { Button, Stack } from "@mantine/core";
|
||||
import { Button } from "@mantine/core";
|
||||
import { StateView } from "@wealthledger/ui";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from "react-router";
|
||||
|
||||
import { ApiErrorCode, isApiErrorCode } from "@/shared/api";
|
||||
|
||||
type AccountsPageErrorProps = { code?: string; retry?: () => void };
|
||||
type AccountsPageErrorProps = { code?: string };
|
||||
|
||||
const AccountsPageError: FC<AccountsPageErrorProps> = (props) => {
|
||||
const { code, retry } = props;
|
||||
const { code } = props;
|
||||
const { t } = useTranslation();
|
||||
|
||||
const settingsAction = (
|
||||
@@ -37,28 +37,11 @@ const AccountsPageError: FC<AccountsPageErrorProps> = (props) => {
|
||||
title={t("accounts.invalidTokenTitle")}
|
||||
/>
|
||||
);
|
||||
if (isApiErrorCode(code, ApiErrorCode.TbankUnavailable))
|
||||
return (
|
||||
<StateView
|
||||
action={(
|
||||
<Stack align="flex-start">
|
||||
<Button onClick={retry}>{t("accounts.retry")}</Button>
|
||||
|
||||
{settingsAction}
|
||||
</Stack>
|
||||
)}
|
||||
error
|
||||
text={t("accounts.unavailableText")}
|
||||
title={t("accounts.unavailableTitle")}
|
||||
/>
|
||||
);
|
||||
|
||||
return (
|
||||
<StateView
|
||||
action={<Button onClick={retry}>{t("accounts.retry")}</Button>}
|
||||
error
|
||||
text={t("states.errorText")}
|
||||
title={t("states.errorTitle")}
|
||||
text={t("states.unavailableText")}
|
||||
title={t("states.unavailableTitle")}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -8,17 +8,12 @@ import {
|
||||
type BrokerageAccountCard,
|
||||
BrokerageAccountList,
|
||||
} from "@/entities/brokerage-account";
|
||||
import {
|
||||
InvestmentRefreshState,
|
||||
type InvestmentRefreshStateProps,
|
||||
} from "@/features/tbank-connection";
|
||||
|
||||
type AccountsPageLoadedProps = InvestmentRefreshStateProps & {
|
||||
type AccountsPageLoadedProps = {
|
||||
accounts: BrokerageAccountCard[];
|
||||
};
|
||||
|
||||
const AccountsPageLoaded: FC<AccountsPageLoadedProps> = (props) => {
|
||||
const { accounts, ...refresh } = props;
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
@@ -31,8 +26,6 @@ const AccountsPageLoaded: FC<AccountsPageLoadedProps> = (props) => {
|
||||
</Text>
|
||||
</Stack>
|
||||
|
||||
<InvestmentRefreshState {...refresh} />
|
||||
|
||||
<Button
|
||||
component={Link}
|
||||
to="/accounts/all"
|
||||
@@ -42,7 +35,7 @@ const AccountsPageLoaded: FC<AccountsPageLoadedProps> = (props) => {
|
||||
{t("accounts.openAll")}
|
||||
</Button>
|
||||
|
||||
<BrokerageAccountList accounts={accounts} />
|
||||
<BrokerageAccountList accounts={props.accounts} />
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user