This commit is contained in:
Manav Rathi 2024-11-05 14:03:15 +05:30
parent 1713510f2b
commit a048f1a38f
No known key found for this signature in database
3 changed files with 7 additions and 19 deletions

View File

@ -1,3 +1,4 @@
import { InlineErrorIndicator } from "@/base/components/ErrorIndicator";
import { MenuItemGroup } from "@/base/components/Menu"; import { MenuItemGroup } from "@/base/components/Menu";
import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton"; import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton";
import { LoadingButton } from "@/base/components/mui/LoadingButton"; import { LoadingButton } from "@/base/components/mui/LoadingButton";
@ -176,11 +177,7 @@ const ConfirmEnableMap: React.FC<ConfirmStepProps> = ({
</Typography> </Typography>
</Box> </Box>
<Stack px={"8px"} spacing={"8px"}> <Stack px={"8px"} spacing={"8px"}>
{phase == "failed" && ( {phase == "failed" && <InlineErrorIndicator />}
<Typography variant="small" color="critical.main">
{t("generic_error")}
</Typography>
)}
<LoadingButton <LoadingButton
loading={phase == "loading"} loading={phase == "loading"}
color={"accent"} color={"accent"}
@ -220,11 +217,7 @@ const ConfirmDisableMap: React.FC<ConfirmStepProps> = ({
</Typography> </Typography>
</Box> </Box>
<Stack px={"8px"} spacing={"8px"}> <Stack px={"8px"} spacing={"8px"}>
{phase == "failed" && ( {phase == "failed" && <InlineErrorIndicator />}
<Typography variant="small" color="critical.main">
{t("generic_error")}
</Typography>
)}
<LoadingButton <LoadingButton
loading={phase == "loading"} loading={phase == "loading"}
color={"critical"} color={"critical"}

View File

@ -32,8 +32,8 @@ export const ActivityErrorIndicator: React.FC<React.PropsWithChildren> = ({
export const InlineErrorIndicator: React.FC<React.PropsWithChildren> = ({ export const InlineErrorIndicator: React.FC<React.PropsWithChildren> = ({
children, children,
}) => ( }) => (
<Box sx={{ display: "flex", gap: 2, alignItems: "center" }}> <Box sx={{ display: "flex", gap: "5px", alignItems: "center" }}>
<ErrorOutline color="secondary" sx={{ color: "critical" }} /> <ErrorOutline sx={{ fontSize: "16px", color: "critical.main" }} />
<Typography variant="small" color="critical.main"> <Typography variant="small" color="critical.main">
{children ?? t("generic_error")} {children ?? t("generic_error")}
</Typography> </Typography>

View File

@ -13,6 +13,7 @@ import {
import { t } from "i18next"; import { t } from "i18next";
import React, { useState } from "react"; import React, { useState } from "react";
import log from "../log"; import log from "../log";
import { InlineErrorIndicator } from "./ErrorIndicator";
/** /**
* Customize the contents of an {@link AttributedMiniDialog}. * Customize the contents of an {@link AttributedMiniDialog}.
@ -161,12 +162,6 @@ export const AttributedMiniDialog: React.FC<
const { PaperProps, ...rest } = props; const { PaperProps, ...rest } = props;
const errorIndicator = phase == "failed" && (
<Typography variant="small" color="critical.main">
{t("generic_error")}
</Typography>
);
const loadingButton = attributes.continue && ( const loadingButton = attributes.continue && (
<LoadingButton <LoadingButton
loading={phase == "loading"} loading={phase == "loading"}
@ -250,7 +245,7 @@ export const AttributedMiniDialog: React.FC<
sx={{ paddingBlockStart: "24px", gap: "8px" }} sx={{ paddingBlockStart: "24px", gap: "8px" }}
direction={attributes.buttonDirection ?? "column"} direction={attributes.buttonDirection ?? "column"}
> >
{errorIndicator} {phase == "failed" && <InlineErrorIndicator />}
{attributes.buttonDirection == "row" ? ( {attributes.buttonDirection == "row" ? (
<> <>
{cancelButton} {cancelButton}