From 5167100285939356fadf6bc8075ebe71a26d6c1f Mon Sep 17 00:00:00 2001 From: ReddixT Date: Tue, 3 Jan 2023 19:00:26 +0100 Subject: [PATCH] feat: add closeable sidebar feat: add password for workspace refactor: remove account folder fix: background color for sidebar --- .../pages/[workspaceId]/[[...pageId]].tsx | 103 +++++++++++++++--- .../pages/{account/index.tsx => account.tsx} | 0 lumium-space/pages/auth/signin.tsx | 2 - .../src/components/forms/CreateWorkspace.tsx | 8 +- .../src/sections/workspace/NavBar.tsx | 41 +++---- .../src/sections/workspace/SideBar.tsx | 73 ++++++------- 6 files changed, 145 insertions(+), 82 deletions(-) rename lumium-space/pages/{account/index.tsx => account.tsx} (100%) diff --git a/lumium-space/pages/[workspaceId]/[[...pageId]].tsx b/lumium-space/pages/[workspaceId]/[[...pageId]].tsx index 68ae28b2..c8b1746a 100644 --- a/lumium-space/pages/[workspaceId]/[[...pageId]].tsx +++ b/lumium-space/pages/[workspaceId]/[[...pageId]].tsx @@ -1,5 +1,5 @@ -import React from 'react'; -import { Heading, Button, Divider, Modal } from "@chakra-ui/react"; +import React, { useState } from 'react'; +import { Heading, Button, Divider, Modal, FormControl, FormErrorMessage, FormLabel, Input, InputGroup, InputRightElement, Stack, useColorModeValue } from "@chakra-ui/react"; import { useWorkspace, useUserInfo } from "@hooks/api"; import { useRouter } from "next/router"; import { @@ -14,6 +14,8 @@ import { Authenticator } from '@components/security/Authenticator'; import { LumiumRenderer } from '@components/rendering'; import SideBar from '@sections/workspace/SideBar'; import MobileNav from '@sections/workspace/NavBar'; +import { useFormik } from 'formik'; +import { ViewIcon, ViewOffIcon } from '@chakra-ui/icons'; const Workspace: React.FC = () => { const router = useRouter(); @@ -21,16 +23,27 @@ const Workspace: React.FC = () => { const workspace = useWorkspace(workspaceId); const { userInfo } = useUserInfo(); const { isOpen, onOpen, onClose } = useDisclosure(); + const [passwordEntered, setPasswordEntered] = useState(false); + const [showPassword, setShowPassword] = useState(false); + const handlePasswordEntered = () => { + setPasswordEntered(true); + } + const formik = useFormik({ + initialValues: { + password: "", + }, + onSubmit: handlePasswordEntered, + validateOnChange: (false), + }); + const darkLogo = '/logo/svg/Black logo - no background.svg'; + const lightLogo = '/logo/svg/White logo - no background.svg'; + let logo = useColorModeValue(darkLogo, lightLogo); + let backgroundColor = useColorModeValue('#ffffff', '#1a1a1a'); + let disclaimerButtonColor = useColorModeValue('green', 'darkgreen'); return ( - onClose} - display={{ base: 'none', md: 'block' }} - workspace={workspace} - userInfo={userInfo} - /> { onClose={onClose} returnFocusOnClose={false} onOverlayClick={onClose} - size="full"> + size={{ base: "full", md: "xs" }} + > - + {/* mobilenav */} - + { (workspace?.name && userInfo?.nickName && !pageId) && Welcome to the {workspace?.name} workspace, {userInfo?.nickName}! - - } - { - pageId && + || + !passwordEntered && + + + + Enter the password for "{workspace?.name}" + +
+ + Password + + + + + + + + + + + +
+
+
+ || pageId &&