refactor: add active styles for nav
This commit is contained in:
parent
4b14fcff24
commit
35adc7db03
66
app/root.tsx
66
app/root.tsx
|
|
@ -274,7 +274,12 @@ function Layout({ children }: React.PropsWithChildren<{}>) {
|
||||||
<Home size={16} />
|
<Home size={16} />
|
||||||
</ThemeIcon>
|
</ThemeIcon>
|
||||||
|
|
||||||
<Text size="sm">Home</Text>
|
<Text
|
||||||
|
size="sm"
|
||||||
|
weight={location.pathname === '/' ? 'bold' : 'normal'}
|
||||||
|
>
|
||||||
|
Home
|
||||||
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
</UnstyledButton>
|
</UnstyledButton>
|
||||||
<UnstyledButton
|
<UnstyledButton
|
||||||
|
|
@ -303,7 +308,16 @@ function Layout({ children }: React.PropsWithChildren<{}>) {
|
||||||
<Clock size={16} />
|
<Clock size={16} />
|
||||||
</ThemeIcon>
|
</ThemeIcon>
|
||||||
|
|
||||||
<Text size="sm">Time entries</Text>
|
<Text
|
||||||
|
size="sm"
|
||||||
|
weight={
|
||||||
|
location.pathname.includes('/time-entries')
|
||||||
|
? 'bold'
|
||||||
|
: 'normal'
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Time entries
|
||||||
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
</UnstyledButton>
|
</UnstyledButton>
|
||||||
<UnstyledButton
|
<UnstyledButton
|
||||||
|
|
@ -332,12 +346,21 @@ function Layout({ children }: React.PropsWithChildren<{}>) {
|
||||||
<Briefcase size={16} />
|
<Briefcase size={16} />
|
||||||
</ThemeIcon>
|
</ThemeIcon>
|
||||||
|
|
||||||
<Text size="sm">Projects</Text>
|
<Text
|
||||||
|
size="sm"
|
||||||
|
weight={
|
||||||
|
location.pathname.includes('/projects')
|
||||||
|
? 'bold'
|
||||||
|
: 'normal'
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Projects
|
||||||
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
</UnstyledButton>
|
</UnstyledButton>
|
||||||
<UnstyledButton
|
<UnstyledButton
|
||||||
component={Link}
|
component={Link}
|
||||||
to="/"
|
to="/report"
|
||||||
sx={(theme) => ({
|
sx={(theme) => ({
|
||||||
display: 'block',
|
display: 'block',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
|
|
@ -361,7 +384,16 @@ function Layout({ children }: React.PropsWithChildren<{}>) {
|
||||||
<FileText size={16} />
|
<FileText size={16} />
|
||||||
</ThemeIcon>
|
</ThemeIcon>
|
||||||
|
|
||||||
<Text size="sm">Report</Text>
|
<Text
|
||||||
|
size="sm"
|
||||||
|
weight={
|
||||||
|
location.pathname.includes('/report')
|
||||||
|
? 'bold'
|
||||||
|
: 'normal'
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Report
|
||||||
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
</UnstyledButton>
|
</UnstyledButton>
|
||||||
<UnstyledButton
|
<UnstyledButton
|
||||||
|
|
@ -390,12 +422,21 @@ function Layout({ children }: React.PropsWithChildren<{}>) {
|
||||||
<Upload size={16} />
|
<Upload size={16} />
|
||||||
</ThemeIcon>
|
</ThemeIcon>
|
||||||
|
|
||||||
<Text size="sm">Import/Export</Text>
|
<Text
|
||||||
|
size="sm"
|
||||||
|
weight={
|
||||||
|
location.pathname.includes('/importexport')
|
||||||
|
? 'bold'
|
||||||
|
: 'normal'
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Import/Export
|
||||||
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
</UnstyledButton>
|
</UnstyledButton>
|
||||||
<UnstyledButton
|
<UnstyledButton
|
||||||
component={Link}
|
component={Link}
|
||||||
to="/"
|
to="/statistics"
|
||||||
sx={(theme) => ({
|
sx={(theme) => ({
|
||||||
display: 'block',
|
display: 'block',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
|
|
@ -419,7 +460,16 @@ function Layout({ children }: React.PropsWithChildren<{}>) {
|
||||||
<BarChart2 size={16} />
|
<BarChart2 size={16} />
|
||||||
</ThemeIcon>
|
</ThemeIcon>
|
||||||
|
|
||||||
<Text size="sm">Statistics</Text>
|
<Text
|
||||||
|
size="sm"
|
||||||
|
weight={
|
||||||
|
location.pathname.includes('/statistics')
|
||||||
|
? 'bold'
|
||||||
|
: 'normal'
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Statistics
|
||||||
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
</UnstyledButton>
|
</UnstyledButton>
|
||||||
</Navbar.Section>
|
</Navbar.Section>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue