Fetch workspace and user from database (#94)
Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -2,7 +2,6 @@ import Navbar from './navbar/Navbar';
|
||||
import styled from '@emotion/styled';
|
||||
import { ThemeProvider } from '@emotion/react';
|
||||
import { User } from '../interfaces/user.interface';
|
||||
import { Workspace } from '../interfaces/workspace.interface';
|
||||
import { lightTheme } from './styles/themes';
|
||||
|
||||
const StyledLayout = styled.div`
|
||||
@ -22,14 +21,13 @@ const StyledRightContainer = styled.div`
|
||||
type OwnProps = {
|
||||
children: JSX.Element;
|
||||
user?: User;
|
||||
workspace?: Workspace;
|
||||
};
|
||||
|
||||
function AppLayout({ children, user, workspace }: OwnProps) {
|
||||
function AppLayout({ children, user }: OwnProps) {
|
||||
return (
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<StyledLayout>
|
||||
<Navbar user={user} workspace={workspace} />
|
||||
<Navbar user={user} workspace={user?.workspace_member?.workspace} />
|
||||
<StyledRightContainer>{children}</StyledRightContainer>
|
||||
</StyledLayout>
|
||||
</ThemeProvider>
|
||||
|
||||
@ -39,13 +39,13 @@ const StyledName = styled.div`
|
||||
font-color: ${(props) => props.theme.text0};
|
||||
`;
|
||||
|
||||
function ProfileContainer({ workspace }: OwnProps) {
|
||||
function WorkspaceContainer({ workspace }: OwnProps) {
|
||||
return (
|
||||
<StyledContainer>
|
||||
<StyledLogo logo={workspace.logo}></StyledLogo>
|
||||
<StyledName>{workspace?.name}</StyledName>
|
||||
<StyledName>{workspace?.display_name}</StyledName>
|
||||
</StyledContainer>
|
||||
);
|
||||
}
|
||||
|
||||
export default ProfileContainer;
|
||||
export default WorkspaceContainer;
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user