-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(navigation): Add aside menu (#28)
- Loading branch information
1 parent
c69177e
commit 67845fb
Showing
7 changed files
with
121 additions
and
18 deletions.
There are no files selected for viewing
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,43 @@ | ||
import Link from "next/link" | ||
|
||
const Menu = () => ( | ||
<ul className="menu"> | ||
<li> | ||
<Link href="/"> | ||
<a>Users</a> | ||
</Link> | ||
</li> | ||
<li> | ||
<Link href="/service/matomo"> | ||
<a>Matomo</a> | ||
</Link> | ||
</li> | ||
<li> | ||
<Link href="/service/sentry"> | ||
<a>Sentry</a> | ||
</Link> | ||
</li> | ||
<li> | ||
<Link href="/service/ovh"> | ||
<a>OVH</a> | ||
</Link> | ||
</li> | ||
<li> | ||
<Link href="/service/mattermost"> | ||
<a>Mattermost</a> | ||
</Link> | ||
</li> | ||
<li> | ||
<Link href="/service/pastek"> | ||
<a>Pastek</a> | ||
</Link> | ||
</li> | ||
<li> | ||
<Link href="/service/nextCloud"> | ||
<a>NextCloud</a> | ||
</Link> | ||
</li> | ||
</ul> | ||
) | ||
|
||
export default Menu |
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
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,60 @@ | ||
import { useRouter } from "next/router" | ||
import { MatomoUsersLoader } from "@/services/matomo" | ||
import { SentryUsersLoader } from "@/services/sentry" | ||
|
||
interface Services { | ||
[key: string]: Service | ||
} | ||
|
||
interface Service { | ||
name: string | ||
Component: () => JSX.Element | ||
} | ||
|
||
const services = { | ||
matomo: { | ||
name: "Matomo", | ||
Component: MatomoUsersLoader, | ||
}, | ||
sentry: { | ||
name: "Sentry", | ||
Component: SentryUsersLoader, | ||
}, | ||
ovh: { | ||
name: "OVH", | ||
Component: MatomoUsersLoader, | ||
}, | ||
mattermost: { | ||
name: "Mattermost", | ||
Component: MatomoUsersLoader, | ||
}, | ||
pastek: { | ||
name: "pastek", | ||
Component: MatomoUsersLoader, | ||
}, | ||
nextcloud: { | ||
name: "NextCloud", | ||
Component: MatomoUsersLoader, | ||
}, | ||
} as Services | ||
|
||
const Page = () => { | ||
const { query } = useRouter() | ||
const slug = Array.isArray(query.slug) ? query.slug[0] : query.slug | ||
|
||
if (slug) { | ||
const { name, Component } = services[slug] | ||
|
||
return ( | ||
<main> | ||
<h2>{name}</h2> | ||
<br /> | ||
<Component /> | ||
</main> | ||
) | ||
} | ||
|
||
return <></> | ||
} | ||
|
||
export default Page |
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 |
---|---|---|
|
@@ -6,6 +6,6 @@ | |
} | ||
|
||
& > div:last-child { | ||
@apply text-sm leading-4 -mt-0.5; | ||
@apply leading-4 -mt-0.5; | ||
} | ||
} |
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