From 381aa865bdeb358dc4a63f3f9848055da62abc08 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 12 Mar 2021 13:27:58 +0100 Subject: WIP friend requests dialog --- components/gameBar.tsx | 4 +- components/navbar.tsx | 108 +++++++++++++++++++++++++++++++++++++++++++++++-- components/ui.tsx | 38 +++++++++++++++++ 3 files changed, 146 insertions(+), 4 deletions(-) diff --git a/components/gameBar.tsx b/components/gameBar.tsx index cacb5e8..f26201c 100644 --- a/components/gameBar.tsx +++ b/components/gameBar.tsx @@ -1,5 +1,5 @@ import { CSSProperties, ReactNode } from 'react'; -import { Vierkant } from './ui'; +import { Vierkant, Bubble } from './ui'; import SettingsRoundedIcon from '@material-ui/icons/SettingsRounded'; import ExitToAppRoundedIcon from '@material-ui/icons/ExitToAppRounded'; @@ -71,6 +71,8 @@ export function GameBar(props: {
+ + diff --git a/components/navbar.tsx b/components/navbar.tsx index 7da6716..2c7ce32 100644 --- a/components/navbar.tsx +++ b/components/navbar.tsx @@ -1,6 +1,9 @@ import { CSSProperties, useEffect, useState } from "react"; import { LogoDark } from "../components/logo"; +import { AccountAvatar } from "./account"; +import { userInfo } from "../api/api"; +import { Bubble, Vierkant, Button } from './ui'; import Home from '@material-ui/icons/Home'; import VideogameAssetIcon from '@material-ui/icons/VideogameAsset'; @@ -8,7 +11,86 @@ import ExtensionIcon from '@material-ui/icons/Extension'; import SearchIcon from '@material-ui/icons/Search'; import SettingsIcon from '@material-ui/icons/Settings'; import PersonIcon from '@material-ui/icons/Person'; -import { AccountAvatar } from "./account"; +import GroupAddIcon from '@material-ui/icons/GroupAdd'; +import DoneIcon from '@material-ui/icons/Done'; +import CloseIcon from '@material-ui/icons/Close'; + +function FriendRequestsBubble(props: { + visible?: boolean; +}) { + return props.visible && +

Vriendschapsverzoeken

+
+ + + + + + +
+
+} + +var FriendRequestButtonStyle: CSSProperties = { + display: "inline-block", + padding: 12, + borderRadius: 6, + marginLeft: 6 +}; + +function FriendRequest(props: { + user: userInfo; +}) { + return + + +} + var NavBarItemStyle: CSSProperties = { margin: 12, @@ -20,6 +102,8 @@ export function NavBar() { var [ loggedIn, setLoggedIn ] = useState(false); useEffect(() => setLoggedIn(document.cookie.includes("token")), []); + var [ friendRequestDialogVisible, setFriendRequestDialogVisible ] = useState(false); + return
@@ -48,6 +133,23 @@ export function NavBar() { left: 0, backgroundColor: "var(--background)" }}> + { loggedIn && +
setFriendRequestDialogVisible(!friendRequestDialogVisible)}> + +
+