got tsome dummy text in the Files and GitHub menus, improved styling
This commit is contained in:
@@ -1,49 +1,6 @@
|
|||||||
import { ReactNode, useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { Link, routes } from '@redwoodjs/router'
|
import Svg from 'src/components/Svg/Svg'
|
||||||
import { Tab } from '@headlessui/react'
|
import { sidebarTopConfig, sidebarBottomConfig, sidebarCombinedConfig } from './sidebarConfig'
|
||||||
import Svg, { SvgNames } from 'src/components/Svg/Svg'
|
|
||||||
|
|
||||||
interface SidebarConfigType {
|
|
||||||
name: string,
|
|
||||||
icon: SvgNames,
|
|
||||||
disabled: boolean,
|
|
||||||
panel: ReactNode | null,
|
|
||||||
}
|
|
||||||
|
|
||||||
const sidebarTopConfig : SidebarConfigType[] = [
|
|
||||||
{
|
|
||||||
name: 'Files',
|
|
||||||
icon: 'files',
|
|
||||||
disabled: false,
|
|
||||||
panel: <h2>Some Files!</h2>,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'GitHub',
|
|
||||||
icon: 'github',
|
|
||||||
disabled: false,
|
|
||||||
panel: <h2>Le GitHub Integration™️</h2>,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Visibility',
|
|
||||||
icon: 'eye',
|
|
||||||
disabled: true,
|
|
||||||
panel: null,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
const sidebarBottomConfig : SidebarConfigType[] = [
|
|
||||||
{
|
|
||||||
name: 'Settings',
|
|
||||||
icon: 'gear',
|
|
||||||
disabled: true,
|
|
||||||
panel: null,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
const combinedConfig = [
|
|
||||||
...sidebarTopConfig,
|
|
||||||
...sidebarBottomConfig,
|
|
||||||
]
|
|
||||||
|
|
||||||
function TabToggle({ item, className = "", active, onChange, onClick }) {
|
function TabToggle({ item, className = "", active, onChange, onClick }) {
|
||||||
return (
|
return (
|
||||||
@@ -79,8 +36,8 @@ const IdeSideBar = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="flex h-full bg-ch-gray-700">
|
<section className="flex h-full bg-ch-gray-900">
|
||||||
<fieldset className="h-full flex flex-col justify-between border-r-2 border-ch-gray-900">
|
<fieldset className="h-full flex flex-col justify-between bg-ch-gray-700">
|
||||||
<div>
|
<div>
|
||||||
{ sidebarTopConfig.map((topItem, i) => (
|
{ sidebarTopConfig.map((topItem, i) => (
|
||||||
<TabToggle
|
<TabToggle
|
||||||
@@ -102,9 +59,10 @@ const IdeSideBar = () => {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
{ combinedConfig.find(item => item.name === selectedTab)?.panel && (
|
{ sidebarCombinedConfig.find(item => item.name === selectedTab)?.panel && (
|
||||||
<div className="w-56 h-full bg-ch-gray-700 py-4 px-2 text-ch-gray-300 border-t-2 border-ch-gray-900">
|
<div className="w-56 bg-ch-gray-800 text-ch-gray-300" style={{ height: 'calc(100% - 6px)', margin: '3px'}}>
|
||||||
{ combinedConfig.find(item => item.name === selectedTab).panel }
|
<h2 className="py-2 px-4 bg-ch-gray-760 mb-2">{ selectedTab }</h2>
|
||||||
|
{ sidebarCombinedConfig.find(item => item.name === selectedTab).panel }
|
||||||
</div>
|
</div>
|
||||||
) }
|
) }
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -40,6 +40,10 @@
|
|||||||
.tabToggle.disabled {
|
.tabToggle.disabled {
|
||||||
@apply text-ch-gray-550 cursor-not-allowed;
|
@apply text-ch-gray-550 cursor-not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sidebarContainer {
|
||||||
|
@apply p-2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user