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

View File

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

View File

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