Skip to content

Commit

Permalink
moved false positive to details section as described on figma and cor…
Browse files Browse the repository at this point in the history
…rected metric property
  • Loading branch information
blackdevelopa committed Sep 21, 2023
1 parent 37b21fc commit ca092be
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ exports[`Security Provider Banner Alert should match snapshot 1`] = `
List item
</li>
</ul>
<p
class="mm-box mm-text mm-text--body-md mm-box--margin-top-3 mm-box--display-flex mm-box--color-text-default"
>
[somethingDoesntLookRight]
</p>
</div>
<div
class="disclosure__footer"
/>
</details>
</div>
<p
class="mm-box mm-text mm-text--body-md mm-box--margin-top-3 mm-box--display-flex mm-box--color-text-default"
>
[somethingDoesntLookRight]
</p>
<p
class="mm-box mm-text mm-text--body-sm mm-box--margin-top-3 mm-box--display-flex mm-box--align-items-center mm-box--color-text-alternative"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,6 @@ exports[`Blockaid Banner Alert should render 'danger' UI when securityAlertRespo
>
If you approve this request, a third party known for scams might take all your assets.
</p>
<p
class="mm-box mm-text mm-text--body-md mm-box--margin-top-3 mm-box--display-flex mm-box--color-text-default"
>
<span>
Something doesn't look right?
<a
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
href="https://support.metamask.io/hc/en-us"
rel="noopener noreferrer"
target="_blank"
>
Contact us
</a>
</span>
</p>
<p
class="mm-box mm-text mm-text--body-sm mm-box--margin-top-3 mm-box--display-flex mm-box--align-items-center mm-box--color-text-alternative"
>
Expand Down Expand Up @@ -105,24 +87,6 @@ exports[`Blockaid Banner Alert should render 'warning' UI when securityAlertResp
>
If you approve this request, a third party known for scams might take all your assets.
</p>
<p
class="mm-box mm-text mm-text--body-md mm-box--margin-top-3 mm-box--display-flex mm-box--color-text-default"
>
<span>
Something doesn't look right?
<a
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
href="https://support.metamask.io/hc/en-us"
rel="noopener noreferrer"
target="_blank"
>
Contact us
</a>
</span>
</p>
<p
class="mm-box mm-text mm-text--body-sm mm-box--margin-top-3 mm-box--display-flex mm-box--align-items-center mm-box--color-text-alternative"
>
Expand Down Expand Up @@ -201,30 +165,30 @@ exports[`Blockaid Banner Alert should render details when provided 1`] = `
Operator is untrusted according to previous activity
</li>
</ul>
<p
class="mm-box mm-text mm-text--body-md mm-box--margin-top-3 mm-box--display-flex mm-box--color-text-default"
>
<span>
Something doesn't look right?
<a
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
href="https://support.metamask.io/hc/en-us"
rel="noopener noreferrer"
target="_blank"
>
Contact us
</a>
</span>
</p>
</div>
<div
class="disclosure__footer"
/>
</details>
</div>
<p
class="mm-box mm-text mm-text--body-md mm-box--margin-top-3 mm-box--display-flex mm-box--color-text-default"
>
<span>
Something doesn't look right?
<a
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
href="https://support.metamask.io/hc/en-us"
rel="noopener noreferrer"
target="_blank"
>
Contact us
</a>
</span>
</p>
<p
class="mm-box mm-text mm-text--body-sm mm-box--margin-top-3 mm-box--display-flex mm-box--align-items-center mm-box--color-text-alternative"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ function SecurityProviderBannerAlert({
{details && (
<Disclosure title={t('seeDetails')} variant={DisclosureVariant.Arrow}>
{details}
</Disclosure>
)}

{provider && (
<>
<Text marginTop={3} display={Display.Flex}>
{t('somethingDoesntLookRight', [
<ButtonLink
Expand All @@ -64,33 +59,35 @@ function SecurityProviderBannerAlert({
</ButtonLink>,
])}
</Text>
</Disclosure>
)}

<Text
marginTop={3}
display={Display.Flex}
alignItems={AlignItems.center}
color={Color.textAlternative}
variant={TextVariant.bodySm}
>
<Icon
className="disclosure__summary--icon"
color={IconColor.primaryDefault}
name={IconName.SecurityTick}
size={IconSize.Sm}
marginInlineEnd={1}
/>
{t('securityProviderPoweredBy', [
<ButtonLink
key={`security-provider-button-link-${provider}`}
size={Size.inherit}
href={SECURITY_PROVIDER_CONFIG[provider].url}
externalLink
>
{t(SECURITY_PROVIDER_CONFIG[provider].tKeyName)}
</ButtonLink>,
])}
</Text>
</>
{provider && (
<Text
marginTop={3}
display={Display.Flex}
alignItems={AlignItems.center}
color={Color.textAlternative}
variant={TextVariant.bodySm}
>
<Icon
className="disclosure__summary--icon"
color={IconColor.primaryDefault}
name={IconName.SecurityTick}
size={IconSize.Sm}
marginInlineEnd={1}
/>
{t('securityProviderPoweredBy', [
<ButtonLink
key={`security-provider-button-link-${provider}`}
size={Size.inherit}
href={SECURITY_PROVIDER_CONFIG[provider].url}
externalLink
>
{t(SECURITY_PROVIDER_CONFIG[provider].tKeyName)}
</ButtonLink>,
])}
</Text>
)}
</BannerAlert>
);
Expand Down
4 changes: 1 addition & 3 deletions ui/components/app/signature-request/signature-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ import { useMMICustodySignMessage } from '../../../hooks/useMMICustodySignMessag
///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(blockaid)
import BlockaidBannerAlert from '../security-provider-banner-alert/blockaid-banner-alert/blockaid-banner-alert';
import ZENDESK_URLS from '../../../helpers/constants/zendesk-url';
///: END:ONLY_INCLUDE_IN

import Message from './signature-request-message';
Expand Down Expand Up @@ -172,8 +171,7 @@ const SignatureRequest = ({ txData }) => {
action: 'Sign Request',
type,
version,
external_link_clicked: true,
security_alert_support_link: ZENDESK_URLS.SUPPORT_URL,
external_link_clicked: 'security_alert_support_link',
},
});
}, []);
Expand Down
3 changes: 1 addition & 2 deletions ui/components/app/transaction-alerts/transaction-alerts.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ const TransactionAlerts = ({
properties: {
action: 'Confirm Screen',
origin: txData?.origin,
external_link_clicked: true,
security_alert_support_link: ZENDESK_URLS.SUPPORT_URL,
external_link_clicked: 'security_alert_support_link',
},
});
}, []);
Expand Down

0 comments on commit ca092be

Please sign in to comment.