From 26a0e352c62889e630a84b0333f4148f740fdd7f Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 6 Feb 2021 11:19:59 +0100 Subject: added fullwidth prop to Vierkant --- components/navbar.tsx | 21 ++++++++++++--------- components/ui.tsx | 6 +++++- pages/account.tsx | 18 ++++++++++++++++++ pages/index.tsx | 4 ++-- pages/settings.tsx | 7 +++---- 5 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 pages/account.tsx diff --git a/components/navbar.tsx b/components/navbar.tsx index 9a3f9ff..c62965a 100644 --- a/components/navbar.tsx +++ b/components/navbar.tsx @@ -27,11 +27,14 @@ export class NavBar extends Component { constructor(props: {}) { super(props); - if (typeof window === "undefined") return; // return if run on server - this.state.loggedIn = document.cookie.includes("token"); } render () { + if (typeof window !== "undefined") { // hot garbage but werks :tada: + var loggedIn = document.cookie.includes("token"); + if (this.state.loggedIn != loggedIn) + this.setState({ loggedIn }); + } return
- - { - this.state.loggedIn ? - : - - } - + + { + this.state.loggedIn ? + : + + } +
diff --git a/components/ui.tsx b/components/ui.tsx index 11b9ddd..f57a90a 100644 --- a/components/ui.tsx +++ b/components/ui.tsx @@ -12,6 +12,7 @@ export function Vierkant(props: { children?: ReactNode; className?: string; id?: string; + fullwidth?: boolean; }) { return {props.children} diff --git a/pages/account.tsx b/pages/account.tsx new file mode 100644 index 0000000..c596f11 --- /dev/null +++ b/pages/account.tsx @@ -0,0 +1,18 @@ +import { NavBar } from '../components/navbar'; +import { CenteredPage, PageTitle } from '../components/page'; +import { Vierkant } from '../components/ui'; + +export default function AccountPage() { + return ( +
+ + + Profiel + + Gert + + +
+ ); +} + diff --git a/pages/index.tsx b/pages/index.tsx index 008bec0..7d128ef 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -159,7 +159,7 @@ export default class HomePage extends Component { - +

Recente partijen

@@ -182,7 +182,7 @@ export default class HomePage extends Component {
- +

Nieuws ofzo

Chess.com heeft heel veel troep waar niemand naar kijkt

diff --git a/pages/settings.tsx b/pages/settings.tsx index 11161a3..0519b27 100644 --- a/pages/settings.tsx +++ b/pages/settings.tsx @@ -9,7 +9,6 @@ import { CurrentGameSettings } from '../components/gameSettings'; import EditOutlinedIcon from '@material-ui/icons/EditOutlined'; import VisibilityOutlinedIcon from '@material-ui/icons/VisibilityOutlined'; -var SettingsSectionStyle: CSSProperties = { width: "calc(100% - 12px)" }; var SettingsSubsectionStyle: CSSProperties = { marginTop: 24, minHeight: 40 @@ -21,7 +20,7 @@ export default function SettingsPage() { Instellingen - +

Account

@@ -49,7 +48,7 @@ export default function SettingsPage() {
- +

Kleuren

Schijfjes

@@ -64,7 +63,7 @@ export default function SettingsPage() {

Donkere modus

- +

Standaard spelregels

-- cgit v1.2.3