Skip to content

Commit

Permalink
fix: Updated snap header in review permissions screen (#30092)
Browse files Browse the repository at this point in the history
In the review permissions screen for snaps, the origin of the snap was
missing. This PR fix that

## **Related issues**

Fixes: #30088 

## **Manual testing steps**

1. Connect extension to Snap 
2. Click on getAccounts
3. The review permissions screen should show Dapp Origin

## **Screenshots/Recordings**

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

### **Before**
![Screenshot 2025-02-04 at 11 40
35 AM](https://github.com/user-attachments/assets/2c27db18-7dcd-42a4-a64f-4c06b5200637)


### **After**
![Screenshot 2025-02-04 at 11 42
43 AM](https://github.com/user-attachments/assets/36342dc9-f091-49e5-ad37-2e7a3fed87da)


## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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
NidhiKJha authored Feb 4, 2025
1 parent 775eddc commit 5e2ebff
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types';
import React, { PureComponent } from 'react';
import { SubjectType } from '@metamask/permission-controller';
import PermissionsConnectPermissionList from '../../permissions-connect-permission-list';
import {
AlignItems,
Expand Down Expand Up @@ -56,7 +57,9 @@ export default class PermissionPageContainerContent extends PureComponent {
});
return accumulator;
}, []);

const { origin, subjectType } = subjectMetadata;
const displayOrigin =
subjectType === SubjectType.Website ? getURLHost(origin) : origin;
return (
<Box
display={Display.Flex}
Expand All @@ -83,10 +86,10 @@ export default class PermissionPageContainerContent extends PureComponent {
{t('nativeNetworkPermissionRequestDescription', [
<Text
as="span"
key={`description_key_${subjectMetadata.origin}`}
key={`description_key_${displayOrigin}`}
fontWeight={FontWeight.Medium}
>
{getURLHost(subjectMetadata.origin)}
{displayOrigin}
</Text>,
])}
</Text>
Expand Down

0 comments on commit 5e2ebff

Please sign in to comment.