dydx-v4-web/src/views/dialogs/RateLimitDialog.tsx
Jared Vu 48a48b4d70
Screen (#56)
* useDydxClient: Add screen endpoint

* Screen api in onboarding flow

* PnlChart rounding

* UnauthorizedDialog

* Add RateLimitDialog

* Update dialog open logic

* nits

* Screen before Transfer

* Validate network, remove input autofill color

* Use screenAddresses from dydxClient

* Check recipientAddresses

* lock-file

* Change Wallet Restricted Dialog to v4-blocked message

* nits

* Unused param

* consolidate environment validateFn

* Remove extra space, simplify WithdrawForm error msg

* Simply map logic, rearrange priority of screened messages

* WalletRestricted -> RestrictedWallet

* Update restriction modal title and add something went wrong

* Handle 429 rate limit
2023-10-16 09:36:09 -07:00

43 lines
1.1 KiB
TypeScript

import styled, { AnyStyledComponent } from 'styled-components';
import { STRING_KEYS } from '@/constants/localization';
import { useStringGetter } from '@/hooks';
import { layoutMixins } from '@/styles/layoutMixins';
import { Dialog } from '@/components/Dialog';
import { Icon, IconName } from '@/components/Icon';
type ElementProps = {
preventClose?: boolean;
setIsOpen?: (open: boolean) => void;
};
export const RateLimitDialog = ({ preventClose, setIsOpen }: ElementProps) => {
const stringGetter = useStringGetter();
return (
<Dialog
isOpen
preventClose={preventClose}
setIsOpen={setIsOpen}
title={stringGetter({ key: STRING_KEYS.RATE_LIMIT_REACHED_ERROR_TITLE })}
slotIcon={<Styled.Icon iconName={IconName.Warning} />}
>
<Styled.Content>
{stringGetter({ key: STRING_KEYS.RATE_LIMIT_REACHED_ERROR_MESSAGE })}
</Styled.Content>
</Dialog>
);
};
const Styled: Record<string, AnyStyledComponent> = {};
Styled.Icon = styled(Icon)`
color: var(--color-warning);
`;
Styled.Content = styled.div`
${layoutMixins.column}
gap: 1rem;
`;