Skip to content

Commit

Permalink
Merge pull request #234 from RMoodsTeam/212-bug-fix-navbar-being-hidd…
Browse files Browse the repository at this point in the history
…en-when-resizing

212: Put nav items into Group component
  • Loading branch information
SebastianNowak01 authored Dec 8, 2024
2 parents aff9706 + 25687ab commit 307cc33
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 38 deletions.
19 changes: 6 additions & 13 deletions frontend/src/components/DefaultNavbar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Anchor, Card, Flex, Grid } from '@mantine/core';
import { Anchor, Card, Flex, Grid, Group } from '@mantine/core';
import ThemeSwitch from './navbar/ThemeSwitch.tsx';

const LeftNavItems = () => {
Expand All @@ -25,20 +25,13 @@ const RightNavItems = () => {
const DefaultNavbar = () => {
return (
<Card
style={{ margin: 0, borderRadius: 0, marginBottom: 0, height: '10vh' }}
style={{ margin: 0, borderRadius: 0, marginBottom: 0 }}
>
<nav>
<Grid>
<Grid.Col span={4}>
<LeftNavItems />
</Grid.Col>
<Grid.Col span={4}>
<div />
</Grid.Col>
<Grid.Col span={4}>
<RightNavItems />
</Grid.Col>
</Grid>
<Group justify='space-between'>
<LeftNavItems />
<RightNavItems />
</Group>
</nav>
</Card>
);
Expand Down
19 changes: 6 additions & 13 deletions frontend/src/components/navbar/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import UserMenu from './UserMenu';
import ThemeSwitch from './ThemeSwitch';
import { Anchor, Card, Flex, Grid } from '@mantine/core';
import { Anchor, Card, Flex, Group } from '@mantine/core';
import StatusIndicator from './StatusIndicator';
import RateLimitStatus from './RateLimitStatus.tsx';

Expand Down Expand Up @@ -31,20 +31,13 @@ const RightNavItems = () => {
const Navbar = () => {
return (
<Card
style={{ margin: 0, borderRadius: 0, marginBottom: 0, height: '10vh' }}
style={{ margin: 0, borderRadius: 0, marginBottom: 0 }}
>
<nav>
<Grid>
<Grid.Col span={4}>
<LeftNavItems />
</Grid.Col>
<Grid.Col span={4}>
<div />
</Grid.Col>
<Grid.Col span={4}>
<RightNavItems />
</Grid.Col>
</Grid>
<Group justify='space-between'>
<LeftNavItems />
<RightNavItems />
</Group>
</nav>
</Card>
);
Expand Down
18 changes: 6 additions & 12 deletions frontend/src/components/sidebar/SidebarNested.module.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
.navbar {
background-color: light-dark(
var(--mantine-color-white),
var(--mantine-color-dark-6)
);
background-color: light-dark(var(--mantine-color-white),
var(--mantine-color-dark-6));
padding: var(--mantine-spacing-md);
padding-bottom: 0;
display: flex;
flex-direction: column;
border-right: rem(1px) solid
light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
border-right: rem(1px) solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
}

.header {
Expand All @@ -18,12 +15,10 @@
max-height: 10%;
min-height: 10%;
padding: var(--mantine-spacing-md);
padding-top: 0;
margin-left: calc(var(--mantine-spacing-sm) * -1);
margin-right: calc(var(--mantine-spacing-sm) * -1);
color: light-dark(var(--mantine-color-black), var(--mantine-color-white));
border-bottom: rem(1px) solid
light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
border-bottom: rem(1px) solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
}

.links {
Expand All @@ -40,6 +35,5 @@
.footer {
margin-left: calc(var(--mantine-spacing-md) * -1);
margin-right: calc(var(--mantine-spacing-md) * -1);
//border-top: rem(1px) solid
light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
}
border-top: rem(1px) solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
}

0 comments on commit 307cc33

Please sign in to comment.