-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #541 from soroswap/feature/validateContractID
✨Add unsafe token modal and contractID validation
- Loading branch information
Showing
3 changed files
with
85 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
import { Box, useTheme } from 'soroswap-ui'; | ||
import { ButtonPrimary } from 'components/Buttons/Button'; | ||
import { CloseButton } from 'components/Buttons/CloseButton'; | ||
import { AutoColumn } from 'components/Column'; | ||
import { RowBetween } from 'components/Row'; | ||
import { SubHeaderLarge, SubHeaderSmall } from 'components/Text'; | ||
import { Wrapper } from 'components/TransactionConfirmationModal/ModalStyles'; | ||
import { AlertTriangle } from 'react-feather'; | ||
|
||
interface Props { | ||
onDismiss: () => void; | ||
onConfirm: () => void; | ||
isSafe: boolean | undefined; | ||
} | ||
|
||
const UnsafeTokenModalContent = ({ onDismiss, onConfirm, isSafe }: Props) => { | ||
const theme = useTheme(); | ||
return ( | ||
<Wrapper> | ||
<AutoColumn gap="12px"> | ||
<RowBetween> | ||
<div /> | ||
<CloseButton onClick={onDismiss} /> | ||
</RowBetween> | ||
<Box display="flex" justifyContent="center"> | ||
<AlertTriangle size="64px" stroke={theme.palette.customBackground.accentCritical} /> | ||
</Box> | ||
<AutoColumn gap="12px" justify="center"> | ||
<SubHeaderLarge color="textPrimary" textAlign="center"> | ||
Unsafe token! | ||
</SubHeaderLarge> | ||
{isSafe === false && ( | ||
<SubHeaderSmall color={"textSecondary"} textAlign="center" marginBottom="12px"> | ||
The chosen token has been identified as potentially unsafe due to a mismatch between its contract ID and the expected CODE:ISSUER combination indicated by its name. | ||
</SubHeaderSmall> | ||
)} | ||
{isSafe === undefined && ( | ||
<SubHeaderSmall color={"textSecondary"} textAlign="center" marginBottom="12px"> | ||
This token issuer can't be verified. | ||
</SubHeaderSmall> | ||
)} | ||
</AutoColumn> | ||
<ButtonPrimary onClick={onConfirm}>Accept risk</ButtonPrimary> | ||
</AutoColumn> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
export default UnsafeTokenModalContent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters