From de2853cc4793b7948b94525a0a4f964e49943131 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Wed, 21 Apr 2021 09:57:40 +0200 Subject: even more components without inline css --- components/gameSettings.tsx | 60 ++++++++++++--------------------------------- components/navbar.tsx | 42 +++---------------------------- styles/gameSettings.css | 25 +++++++++++++++---- styles/navbar.css | 25 +++++++++++++++++++ styles/notifications.css | 5 ++-- 5 files changed, 67 insertions(+), 90 deletions(-) diff --git a/components/gameSettings.tsx b/components/gameSettings.tsx index bb01284..13462be 100644 --- a/components/gameSettings.tsx +++ b/components/gameSettings.tsx @@ -1,5 +1,5 @@ import axios from 'axios'; -import { Component, CSSProperties, ReactNode, useEffect, useState } from 'react'; +import { ReactNode, useEffect, useState } from 'react'; import { ruleset, userPreferences } from '../api/api'; import { DialogBox } from './dialogBox'; @@ -71,24 +71,15 @@ function GameSettingsSection(props: { id={props.id} className='pad-m editableRulesSection' > - + {props.title} - +
+ +
{props.children}
; } @@ -96,19 +87,10 @@ function GameSettingsSection(props: { function GameRule(props: { title: string; description: string; - style?: CSSProperties; }) { - return
-

{props.title}

-

{props.description}

+ return
+

{props.title}

+

{props.description}

; } @@ -161,28 +143,16 @@ export function EditGameSettings(props: editGameSettingsProps) { />
- + Timer gebruiken voor bijde spelers - {false && -
+ {true && +
- +
} + return
@@ -90,29 +72,13 @@ export function NavBar() {
- {loggedIn && + {loggedIn &&
setNotificationsAreaVisible(!notificationsAreaVisible)} > - {gotNotifications &&
} + {gotNotifications &&
}
.iconWrapper { + cursor: pointer; +} + +.notifications .notificationDot { + background-color: var(--accent); + width: 8px; + height: 8px; + border-radius: 4px; + top: 2px; + right: 2px; +} diff --git a/styles/notifications.css b/styles/notifications.css index ec47836..db1598d 100644 --- a/styles/notifications.css +++ b/styles/notifications.css @@ -1,4 +1,5 @@ -.notificationsArea { +/* a tags are here because of css specificity */ +a.notificationsArea { left: calc(48px + var(--spacing-medium)); top: 92px; transform: translateY(-100%); @@ -7,7 +8,7 @@ height: 450px; } -.notificationsArea .tuitje { +a.notificationsArea .tuitje { left: var(--spacing-medium); bottom: 86px; transform: translate(-100%, 100%) rotate(90deg); -- cgit v1.2.3