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 +++++- 2 files changed, 17 insertions(+), 10 deletions(-) (limited to 'components') 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} -- cgit v1.2.3