feat: add workspace route

This commit is contained in:
DiamondThree
2023-01-10 11:43:21 +08:00
parent 030ec9fa88
commit 779463dada
6 changed files with 176 additions and 20 deletions
@@ -1 +1 @@
export * from './Delete';
export { WorkspaceDelete } from './Delete';
@@ -1 +1 @@
export * from './General';
export { GeneralPage } from './General';
@@ -1 +1 @@
export * from './Leave';
export { WorkspaceLeave } from './Leave';
@@ -4,22 +4,15 @@ import MuiAvatar from '@mui/material/Avatar';
export const StyledSettingContainer = styled('div')(({ theme }) => {
return {
position: 'relative',
display: 'flex',
padding: '0px',
width: '961px',
background: theme.colors.popoverBackground,
borderRadius: '12px',
overflow: 'hidden',
padding: '50px',
flexDirection: 'column',
};
});
export const StyledSettingSidebar = styled('div')(({ theme }) => {
{
return {
width: '212px',
height: '620px',
background: theme.mode === 'dark' ? '#272727' : '#FBFBFC',
flexShrink: 0,
flexGrow: 0,
};
@@ -59,7 +52,6 @@ export const StyledSettingTabContainer = styled('ul')(() => {
{
return {
display: 'flex',
flexDirection: 'column',
marginTop: '25px',
};
}
@@ -32,7 +32,7 @@ import { IconButton } from '@/ui/button';
import useLocalStorage from '@/hooks/use-local-storage';
import usePageMetaList from '@/hooks/use-page-meta-list';
import { usePageHelper } from '@/hooks/use-page-helper';
import { WorkspaceSetting } from '@/components/workspace-setting';
// import { WorkspaceSetting } from '@/components/workspace-setting';
import { useTranslation } from 'react-i18next';
import { WorkspaceSelector } from './WorkspaceSelector/WorkspaceSelector';
@@ -78,14 +78,15 @@ export const WorkSpaceSliderBar = () => {
const [showTip, setShowTip] = useState(false);
const [show, setShow] = useLocalStorage('AFFiNE_SLIDE_BAR', false, true);
const [showWorkspaceSetting, setShowWorkspaceSetting] = useState(false);
const paths = {
all: currentWorkspaceId ? `/workspace/${currentWorkspaceId}/all` : '',
favorite: currentWorkspaceId
? `/workspace/${currentWorkspaceId}/favorite`
: '',
trash: currentWorkspaceId ? `/workspace/${currentWorkspaceId}/trash` : '',
setting: currentWorkspaceId
? `/workspace/${currentWorkspaceId}/setting`
: '',
};
return (
@@ -154,18 +155,22 @@ export const WorkSpaceSliderBar = () => {
<FavoriteList showList={showSubFavorite} />
<StyledListItem
onClick={() => {
setShowWorkspaceSetting(true);
// setShowWorkspaceSetting(true);
}}
>
<SettingsIcon /> Setting
<StyledLink href={{ pathname: paths.setting }}>
<FavouritesIcon />
{t('Setting')}
</StyledLink>
<SettingsIcon />
</StyledListItem>
<WorkspaceSetting
{/* <WorkspaceSetting
isShow={showWorkspaceSetting}
onClose={() => {
setShowWorkspaceSetting(false);
}}
/>
/> */}
<StyledListItem
onClick={() => {