Coming Soon
We're working on multi-file support in tandem with the GitHub integration.
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'
import type { MosaicTree } from 'src/helpers/hooks/useIdeState'
interface SidebarConfigType {
name: string
icon: SvgNames
disabled: boolean
panel: ReactNode | null
}
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',
icon: 'files',
disabled: false,
panel: (
Coming Soon
We're working on multi-file support in tandem with the GitHub
integration.
Coming Soon
This integration will allow you to sync a project with a GitHub repo
and push changes back to it as a commit!
Coming Soon
We're building configuration settings for the Viewer pane now. Join us
on
Coming Soon
We're building configuration settings for the Viewer pane now. Join us
on