Skip to content

Commit

Permalink
Add Snaps directory link to the banner when at least one Snap is inst…
Browse files Browse the repository at this point in the history
…alled (#21167)

## **Description**
This PR will add link to the Snaps directory when there is at least one
Snap installed. If there is no Snap installed, link to the Snaps website
will be used as before.

## **Manual testing steps**
1. Start with fresh installation of MetaMask or delete all Snaps.
2. Go to Settings > Snaps
3. Check the link that should link to the main Snaps website
`https://metamask.io/snaps/`
4. Install one Snap
5. Check the link "Discover Snaps" that should link to the directory
`https://snaps.metamask.io/`

## **Screenshots/Recordings**

### **Before**
UI is not affected by the change.

### **After**
UI is not affected by the change.

## **Related issues**
Fixes: MetaMask/MetaMask-planning#1399

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've clearly explained:
  - [ ] What problem this PR is solving.
  - [ ] How this problem was solved.
  - [ ] How reviewers can test my changes.
- [ ] I’ve indicated what issue this PR is linked to: Fixes #???
- [ ] I’ve included tests if applicable.
- [ ] I’ve documented any added code.
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
- [ ] I’ve properly set the pull request status:
  - [ ] In case it's not yet "ready for review", I've set it to "draft".
- [ ] 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.
  • Loading branch information
david0xd authored Oct 4, 2023
1 parent 23f3f60 commit e2c29e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/pages/settings/snaps/snaps-list-tab/snap-list-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ const SnapListTab = () => {
>
<ButtonLink
size={Size.auto}
href="https://metamask.io/snaps/"
href={
snapsList.length > 0
? 'https://snaps.metamask.io/'
: 'https://metamask.io/snaps/'
}
target="_blank"
endIconName={IconName.Export}
>
Expand Down

0 comments on commit e2c29e9

Please sign in to comment.