diff --git a/app/web/package.json b/app/web/package.json index 77285a4..dc59ed2 100644 --- a/app/web/package.json +++ b/app/web/package.json @@ -13,7 +13,7 @@ ] }, "dependencies": { - "@headlessui/react": "^1.0.0", + "@headlessui/react": "^1.4.1", "@heroicons/react": "^1.0.4", "@material-ui/core": "^4.11.0", "@monaco-editor/react": "^4.0.11", diff --git a/app/web/src/components/IdeSideBar/IdeSideBar.tsx b/app/web/src/components/IdeSideBar/IdeSideBar.tsx index d76b2a9..b5941bf 100644 --- a/app/web/src/components/IdeSideBar/IdeSideBar.tsx +++ b/app/web/src/components/IdeSideBar/IdeSideBar.tsx @@ -1,5 +1,44 @@ import { Link, routes } from '@redwoodjs/router' -import Svg from 'src/components/Svg/Svg' +import { Tab } from '@headlessui/react' +import Svg, { SvgNames } from 'src/components/Svg/Svg' +import { ReactNode } from 'react' + +interface SidebarConfigType { + name: string, + icon: SvgNames, + disabled: boolean, + panel: ReactNode | null, +} + +const sidebarTopConfig : SidebarConfigType[] = [ + { + name: 'Files', + icon: 'files', + disabled: false, + panel: () => {

Some Files!

}, + }, + { + name: 'GitHub', + icon: 'github', + disabled: false, + panel: () => {

Le GitHub Integration™️

}, + }, + { + name: 'Visibility', + icon: 'eye', + disabled: true, + panel: null, + }, +] + +const sidebarBottomConfig : SidebarConfigType[] = [ + { + name: 'Settings', + icon: 'gear', + disabled: true, + panel: null, + }, +] const IdeSideBar = () => { return ( @@ -9,13 +48,33 @@ const IdeSideBar = () => { - + + +
+ { sidebarTopConfig.map(topItem => ( + + + + ))} +
+
+ { sidebarBottomConfig.map(bottomItem => ( + + + + ))} +
+
+ + { ([...sidebarTopConfig, ...sidebarBottomConfig]).map(item => item.panel && ( + { item.panel } + )) } + +
) } diff --git a/app/web/src/components/Svg/Svg.tsx b/app/web/src/components/Svg/Svg.tsx index e9974d9..84cdcc7 100644 --- a/app/web/src/components/Svg/Svg.tsx +++ b/app/web/src/components/Svg/Svg.tsx @@ -1,4 +1,4 @@ -type SvgNames = +export type SvgNames = | 'arrow-down' // | 'arrow' | 'arrow-left' @@ -8,12 +8,15 @@ type SvgNames = | 'dots-vertical' | 'drag-grid' | 'exclamation-circle' + | 'eye' | 'favicon' + | 'files' | 'flag' | 'floppy-disk' | 'fork' | 'fork-new' | 'gear' + | 'github' | 'lightbulb' | 'logout' | 'mac-cmd-key' @@ -159,6 +162,12 @@ const Svg = ({ /> ), + eye: ( + + + + + ), favicon: ( @@ -258,6 +267,12 @@ const Svg = ({ ), + files: ( + + + + + ), flag: ( ), + github: ( + + + + ), lightbulb: (