Skip to content

Commit 3d75b95

Browse files
committed
fix: fixed mobile navigation is not being scrollable;
Fixes #112
1 parent 4ad631a commit 3d75b95

1 file changed

Lines changed: 43 additions & 40 deletions

File tree

src/components/Shell/Shell.tsx

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
Avatar,
2020
Divider,
2121
useMantineTheme,
22+
ScrollArea,
2223
} from '@mantine/core'
2324
import { IconBrandDiscordFilled, IconBrandGithubFilled, IconBrandPatreonFilled, IconClearAll, IconInputX, IconSettings, IconStarFilled, IconTrophyFilled, IconUsers, IconX } from '@tabler/icons-react'
2425
import { Outlet, useLocation, useNavigate, useParams } from 'react-router'
@@ -267,51 +268,53 @@ export default function Shell(): React.ReactElement {
267268
</AppShell.Header>
268269

269270
<AppShell.Aside>
270-
<AccountButton variant="navlink" loginClick={openLoginModal}
271-
onAccountModalClose={toggle}/>
272-
<NavLink label="Settings" leftSection={<IconSettings />} onClick={() => {
273-
navigate("/settings")
274-
toggle()
275-
}} />
276-
277-
<Title m="sm" order={4}>Navigation</Title>
278-
<NavLink label="Leaderboards" leftSection={<IconTrophyFilled />}
279-
variant="filled"
280-
autoContrast
281-
active={location.pathname.includes("leaderboards")}
282-
onClick={() => {
283-
navigate("/leaderboards")
284-
toggle()
285-
}} />
286-
<NavLink label="Builds" leftSection={<IconUsers />}
287-
variant="filled"
288-
autoContrast
289-
active={location.pathname.includes("builds")}
290-
onClick={() => {
291-
navigate("/builds")
271+
<ScrollArea>
272+
<AccountButton variant="navlink" loginClick={openLoginModal}
273+
onAccountModalClose={toggle}/>
274+
<NavLink label="Settings" leftSection={<IconSettings />} onClick={() => {
275+
navigate("/settings")
292276
toggle()
293277
}} />
294278

295-
{users.length !== 0 && <>
296-
<Title m="sm" order={4}>Users</Title>
297-
{
298-
users.map(u => <NavLink key={u.Uid} label={u.Nickname}
299-
variant="filled"
300-
autoContrast
301-
leftSection={favoriteUsers.includes(u.Uid) ? <IconStarFilled size="16px" /> : undefined}
302-
active={`${u.Uid}` === selectedUser}
303-
onClick={() => {
304-
navigate(`/profile/${u.Uid}`)
305-
toggle()
306-
}} />)
279+
<Title m="sm" order={4}>Navigation</Title>
280+
<NavLink label="Leaderboards" leftSection={<IconTrophyFilled />}
281+
variant="filled"
282+
autoContrast
283+
active={location.pathname.includes("leaderboards")}
284+
onClick={() => {
285+
navigate("/leaderboards")
286+
toggle()
287+
}} />
288+
<NavLink label="Builds" leftSection={<IconUsers />}
289+
variant="filled"
290+
autoContrast
291+
active={location.pathname.includes("builds")}
292+
onClick={() => {
293+
navigate("/builds")
294+
toggle()
295+
}} />
296+
297+
{users.length !== 0 && <>
298+
<Title m="sm" order={4}>Users</Title>
299+
{
300+
users.map(u => <NavLink key={u.Uid} label={u.Nickname}
301+
variant="filled"
302+
autoContrast
303+
leftSection={favoriteUsers.includes(u.Uid) ? <IconStarFilled size="16px" /> : undefined}
304+
active={`${u.Uid}` === selectedUser}
305+
onClick={() => {
306+
navigate(`/profile/${u.Uid}`)
307+
toggle()
308+
}} />)
309+
}
310+
</>
307311
}
308-
</>
309-
}
310312

311-
<Title m="sm" order={4}>Links</Title>
312-
<NavLink label="Patreon" variant="filled" leftSection={<IconBrandPatreonFilled />} />
313-
<NavLink label="Discord" leftSection={<IconBrandDiscordFilled />} href="https://discord.gg/hFNheySRQD" target="_blank" />
314-
<NavLink label="GitHub" leftSection={<IconBrandGithubFilled />} href="https://github.com/Night-Sky-Studio/interknot" target="_blank" />
313+
<Title m="sm" order={4}>Links</Title>
314+
<NavLink label="Patreon" variant="filled" leftSection={<IconBrandPatreonFilled />} />
315+
<NavLink label="Discord" leftSection={<IconBrandDiscordFilled />} href="https://discord.gg/hFNheySRQD" target="_blank" />
316+
<NavLink label="GitHub" leftSection={<IconBrandGithubFilled />} href="https://github.com/Night-Sky-Studio/interknot" target="_blank" />
317+
</ScrollArea>
315318
</AppShell.Aside>
316319

317320
<AppShell.Main>

0 commit comments

Comments
 (0)