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:
@@ -2,7 +2,6 @@ import type { FC, PropsWithChildren, ReactNode } from "react";
|
||||
|
||||
import {
|
||||
Alert,
|
||||
Button,
|
||||
Group,
|
||||
Paper,
|
||||
Skeleton,
|
||||
@@ -13,8 +12,6 @@ import {
|
||||
import { LoadingSkeleton } from "@wealthledger/ui";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { SourceSyncStatus } from "@/shared/ui";
|
||||
|
||||
import type { SectionState } from "../model/section";
|
||||
|
||||
import classes from "./InstrumentDetails.module.css";
|
||||
@@ -33,10 +30,6 @@ type InstrumentSectionProps = PropsWithChildren<{
|
||||
const InstrumentSection: FC<InstrumentSectionProps> = (props) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const readError = t(
|
||||
props.state.hasData ? "accounts.refreshError" : "stock.sectionError",
|
||||
);
|
||||
|
||||
const sectionClassName = props.embedded
|
||||
? classes.embeddedSection
|
||||
: classes.section;
|
||||
@@ -80,35 +73,11 @@ const InstrumentSection: FC<InstrumentSectionProps> = (props) => {
|
||||
{props.controls}
|
||||
</Group>
|
||||
|
||||
<SourceSyncStatus
|
||||
lastSuccessfulAt={props.state.lastSuccessfulAt}
|
||||
stale={props.state.stale}
|
||||
/>
|
||||
|
||||
{!!props.state.partial && <Text role="status">{t("investment.partial")}</Text>}
|
||||
|
||||
{!!props.state.refreshing && (
|
||||
<Text c="dimmed" role="status" size="xs">
|
||||
{t("accounts.refreshing")}
|
||||
</Text>
|
||||
)}
|
||||
|
||||
{!!props.state.error && (
|
||||
{!!(props.state.error && !props.state.hasData) && (
|
||||
<Alert aria-live="polite" color="orange" mb="sm" role="status">
|
||||
<Group justify="space-between">
|
||||
<Text size="sm">
|
||||
{props.state.sourceError ? t("investment.syncFailed") : readError}
|
||||
</Text>
|
||||
|
||||
<Button
|
||||
disabled={props.state.refreshing}
|
||||
onClick={props.state.retry}
|
||||
size="xs"
|
||||
variant="default"
|
||||
>
|
||||
{t("accounts.retry")}
|
||||
</Button>
|
||||
</Group>
|
||||
<Text size="sm">{t("stock.sectionError")}</Text>
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user