Skip to content

Commit

Permalink
fix: max reached error text added
Browse files Browse the repository at this point in the history
  • Loading branch information
siandreev committed Apr 30, 2024
1 parent 7e052f9 commit 2cebed6
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions packages/uikit/src/components/desktop/multi-send/MultiSendTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ const Dot = styled(Body2)`
color: ${props => props.theme.textTertiary};
`;

const FooterErrorMessage = styled(Body2)`
color: ${p => p.theme.accentOrange};
`;

const MultiSendAddMore: FC<{
onAdd: (item: MultiSendForm['rows'][number]) => void;
fieldsNumber: number;
Expand Down Expand Up @@ -451,25 +455,29 @@ const MultiSendFooter: FC<{
</Button>
)}
</ListActionsButtons>
<MultiSendFooterTextWrapper>
<Body3>
{t('multi-send_will-be-sent')}:&nbsp;
{balancesLoading ? <SkeletonText width="75px" /> : willBeSent}
</Body3>
{balancesLoading || remainingBalanceBN?.gt(0) ? (
{maxMsgsNumberExceeded ? (
<FooterErrorMessage>{t('multi-send_maximum-reached')}</FooterErrorMessage>
) : (
<MultiSendFooterTextWrapper>
<Body3>
{t('multi-send_remaining')}:&nbsp;
{balancesLoading ? <SkeletonText width="75px" /> : remainingBalance}
{t('multi-send_will-be-sent')}:&nbsp;
{balancesLoading ? <SkeletonText width="75px" /> : willBeSent}
</Body3>
) : (
<Body3Error>{t('multi-send_insufficient_balance')}</Body3Error>
)}
</MultiSendFooterTextWrapper>
{balancesLoading || remainingBalanceBN?.gt(0) ? (
<Body3>
{t('multi-send_remaining')}:&nbsp;
{balancesLoading ? <SkeletonText width="75px" /> : remainingBalance}
</Body3>
) : (
<Body3Error>{t('multi-send_insufficient_balance')}</Body3Error>
)}
</MultiSendFooterTextWrapper>
)}
{!proState || proState.subscription.valid ? (
<Button
type="submit"
primary
disabled={remainingBalanceBN?.lt(0)}
disabled={remainingBalanceBN?.lt(0) || maxMsgsNumberExceeded}
loading={formValidationState === 'validating' || !proState}
>
{t('continue')}
Expand Down

0 comments on commit 2cebed6

Please sign in to comment.