Skip to content

Commit

Permalink
fix UnknownTokenIcon.tsx #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridel1e committed Jan 4, 2024
1 parent cccdf87 commit 353b5fe
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/components/UnknownTokenIcon/UnknownTokenIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC } from 'react';
import { FC, useMemo } from 'react';
import styled from 'styled-components';

import { AssetInfo } from '../../common/models/AssetInfo';
Expand Down Expand Up @@ -51,20 +51,24 @@ const _UnknownTokenIcon: FC<UnknownTokenIconProps> = ({
asset,
className,
size,
}) => (
<div
className={className}
style={{
width: size,
height: size,
background: idToHex(asset?.id || ''),
}}
>
<div>
<span />
}) => {
const background = useMemo(() => idToHex(asset?.id || ''), [asset?.id]);

return (
<div
className={className}
style={{
width: size,
height: size,
background: background,
}}
>
<div>
<span />
</div>
</div>
</div>
);
);
};

export const UnknownTokenIcon = styled(_UnknownTokenIcon)`
overflow: hidden;
Expand Down

0 comments on commit 353b5fe

Please sign in to comment.