-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3017d6
commit 87ea132
Showing
8 changed files
with
465 additions
and
514 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import React, { useState } from 'react'; | ||
import { Container, Anchor, Group, Burger, Box } from '@mantine/core'; | ||
import { useDisclosure } from '@mantine/hooks'; | ||
import classes from '../../styles/DoubleHeader.module.scss'; | ||
import {AppShell} from '@mantine/core'; | ||
|
||
const userLinks = [ | ||
{ link: '#', label: 'Privacy & Security' }, | ||
{ link: '#', label: 'Account settings' }, | ||
{ link: '#', label: 'Support options' }, | ||
]; | ||
|
||
const mainLinks = [ | ||
{ link: '#', label: 'Book a demo' }, | ||
{ link: '#', label: 'Documentation' }, | ||
{ link: '#', label: 'Community' }, | ||
{ link: '#', label: 'Academy' }, | ||
{ link: '#', label: 'Forums' }, | ||
]; | ||
|
||
export function DoubleHeader() { | ||
const [opened, { toggle }] = useDisclosure(false); | ||
const [active, setActive] = useState(0); | ||
|
||
const mainItems = mainLinks.map((item, index) => ( | ||
<Anchor<'a'> | ||
href={item.link} | ||
key={item.label} | ||
className={classes.mainLink} | ||
data-active={index === active || undefined} | ||
onClick={(event) => { | ||
event.preventDefault(); | ||
setActive(index); | ||
}} | ||
> | ||
{item.label} | ||
</Anchor> | ||
)); | ||
|
||
const secondaryItems = userLinks.map((item) => ( | ||
<Anchor | ||
href={item.link} | ||
key={item.label} | ||
onClick={(event) => event.preventDefault()} | ||
className={classes.secondaryLink} | ||
> | ||
{item.label} | ||
</Anchor> | ||
)); | ||
|
||
return (<AppShell.Header className={classes.header}> | ||
<Container className={classes.inner}> | ||
OK | ||
<Box className={classes.links} visibleFrom="sm"> | ||
<Group justify="flex-end">{secondaryItems}</Group> | ||
<Group gap={0} justify="flex-end" className={classes.mainLinks}> | ||
{mainItems} | ||
</Group> | ||
</Box> | ||
<Burger | ||
opened={opened} | ||
onClick={toggle} | ||
className={classes.burger} | ||
size="sm" | ||
hiddenFrom="sm" | ||
/> | ||
</Container> | ||
</AppShell.Header> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
@use "~sass-rem" as rem-convert; | ||
|
||
.header { | ||
height: rem-convert.convert(84px); | ||
margin-bottom: rem-convert.convert(120px); | ||
background-color: var(--mantine-color-body); | ||
border-bottom: rem-convert.convert(1px) solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4)); | ||
} | ||
|
||
.inner { | ||
height: rem-convert.convert(84px); | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
} | ||
|
||
.links { | ||
padding-top: var(--mantine-spacing-lg); | ||
height: rem-convert.convert(84px); | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
} | ||
|
||
.mainLinks { | ||
margin-right: calc(var(--mantine-spacing-sm) * -1); | ||
} | ||
|
||
.mainLink { | ||
text-transform: uppercase; | ||
font-size: var(--mantine-font-size-xs); | ||
color: light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-1)); | ||
padding: rem-convert.convert(7px) var(--mantine-spacing-sm); | ||
font-weight: 700; | ||
border-bottom: rem-convert.convert(2px) solid transparent; | ||
transition: | ||
border-color 100ms ease, | ||
color 100ms ease; | ||
|
||
@mixin hover { | ||
color: light-dark(var(--mantine-color-black), var(--mantine-color-white)); | ||
text-decoration: none; | ||
} | ||
|
||
&[data-active] { | ||
color: light-dark(var(--mantine-color-black), var(--mantine-color-white)); | ||
border-bottom-color: var(--mantine-color-blue-6); | ||
} | ||
} | ||
|
||
.secondaryLink { | ||
color: light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-1)); | ||
font-size: var(--mantine-font-size-xs); | ||
text-transform: uppercase; | ||
transition: color 100ms ease; | ||
|
||
@mixin hover { | ||
color: light-dark(var(--mantine-color-black), var(--mantine-color-white)); | ||
text-decoration: none; | ||
} | ||
} |
Oops, something went wrong.