Skip to content

Commit

Permalink
fix: fouc on ChainIcon (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
lochie authored Aug 14, 2023
1 parent e2a9d2d commit 4798404
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions packages/connectkit/src/components/Common/Chain/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import { AnimatePresence } from 'framer-motion';
import supportedChains from '../../../constants/supportedChains';
import Chains from '../../../assets/chains';
import useIsMounted from '../../../hooks/useIsMounted';

const Spinner = (
<svg
Expand Down Expand Up @@ -54,13 +55,19 @@ const Chain: React.FC<{
unsupported?: boolean;
radius?: number | string;
size?: number | string;
}> = ({
id,
unsupported,
radius = '50%',
size = 24
}) => {
}> = ({ id, unsupported, radius = '50%', size = 24 }) => {
const chain = supportedChains.find((c) => c.id === id);
const isMounted = useIsMounted();
if (!isMounted)
return (
<div
style={{
width: size,
height: size,
}}
/>
);

return (
<ChainContainer size={size} radius={radius}>
<AnimatePresence initial={false}>
Expand Down

4 comments on commit 4798404

@vercel
Copy link

@vercel vercel bot commented on 4798404 Aug 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

connectkit-cra – ./

connectkit-cra-git-main-lfe.vercel.app
connectkit-cra-lfe.vercel.app
connectkit-cra.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 4798404 Aug 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

connectkit-nextjs – ./

connectkit-nextjs.vercel.app
connectkit-nextjs-lfe.vercel.app
connectkit-nextjs-git-main-lfe.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 4798404 Aug 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

connectkit-vite – ./

connectkit-vite-git-main-lfe.vercel.app
connectkit-vite-lfe.vercel.app
connectkit-vite.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 4798404 Aug 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

connectkit-testbench – ./

connectkit-testbench-git-main-lfe.vercel.app
connectkit-testbench-lfe.vercel.app
connectkit-testbench.vercel.app

Please sign in to comment.