Skip to content

Commit

Permalink
address more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hmalik88 committed Oct 1, 2024
1 parent 30df39a commit 47be51d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
18 changes: 8 additions & 10 deletions ui/components/app/snaps/snap-ui-link/snap-ui-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,14 @@ export const SnapUILink = ({ href, children }) => {

if (isMetaMaskUrl) {
return (
<>
<ButtonLink
as="a"
size={ButtonLinkSize.Inherit}
className="snap-ui-link"
onClick={handleLinkClick}
>
{children}
</ButtonLink>
</>
<ButtonLink
as="a"
size={ButtonLinkSize.Inherit}
className="snap-ui-link"
onClick={handleLinkClick}
>
{children}
</ButtonLink>
);
}

Expand Down
18 changes: 7 additions & 11 deletions ui/hooks/snaps/useNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@ import { getSnapRoute } from '../../helpers/utils/util';
const useNavigation = () => {
const history = useHistory();
const navigate = (url) => {
try {
let path;
const linkData = parseMetaMaskUrl(url);
if (linkData.snapId) {
path = getSnapRoute(linkData.snapId);
} else {
path = linkData.path;
}
history.push(path);
} catch (error) {
throw new Error(error.message);
let path;
const linkData = parseMetaMaskUrl(url);
if (linkData.snapId) {
path = getSnapRoute(linkData.snapId);
} else {
path = linkData.path;
}
history.push(path);
};
return {
navigate,
Expand Down

0 comments on commit 47be51d

Please sign in to comment.