Skip to content

Commit a496524

Browse files
committed
fix(ChainSwitcher): ListItem as Link component
1 parent 105a1f2 commit a496524

File tree

1 file changed

+26
-31
lines changed

1 file changed

+26
-31
lines changed

src/components/utils/ChainSwitcher.tsx

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -57,44 +57,39 @@ function ChainSwitcher({
5757
(isCurrentChain ? setOpen(false) : setChainLoading(chainProfile.identifier))
5858
}
5959
>
60-
<Link
60+
<ListItemButton
6161
href={{
6262
pathname: `/${chainProfile.identifier}`,
6363
query: {
6464
[ISO_WEEK_QUERY_PARAM]: compactISOWeekString(LocalizedDateTime.now()),
6565
},
6666
}}
67-
style={{ width: "100%" }}
68-
passHref
67+
sx={[
68+
{
69+
display: "flex",
70+
justifyContent: "center",
71+
padding: "1.75rem",
72+
height: "6rem",
73+
width: "100%",
74+
},
75+
isLoading || isCurrentChain
76+
? {
77+
pointerEvents: "none",
78+
touchEvents: "none",
79+
}
80+
: {},
81+
]}
82+
disableTouchRipple
83+
disabled={isLoading && !isCurrentLoadingChain}
84+
selected={isCurrentLoadingChain || (!isLoading && isCurrentChain)}
85+
component={Link}
6986
>
70-
<ListItemButton
71-
sx={[
72-
{
73-
display: "flex",
74-
justifyContent: "center",
75-
padding: "1.75rem",
76-
height: "6rem",
77-
width: "100%",
78-
},
79-
isLoading || isCurrentChain
80-
? {
81-
pointerEvents: "none",
82-
touchEvents: "none",
83-
}
84-
: {},
85-
]}
86-
disableTouchRipple
87-
disabled={isLoading && !isCurrentLoadingChain}
88-
selected={isCurrentLoadingChain || (!isLoading && isCurrentChain)}
89-
component={"a"}
90-
>
91-
{!isLoading || chainLoading !== chainProfile.identifier ? (
92-
<ChainLogo chainProfile={chainProfile} />
93-
) : (
94-
<ChainLogoSpinner chainProfile={chainProfile} />
95-
)}
96-
</ListItemButton>
97-
</Link>
87+
{!isLoading || chainLoading !== chainProfile.identifier ? (
88+
<ChainLogo chainProfile={chainProfile} />
89+
) : (
90+
<ChainLogoSpinner chainProfile={chainProfile} />
91+
)}
92+
</ListItemButton>
9893
</ListItem>
9994
);
10095
})}

0 commit comments

Comments
 (0)