Lucas/t 369 on comment drawer i can reply to a comment thread and it (#206)

* Added prisma to suggested extension in container

* Added comments and authors on drawer with proper resolving

* Fix lint

* Fix console log

* Fixed generated front graphql from rebase

* Fixed right drawer width and shared in theme

* Added date packages and tooltip

* Added date utils and tests

* Added comment thread components

* Fixed comment chip

* wip

* wip 2

* - Added string typing for DateTime scalar
- Refactored user in a recoil state and workspace using it
- Added comment creation

* Prepared EditableCell refactor

* Fixed line height and tooltip

* Fix lint
This commit is contained in:
Lucas Bordeau
2023-06-08 10:36:37 +02:00
committed by GitHub
parent 5e2673a2a4
commit ce4ba10f7b
31 changed files with 395 additions and 167 deletions

View File

@ -1,6 +1,7 @@
import styled from '@emotion/styled';
import { useRecoilState } from 'recoil';
import { User } from '@/users/interfaces/user.interface';
import { currentUserState } from '@/auth/states/currentUserState';
import { Navbar } from './navbar/Navbar';
@ -23,16 +24,17 @@ const MainContainer = styled.div`
type OwnProps = {
children: JSX.Element;
user?: User;
};
export function AppLayout({ children, user }: OwnProps) {
const userIsAuthenticated = !!user;
export function AppLayout({ children }: OwnProps) {
const currentUser = useRecoilState(currentUserState);
const userIsAuthenticated = !!currentUser;
return (
<StyledLayout>
{userIsAuthenticated ? (
<>
<Navbar user={user} workspace={user?.workspaceMember?.workspace} />
<Navbar />
<MainContainer>{children}</MainContainer>
</>
) : (

View File

@ -2,9 +2,6 @@ import { TbBuilding, TbUser } from 'react-icons/tb';
import { useMatch, useResolvedPath } from 'react-router-dom';
import styled from '@emotion/styled';
import { User } from '@/users/interfaces/user.interface';
import { Workspace } from '@/workspaces/interfaces/workspace.interface';
import NavItem from './NavItem';
import NavTitle from './NavTitle';
import WorkspaceContainer from './WorkspaceContainer';
@ -23,16 +20,11 @@ const NavItemsContainer = styled.div`
margin-top: 40px;
`;
type OwnProps = {
user?: User;
workspace?: Workspace;
};
export function Navbar({ workspace }: OwnProps) {
export function Navbar() {
return (
<>
<NavbarContainer>
{workspace && <WorkspaceContainer workspace={workspace} />}
<WorkspaceContainer />
<NavItemsContainer>
<NavTitle label="Workspace" />
<NavItem

View File

@ -1,10 +1,7 @@
import styled from '@emotion/styled';
import { useRecoilValue } from 'recoil';
import { Workspace } from '@/workspaces/interfaces/workspace.interface';
type OwnProps = {
workspace: Workspace;
};
import { currentUserState } from '@/auth/states/currentUserState';
const StyledContainer = styled.button`
display: inline-flex;
@ -39,11 +36,19 @@ const StyledName = styled.div`
color: ${(props) => props.theme.text80};
`;
function WorkspaceContainer({ workspace }: OwnProps) {
function WorkspaceContainer() {
const currentUser = useRecoilValue(currentUserState);
const currentWorkspace = currentUser?.workspaceMember?.workspace;
if (!currentWorkspace) {
return null;
}
return (
<StyledContainer>
<StyledLogo logo={workspace.logo}></StyledLogo>
<StyledName>{workspace?.displayName}</StyledName>
<StyledLogo logo={currentWorkspace?.logo}></StyledLogo>
<StyledName>{currentWorkspace?.displayName}</StyledName>
</StyledContainer>
);
}

View File

@ -0,0 +1,6 @@
import { atom } from 'recoil';
export const themeEnabledState = atom<boolean>({
key: 'ui/theme-enabled',
default: true,
});

View File

@ -15,6 +15,7 @@ const commonTheme = {
fontWeightBold: 500,
fontFamily: 'Inter, sans-serif',
lineHeight: '150%',
spacing: (multiplicator: number) => `${multiplicator * 4}px`,