Skip to content

Commit

Permalink
feat: Remove powered by blockaid line (#8935)
Browse files Browse the repository at this point in the history
## **Description**

Removing the "powered by Blockaid" line

## **Related issues**

Fixes:
[#2228](https://github.com/MetaMask/MetaMask-planning/issues/2228)

## **Manual testing steps**

1. Launch MM
2. Open testdapp
3. Click any malicious transaction under PPOM section
4. See the powered by blockaid line
5. Checkout this branch
6. Repeat 1-3
7. See there's no powered by blockaid line

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<img width="387" alt="Screenshot 2024-03-14 at 16 26 35"
src="https://github.com/MetaMask/metamask-mobile/assets/44811/28c31aec-ae8e-499e-8591-a612b3f253dc">

### **After**

<img width="386" alt="Screenshot 2024-03-14 at 15 29 27"
src="https://github.com/MetaMask/metamask-mobile/assets/44811/cce1602f-abd2-4b79-98c6-0d63a49aa43a">


## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've clearly explained what problem this PR is solving and how it
is solved.
- [x] I've linked related issues
- [x] I've included manual testing steps
- [x] I've included screenshots/recordings if applicable
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
- [x] I’ve properly set the pull request status:
  - [ ] In case it's not yet "ready for review", I've set it to "draft".
- [x] In case it's "ready for review", I've changed it from "draft" to
"non-draft".

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
  • Loading branch information
segun authored Mar 18, 2024
1 parent aa14537 commit 0550041
Show file tree
Hide file tree
Showing 22 changed files with 4 additions and 535 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export const ATTRIBUTION_LINE_TEST_ID = 'blockaid-banner-attribution-line';
export const FALSE_POSITIVE_REPOST_LINE_TEST_ID =
'blockaid-banner-false-positive-report-line';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const styleSheet = (_params: {
marginBottom: 4,
},
details: { marginLeft: 10, marginBottom: 10 },
securityTickIcon: { marginTop: 4 },
bannerWrapperMargined: {
marginTop: 10,
marginLeft: 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import { TESTID_ACCORDION_CONTENT } from '../../../../../component-library/compo
import { TESTID_ACCORDIONHEADER } from '../../../../../component-library/components/Accordions/Accordion/foundation/AccordionHeader/AccordionHeader.constants';
import { BANNERALERT_TEST_ID } from '../../../../../component-library/components/Banners/Banner/variants/BannerAlert/BannerAlert.constants';
import BlockaidBanner from './BlockaidBanner';
import {
ATTRIBUTION_LINE_TEST_ID,
FALSE_POSITIVE_REPOST_LINE_TEST_ID,
} from './BlockaidBanner.constants';
import { FALSE_POSITIVE_REPOST_LINE_TEST_ID } from './BlockaidBanner.constants';
import { ResultType, Reason } from './BlockaidBanner.types';
import renderWithProvider from '../../../../../util/test/renderWithProvider';

Expand Down Expand Up @@ -88,21 +85,6 @@ describe('BlockaidBanner', () => {
).toBeDefined();
});

it('should render correctly with attribution link', async () => {
const wrapper = renderWithProvider(
<BlockaidBanner
securityAlertResponse={{
...securityAlertResponse,
result_type: ResultType.Malicious,
reason: Reason.rawSignatureFarming,
}}
/>,
{ state: mockState },
);

expect(await wrapper.queryByTestId(ATTRIBUTION_LINE_TEST_ID)).toBeDefined();
});

it('should render correctly with list attack details', async () => {
const wrapper = renderWithProvider(
<BlockaidBanner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { BannerAlertSeverity } from '../../../../../component-library/components
import { DEFAULT_BANNERBASE_DESCRIPTION_TEXTVARIANT } from '../../../../../component-library/components/Banners/Banner/foundation/BannerBase/BannerBase.constants';
import BannerAlert from '../../../../../component-library/components/Banners/Banner/variants/BannerAlert/BannerAlert';
import {
IconColor,
IconName,
IconSize,
} from '../../../../../component-library/components/Icons/Icon';
Expand All @@ -24,7 +23,6 @@ import {
isBlockaidSupportedOnCurrentChain,
} from '../../../../../util/blockaid';
import {
ATTRIBUTION_LINE_TEST_ID,
FALSE_POSITIVE_REPOST_LINE_TEST_ID,
REASON_DESCRIPTION_I18N_KEY_MAP,
REASON_TITLE_I18N_KEY_MAP,
Expand All @@ -37,7 +35,6 @@ import {
} from './BlockaidBanner.types';
import BlockaidBannerLink from './BlockaidBannerLink';
import {
BLOCKAID_ATTRIBUTION_LINK,
FALSE_POSITIVE_REPORT_BASE_URL,
UTM_SOURCE,
} from '../../../../../constants/urls';
Expand Down Expand Up @@ -65,33 +62,6 @@ const getDescription = (reason: Reason) =>
REASON_DESCRIPTION_I18N_KEY_MAP[Reason.other],
);

const Attribution = ({ styles }: { styles: Record<string, any> }) => (
<View style={styles.attributionBase}>
<View style={styles.attributionItem}>
<Icon
name={IconName.SecurityTick}
size={IconSize.Sm}
color={IconColor.Primary}
style={styles.securityTickIcon}
/>
</View>
<View style={styles.attributionItem}>
<Text
variant={DEFAULT_BANNERBASE_DESCRIPTION_TEXTVARIANT}
data-testid={ATTRIBUTION_LINE_TEST_ID}
>
{strings('blockaid_banner.attribution')}
</Text>
</View>
<View style={styles.attributionItem}>
<BlockaidBannerLink
text={strings('blockaid_banner.attribution_link_name')}
link={BLOCKAID_ATTRIBUTION_LINK}
/>
</View>
</View>
);

const BlockaidBanner = (bannerProps: BlockaidBannerProps) => {
const {
style,
Expand Down Expand Up @@ -248,7 +218,6 @@ const BlockaidBanner = (bannerProps: BlockaidBannerProps) => {
{...bannerProps}
>
{renderDetails()}
<Attribution styles={styles} />
</BannerAlert>
);
};
Expand Down
Loading

0 comments on commit 0550041

Please sign in to comment.