navigation from config + further mobile tweaks

This commit is contained in:
2022-12-11 02:13:21 +01:00
parent aaf7403e21
commit 78245b8501
3 changed files with 54 additions and 16 deletions

View File

@@ -34,3 +34,18 @@
transform: scale(1.1); transform: scale(1.1);
} }
} }
.mobile {
display: none;
}
@media screen and (max-width: 800px) {
.nav {
min-height: 3rem;
}
.desktop {
display: none;
}
.mobile {
display: inherit;
}
}

View File

@@ -2,34 +2,39 @@ import styles from "./Navigation.module.scss";
import GractwoLogo from "../logo"; import GractwoLogo from "../logo";
import Link from "next/link"; import Link from "next/link";
import config from "../../data/config.json";
const PageNavigation = () => { const PageNavigation = () => {
let username: string = ""; let username: string = "";
return ( return (
<> <>
<div className={styles.nav}> <div className={styles.nav}>
<GractwoLogo className={styles.logo} /> <GractwoLogo className={`${styles.logo} ${styles.desktop}`} />
{/* <h1 className={styles.wordmark}>Gractwo!</h1> */} {/* <GractwoLogo
<Link href="/" className={styles.link}> width={48}
główna height={48}
</Link> className={`${styles.logo} ${styles.mobile}`}
<Link href="/o-gractwie" className={styles.link}> /> */}
o gractwie {config.navigation.map((navlink) => {
</Link> return (
<Link href="/cytaty" className={styles.link}> <Link
cytaty key={`desktop${navlink.href}`}
</Link> href={navlink.href}
<Link href="/rankingi" className={styles.link}> className={`${styles.link} ${styles.desktop}`}
rankingi >
</Link> {navlink.name}
</Link>
);
})}
<Link <Link
href="/" href=""
style={{ display: "flex" }} style={{ display: "flex" }}
className={`${styles.link} ${styles.profile}`} className={`${styles.link} ${styles.profile}`}
> >
zaloguj się zaloguj się
</Link> </Link>
<Link <Link
href="/" href=""
style={{ display: "none" }} style={{ display: "none" }}
className={`${styles.link} ${styles.profile}`} className={`${styles.link} ${styles.profile}`}
> >

View File

@@ -45,6 +45,24 @@
"author": "mollin" "author": "mollin"
} }
], ],
"navigation": [
{
"name": "główna",
"href": "/"
},
{
"name": "o gractwie",
"href": "/o-gractwie"
},
{
"name": "cytaty",
"href": "/cytaty"
},
{
"name": "rankingi",
"href": "/rankingi"
}
],
"links": [ "links": [
{ {
"name": "Discord", "name": "Discord",