Skip to content

Commit

Permalink
refactor: Effigy icon fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
admsk2 committed Aug 26, 2024
1 parent c9e452b commit 865d3a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions public/default_effigy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/components/Navbar/NavbarButtons/ProfileButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ export const ProfileButton = () => {
const theme = useTheme();
const { account } = useAccounts();

const imageSrc = account?.address ? `https://effigy.im/a/${account?.address}.png` : '/default_effigy.svg';

return (
<ProfileButtonBox onClick={() => navigate(JUMPER_LOYALTY_PATH)}>
<Image
src={`https://effigy.im/a/${account?.address ?? 'jumper.eth'}.png`}
src={imageSrc}
alt="Effigy Wallet Icon"
width={44}
height={44}
Expand Down
4 changes: 2 additions & 2 deletions src/components/ProfilePage/AddressBox/AddressBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ export const AddressBox = ({ address, isEVM, imageLink }: AddressBoxProps) => {
? imageLink
: address && isEVM
? `https://effigy.im/a/${address}.png`
: `https://effigy.im/a/${'jumper.eth'}.png`;
: '/default_effigy.svg';

const effigyLink =
address && isEVM
? `https://effigy.im/a/${address}.png`
: `https://effigy.im/a/${'jumper.eth'}.png`;
: '/default_effigy.svg';

return (
<AddressBoxContainer imgUrl={effigyLink}>
Expand Down

0 comments on commit 865d3a2

Please sign in to comment.