diff --git a/app/web/config/tailwind.config.js b/app/web/config/tailwind.config.js index 90382d8..f9123b6 100644 --- a/app/web/config/tailwind.config.js +++ b/app/web/config/tailwind.config.js @@ -98,6 +98,9 @@ module.exports = { minHeight: { md: '28rem', }, + outline: { + gray: ['2px solid #3B3E4B', '8px'], + }, skew: { '-20': '-20deg', }, diff --git a/app/web/src/components/IdeContainer/IdeContainer.tsx b/app/web/src/components/IdeContainer/IdeContainer.tsx index b67be61..d5058b3 100644 --- a/app/web/src/components/IdeContainer/IdeContainer.tsx +++ b/app/web/src/components/IdeContainer/IdeContainer.tsx @@ -106,7 +106,7 @@ const IdeContainer = () => { }} value={state.layout} onChange={(newLayout) => - thunkDispatch({ type: 'setLayout', payload: { message: newLayout } }) + thunkDispatch({ type: 'setLayout', payload: newLayout }) } onRelease={handleViewerSizeUpdate} /> diff --git a/app/web/src/components/IdeSideBar/sidebarConfig.tsx b/app/web/src/components/IdeSideBar/sidebarConfig.tsx index 11925e5..1f20584 100644 --- a/app/web/src/components/IdeSideBar/sidebarConfig.tsx +++ b/app/web/src/components/IdeSideBar/sidebarConfig.tsx @@ -1,6 +1,9 @@ -import React, { ReactNode } from 'react' +import { ReactNode } from 'react' import { SvgNames } from 'src/components/Svg/Svg' import { useIdeContext } from 'src/helpers/hooks/useIdeContext' +import { createRemoveUpdate, updateTree } from 'react-mosaic-component' +import type { MosaicPath } from 'react-mosaic-component' +import Toggle from 'src/components/Toggle' interface SidebarConfigType { name: string @@ -9,6 +12,39 @@ interface SidebarConfigType { panel: ReactNode | null } +interface MosaicTree { + first: string | MosaicTree + second: string | MosaicTree +} + +const getPathById = ( + tree: MosaicTree, + id: string, + path: MosaicPath = [] +): MosaicPath => { + if (tree.first === id || tree.second === id) { + return [...path, tree.first === id ? 'first' : 'second'] + } + if (typeof tree.first !== 'string' && typeof tree.second !== 'string') { + throw new Error('id not found') + } + try { + if (typeof tree.first !== 'string') { + return getPathById(tree.first, id, [...path, 'first']) + } + } catch (error) { + throw new Error('id not found') + } + try { + if (typeof tree.second !== 'string') { + return getPathById(tree.second, id, [...path, 'second']) + } + } catch (error) { + throw new Error('id not found') + } + throw new Error('id not found') +} + export const sidebarTopConfig: SidebarConfigType[] = [ { name: 'Files', @@ -105,18 +141,60 @@ const settingsConfig: settingsConfig[] = [ { title: 'Console', name: 'console', - Content: () => ( -
- Coming Soon -
-
- We're building configuration settings for the Viewer pane now. Join us
- on