Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part of #18714 and #17670:set-approval-for-all-warnings #19115

Merged
merged 4 commits into from
May 15, 2023
Merged
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
4 changes: 0 additions & 4 deletions ui/components/app/set-approval-for-all-warning/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
&__account {
border-bottom: 1px solid var(--color-border-muted);
}

&__bold {
color: var(--color-text-default);
}
Comment on lines -16 to -19
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed styles and made all text text/default color

}

&__footer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ import { useI18nContext } from '../../../hooks/useI18nContext';

import Popover from '../../ui/popover';
import Box from '../../ui/box';
import Button from '../../ui/button';
import Typography from '../../ui/typography';

import {
DISPLAY,
FLEX_DIRECTION,
FONT_WEIGHT,
JustifyContent,
TextColor,
TypographyVariant,
TextVariant,
} from '../../../helpers/constants/design-system';
import Identicon from '../../ui/identicon';
import { shortenAddress } from '../../../helpers/utils/util';
import { Icon, IconName } from '../../component-library';
import {
Icon,
IconName,
Text,
Button,
BUTTON_VARIANT,
} from '../../component-library';

const SetApproveForAllWarning = ({
collectionName,
Expand All @@ -35,17 +38,19 @@ const SetApproveForAllWarning = ({
flexDirection={FLEX_DIRECTION.COLUMN}
justifyContent={JustifyContent.SPACE_BETWEEN}
className="set-approval-for-all-warning__footer"
gap={4}
>
<Button
className="set-approval-for-all-warning__footer__approve-button"
type="danger-primary"
variant={BUTTON_VARIANT.PRIMARY}
danger
onClick={onSubmit}
>
{t('approveButtonText')}
</Button>
<Button
className="set-approval-for-all-warning__footer__cancel-button"
type="secondary"
variant={BUTTON_VARIANT.SECONDARY}
onClick={onCancel}
>
{t('reject')}
Expand All @@ -65,12 +70,9 @@ const SetApproveForAllWarning = ({
name={IconName.Danger}
className="set-approval-for-all-warning__content__header__warning-icon"
/>
<Typography
variant={TypographyVariant.H4}
fontWeight={FONT_WEIGHT.BOLD}
>
<Text variant={TextVariant.headingSm} as="h4">
{t('yourNFTmayBeAtRisk')}
</Typography>
</Text>
</Box>
<Box
display={DISPLAY.FLEX}
Expand All @@ -80,38 +82,34 @@ const SetApproveForAllWarning = ({
>
<Box display={DISPLAY.FLEX}>
<Identicon address={senderAddress} diameter={32} />
<Typography
variant={TypographyVariant.H5}
<Text
variant={TextVariant.bodyMd}
as="h5"
marginLeft={2}
className="set-approval-for-all-warning__content__account-name"
>
<b>{name}</b> {` (${shortenAddress(senderAddress)})`}
</Typography>
<strong>{name}</strong> {` (${shortenAddress(senderAddress)})`}
</Text>
</Box>
{isERC721 && total && (
<Typography>{`${t('total')}: ${total}`}</Typography>
)}
{isERC721 && total && <Text>{`${t('total')}: ${total}`}</Text>}
</Box>

<Typography
color={TextColor.textAlternative}
<Text
margin={4}
marginTop={4}
marginBottom={4}
variant={TypographyVariant.H6}
variant={TextVariant.bodySm}
as="h6"
>
{t('nftWarningContent', [
<strong
key="non_custodial_bold"
className="set-approval-for-all-warning__content__bold"
>
<strong key="non_custodial_bold">
{t('nftWarningContentBold', [collectionName || ''])}
</strong>,
<strong key="non_custodial_grey">
{t('nftWarningContentGrey')}
</strong>,
])}
</Typography>
</Text>
</Popover>
);
};
Expand Down
2 changes: 1 addition & 1 deletion ui/components/component-library/text/text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $text-variants: (
color: var(--color-text-default);
font-family: var(--font-family-sans);

> strong {
strong {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes issue where only the direct strong tag child would be bold font-weight. That meant if it was wrapped in a span which many of the translations are they would not receive the styles properly.

font-weight: var(--font-weight-bold);
}

Expand Down