Skip to content

Commit

Permalink
fixup! Add navigation
Browse files Browse the repository at this point in the history
move NavBar to top
  • Loading branch information
jacobtylerwalls committed Oct 7, 2022
1 parent 23f3fe1 commit 8f8a623
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions src/app/src/components/NavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,42 @@ const NAVBAR_VARIANTS = {
SUBMISSION: 'submission',
};

export default function NavBar() {
const location = useLocation();

let variant = NAVBAR_VARIANTS.SUBMISSION;
if (location.pathname.startsWith('/draw')) {
variant = NAVBAR_VARIANTS.DRAW;
}

return (
<SimpleGrid
columns={3}
paddingLeft={10}
paddingRight={10}
w='100%'
h={NAVBAR_HEIGHT}
bg='gray.700'
>
<Flex align='center'>
<UtilityControl variant={variant} />
</Flex>

<Flex align='center' justify='center'>
<Heading size='md' color='white' ml={6}>
Boundary Sync
</Heading>
</Flex>

<Flex align='center' gap={4}>
<Spacer />
<SettingsButton variant={variant} />
<ExitButton variant={variant} />
</Flex>
</SimpleGrid>
);
}

function SettingsButton({ variant }) {
const navigate = useNavigate();

Expand Down Expand Up @@ -94,39 +130,3 @@ function UtilityControl({ variant }) {
<Text textStyle='selectedUtility'>{selectedUtility}</Text>
);
}

export default function NavBar() {
const location = useLocation();

let variant = NAVBAR_VARIANTS.SUBMISSION;
if (location.pathname.startsWith('/draw')) {
variant = NAVBAR_VARIANTS.DRAW;
}

return (
<SimpleGrid
columns={3}
paddingLeft={10}
paddingRight={10}
w='100%'
h={NAVBAR_HEIGHT}
bg='gray.700'
>
<Flex align='center'>
<UtilityControl variant={variant} />
</Flex>

<Flex align='center' justify='center'>
<Heading size='md' color='white' ml={6}>
Boundary Sync
</Heading>
</Flex>

<Flex align='center' gap={4}>
<Spacer />
<SettingsButton variant={variant} />
<ExitButton variant={variant} />
</Flex>
</SimpleGrid>
);
}

0 comments on commit 8f8a623

Please sign in to comment.