Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/good-design/src/apps/bridge/MicroBridge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,13 @@ export const MicroBridge = ({
void nextStep();
}
if (isSuccess) {
setBridging(false);
setBridgeAmount("");
onBridgeSuccess?.();
}

if (isFailed) {
setBridging(false);
const exception = new Error(errorMessage ?? "Failed to bridge");

if (errorCode) {
Expand All @@ -139,7 +142,7 @@ export const MicroBridge = ({

onBridgeFailed?.(exception);
}
}, [relayStatus, bridgeStatus, selfRelayStatus, onBridgeSuccess, onBridgeFailed]);
}, [relayStatus, bridgeStatus, selfRelayStatus, onBridgeSuccess, onBridgeFailed, setBridgeAmount, setBridging]);

const reasonMinAmount =
reason === "minAmount"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,7 @@ const HistoryRowItem = ({ item, env }: { item: any; env: string }) => {
<Text variant="xs-grey">G$ {amount}</Text>
{feeFormatted ? (
<HStack>
<Text variant="xs-grey" fontWeight="700">
Fees:{" "}
</Text>
<Text variant="xs-grey">Fees: </Text>
<Text variant="xs-grey">{`G$ `}</Text>
<GdAmount variant="xs-grey" fontFamily="subheading" withDefaultSuffix={false} amount={feeFormatted} />
</HStack>
Expand Down
13 changes: 7 additions & 6 deletions packages/good-design/src/core/layout/BalanceGD.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const GdAmount = ({
color?: any;
options?: any;
} & ITextProps) => {
const { color, options } = props;
const { color, options, variant, fontSize: propFontSize, fontFamily, ...rest } = props;
const formatOptions = {
fixedPrecisionDigits: 2,
useFixedPrecision: true,
Expand All @@ -118,22 +118,23 @@ export const GdAmount = ({
const amountAbbr = abbreviateGd(formatAmount);

const isLargeNumber = +formatAmount > 1e6;
const fontSize = isLargeNumber ? "sm" : "l";
const defaultFontSize = isLargeNumber ? "sm" : "l";
const fontSize = propFontSize ?? defaultFontSize;

return (
<HStack alignItems="flex-end">
<Text
variant="l-grey-650"
variant={variant ?? "l-grey-650"}
fontSize={fontSize}
fontFamily="heading"
fontFamily={fontFamily ?? "heading"}
color={color}
{...props}
{...rest}
textTransform="capitalize"
>
{withFullBalance ? amount?.format?.(formatOptions) : amountAbbr}
</Text>
{withDefaultSuffix ? (
<Text variant="sm-grey-650" color={color} fontWeight="700" {...props}>
<Text variant="sm-grey-650" color={color} fontWeight="700" {...rest}>
{"G$"}
</Text>
) : null}
Expand Down