rename panel components + fix borders
This commit is contained in:
parent
1d887e81ef
commit
107a3acd3a
3 changed files with 13 additions and 14 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import Loader from '@src/repl/components/Loader';
|
import Loader from '@src/repl/components/Loader';
|
||||||
import { HorizontalPanel } from '@src/repl/components/panel/Panel';
|
import { BottomPanel } from '@src/repl/components/panel/Panel';
|
||||||
import { Code } from '@src/repl/components/Code';
|
import { Code } from '@src/repl/components/Code';
|
||||||
import BigPlayButton from '@src/repl/components/BigPlayButton';
|
import BigPlayButton from '@src/repl/components/BigPlayButton';
|
||||||
import UserFacingErrorMessage from '@src/repl/components/UserFacingErrorMessage';
|
import UserFacingErrorMessage from '@src/repl/components/UserFacingErrorMessage';
|
||||||
|
|
@ -20,7 +20,7 @@ export default function UdelsEditor(Props) {
|
||||||
<Code containerRef={containerRef} editorRef={editorRef} init={init} />
|
<Code containerRef={containerRef} editorRef={editorRef} init={init} />
|
||||||
</div>
|
</div>
|
||||||
<UserFacingErrorMessage error={error} />
|
<UserFacingErrorMessage error={error} />
|
||||||
<HorizontalPanel context={context} />
|
<BottomPanel context={context} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Code } from '@src/repl/components/Code';
|
import { Code } from '@src/repl/components/Code';
|
||||||
import Loader from '@src/repl/components/Loader';
|
import Loader from '@src/repl/components/Loader';
|
||||||
import { HorizontalPanel, MainPanel, VerticalPanel } from '@src/repl/components/panel/Panel';
|
import { BottomPanel, MainPanel, RightPanel } from '@src/repl/components/panel/Panel';
|
||||||
import UserFacingErrorMessage from '@src/repl/components/UserFacingErrorMessage';
|
import UserFacingErrorMessage from '@src/repl/components/UserFacingErrorMessage';
|
||||||
import { useSettings } from '@src/settings.mjs';
|
import { useSettings } from '@src/settings.mjs';
|
||||||
|
|
||||||
|
|
@ -23,11 +23,11 @@ export default function ReplEditor(Props) {
|
||||||
<MainPanel context={context} isEmbedded={isEmbedded} />
|
<MainPanel context={context} isEmbedded={isEmbedded} />
|
||||||
<div className="flex overflow-hidden h-full">
|
<div className="flex overflow-hidden h-full">
|
||||||
<Code containerRef={containerRef} editorRef={editorRef} init={init} />
|
<Code containerRef={containerRef} editorRef={editorRef} init={init} />
|
||||||
{!isZen && panelPosition === 'right' && <VerticalPanel context={context} />}
|
{!isZen && panelPosition === 'right' && <RightPanel context={context} />}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<UserFacingErrorMessage error={error} />
|
<UserFacingErrorMessage error={error} />
|
||||||
{!isZen && panelPosition === 'bottom' && <HorizontalPanel context={context} />}
|
{!isZen && panelPosition === 'bottom' && <BottomPanel context={context} />}
|
||||||
{/* <MainPanel context={context} isEmbedded={isEmbedded} className="block sm:hidden" /> */}
|
{/* <MainPanel context={context} isEmbedded={isEmbedded} className="block sm:hidden" /> */}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ function PanelCloseButton() {
|
||||||
isPanelOpen && (
|
isPanelOpen && (
|
||||||
<button
|
<button
|
||||||
onClick={() => setIsPanelOpened(false)}
|
onClick={() => setIsPanelOpened(false)}
|
||||||
className={cx('border-l border-muted px-2 py-0 text-foreground hover:opacity-50')}
|
className={cx('px-2 py-0 text-foreground hover:opacity-50')}
|
||||||
aria-label="Close Menu"
|
aria-label="Close Menu"
|
||||||
>
|
>
|
||||||
<XMarkIcon className="w-6 h-6" />
|
<XMarkIcon className="w-6 h-6" />
|
||||||
|
|
@ -171,7 +171,7 @@ function PanelCloseButton() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function HorizontalPanel({ context }) {
|
export function BottomPanel({ context }) {
|
||||||
const { isPanelOpen, activeFooter: tab } = useSettings();
|
const { isPanelOpen, activeFooter: tab } = useSettings();
|
||||||
return (
|
return (
|
||||||
<PanelNav
|
<PanelNav
|
||||||
|
|
@ -182,7 +182,7 @@ export function HorizontalPanel({ context }) {
|
||||||
>
|
>
|
||||||
<div className="flex justify-between min-h-10 max-h-10 grid-cols-2 items-center border-t border-muted">
|
<div className="flex justify-between min-h-10 max-h-10 grid-cols-2 items-center border-t border-muted">
|
||||||
<PanelCloseButton />
|
<PanelCloseButton />
|
||||||
<Tabs setTab={setTab} tab={tab} />
|
<Tabs setTab={setTab} tab={tab} className={cx(isPanelOpen && 'border-l border-muted')} />
|
||||||
</div>
|
</div>
|
||||||
{isPanelOpen && (
|
{isPanelOpen && (
|
||||||
<div className="w-full h-full overflow-auto border-t border-muted">
|
<div className="w-full h-full overflow-auto border-t border-muted">
|
||||||
|
|
@ -193,7 +193,7 @@ export function HorizontalPanel({ context }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function VerticalPanel({ context }) {
|
export function RightPanel({ context }) {
|
||||||
const settings = useSettings();
|
const settings = useSettings();
|
||||||
const { activeFooter: tab, isPanelOpen } = settings;
|
const { activeFooter: tab, isPanelOpen } = settings;
|
||||||
if (!isPanelOpen) {
|
if (!isPanelOpen) {
|
||||||
|
|
@ -203,8 +203,7 @@ export function VerticalPanel({ context }) {
|
||||||
<PanelNav
|
<PanelNav
|
||||||
settings={settings}
|
settings={settings}
|
||||||
className={cx(
|
className={cx(
|
||||||
//'border-l border-muted shrink-0',
|
'border-l border-muted shrink-0 h-full overflow-hidden',
|
||||||
'border-0 border-muted shrink-0 h-full overflow-hidden',
|
|
||||||
isPanelOpen
|
isPanelOpen
|
||||||
? //? `min-w-full max-w-full lg:min-w-[min(600px,100vw)] lg:max-w-[min(600px,80vw)]`
|
? //? `min-w-full max-w-full lg:min-w-[min(600px,100vw)] lg:max-w-[min(600px,80vw)]`
|
||||||
`min-w-[min(600px,100vw)] max-w-[min(600px,80vw)]`
|
`min-w-[min(600px,100vw)] max-w-[min(600px,80vw)]`
|
||||||
|
|
@ -217,10 +216,10 @@ export function VerticalPanel({ context }) {
|
||||||
<LogoButton context={context} />
|
<LogoButton context={context} />
|
||||||
</div> */}
|
</div> */}
|
||||||
<PanelCloseButton />
|
<PanelCloseButton />
|
||||||
<Tabs setTab={setTab} tab={tab} />
|
<Tabs setTab={setTab} tab={tab} className="border-l border-muted" />
|
||||||
{/* <PanelCloseButton /> */}
|
{/* <PanelCloseButton /> */}
|
||||||
</div>
|
</div>
|
||||||
<div className="overflow-auto h-full border-l border-muted">
|
<div className="overflow-auto h-full">
|
||||||
<PanelContent context={context} tab={tab} />
|
<PanelContent context={context} tab={tab} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -301,7 +300,7 @@ function Tabs({ className }) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cx(
|
className={cx(
|
||||||
'px-2 border-l border-muted w-full flex select-none max-w-full h-10 max-h-10 min-h-10 overflow-auto items-center',
|
'px-2 w-full flex select-none max-w-full h-10 max-h-10 min-h-10 overflow-auto items-center',
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue