|
@@ -1,12 +1,13 @@
|
|
-import { Workspace } from '../Workspace';
|
|
|
|
|
|
+import { WorkspaceUser } from '../WorkspaceUser';
|
|
import { AppLogo } from '../AppLogo';
|
|
import { AppLogo } from '../AppLogo';
|
|
import { FolderItem } from './FolderItem';
|
|
import { FolderItem } from './FolderItem';
|
|
-import { PluginsButton } from './PluginsButton';
|
|
|
|
import { TrashButton } from './TrashButton';
|
|
import { TrashButton } from './TrashButton';
|
|
import { NewFolderButton } from './NewFolderButton';
|
|
import { NewFolderButton } from './NewFolderButton';
|
|
import { NavigationResizer } from './NavigationResizer';
|
|
import { NavigationResizer } from './NavigationResizer';
|
|
import { IFolder } from '../../../stores/reducers/folders/slice';
|
|
import { IFolder } from '../../../stores/reducers/folders/slice';
|
|
import { IPage } from '../../../stores/reducers/pages/slice';
|
|
import { IPage } from '../../../stores/reducers/pages/slice';
|
|
|
|
+import { useNavigate } from 'react-router-dom';
|
|
|
|
+import React from 'react';
|
|
|
|
|
|
export const NavigationPanel = ({
|
|
export const NavigationPanel = ({
|
|
onCollapseNavigationClick,
|
|
onCollapseNavigationClick,
|
|
@@ -26,27 +27,22 @@ export const NavigationPanel = ({
|
|
<div className={'flex flex-col justify-between bg-surface-1 text-sm'} style={{ width: `${width}px` }}>
|
|
<div className={'flex flex-col justify-between bg-surface-1 text-sm'} style={{ width: `${width}px` }}>
|
|
<div className={'flex flex-col'}>
|
|
<div className={'flex flex-col'}>
|
|
<AppLogo iconToShow={'hide'} onHideMenuClick={onCollapseNavigationClick}></AppLogo>
|
|
<AppLogo iconToShow={'hide'} onHideMenuClick={onCollapseNavigationClick}></AppLogo>
|
|
-
|
|
|
|
- <Workspace></Workspace>
|
|
|
|
-
|
|
|
|
- <div className={'flex flex-col px-2'}>
|
|
|
|
- {folders.map((folder, index) => (
|
|
|
|
- <FolderItem
|
|
|
|
- key={index}
|
|
|
|
- folder={folder}
|
|
|
|
- pages={pages.filter((page) => page.folderId === folder.id)}
|
|
|
|
- onPageClick={onPageClick}
|
|
|
|
- ></FolderItem>
|
|
|
|
- ))}
|
|
|
|
- </div>
|
|
|
|
|
|
+ <WorkspaceUser></WorkspaceUser>
|
|
|
|
+ <WorkspaceApps folders={folders} pages={pages} onPageClick={onPageClick} />
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div className={'flex flex-col'}>
|
|
<div className={'flex flex-col'}>
|
|
<div className={'border-b border-shade-6 px-2 pb-4'}>
|
|
<div className={'border-b border-shade-6 px-2 pb-4'}>
|
|
- <PluginsButton></PluginsButton>
|
|
|
|
|
|
+ {/*<PluginsButton></PluginsButton>*/}
|
|
|
|
+
|
|
|
|
+ <DesignSpec></DesignSpec>
|
|
|
|
+ <TestBackendButton></TestBackendButton>
|
|
|
|
+
|
|
|
|
+ {/*Trash Button*/}
|
|
<TrashButton></TrashButton>
|
|
<TrashButton></TrashButton>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
+ {/*New Folder Button*/}
|
|
<NewFolderButton></NewFolderButton>
|
|
<NewFolderButton></NewFolderButton>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -54,3 +50,47 @@ export const NavigationPanel = ({
|
|
</>
|
|
</>
|
|
);
|
|
);
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+type AppsContext = {
|
|
|
|
+ folders: IFolder[];
|
|
|
|
+ pages: IPage[];
|
|
|
|
+ onPageClick: (page: IPage) => void;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const WorkspaceApps: React.FC<AppsContext> = ({ folders, pages, onPageClick }) => (
|
|
|
|
+ <div className={'flex flex-col px-2'}>
|
|
|
|
+ {folders.map((folder, index) => (
|
|
|
|
+ <FolderItem
|
|
|
|
+ key={index}
|
|
|
|
+ folder={folder}
|
|
|
|
+ pages={pages.filter((page) => page.folderId === folder.id)}
|
|
|
|
+ onPageClick={onPageClick}
|
|
|
|
+ ></FolderItem>
|
|
|
|
+ ))}
|
|
|
|
+ </div>
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+export const TestBackendButton = () => {
|
|
|
|
+ const navigate = useNavigate();
|
|
|
|
+ return (
|
|
|
|
+ <button
|
|
|
|
+ onClick={() => navigate('/page/api-test')}
|
|
|
|
+ className={'flex w-full items-center rounded-lg px-4 py-2 hover:bg-surface-2'}
|
|
|
|
+ >
|
|
|
|
+ APITest
|
|
|
|
+ </button>
|
|
|
|
+ );
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+export const DesignSpec = () => {
|
|
|
|
+ const navigate = useNavigate();
|
|
|
|
+
|
|
|
|
+ return (
|
|
|
|
+ <button
|
|
|
|
+ onClick={() => navigate('page/colors')}
|
|
|
|
+ className={'flex w-full items-center rounded-lg px-4 py-2 hover:bg-surface-2'}
|
|
|
|
+ >
|
|
|
|
+ Design Specs
|
|
|
|
+ </button>
|
|
|
|
+ );
|
|
|
|
+};
|