From 41df3ffcde68ba4d9ef569543d14a3602f453c27 Mon Sep 17 00:00:00 2001 From: Armano Date: Thu, 23 Feb 2023 02:34:22 +0100 Subject: [PATCH 1/3] fix(website): correct issues with scrollbars in playground --- .../website/src/components/EditorTabs.tsx | 27 +++++++++---------- .../src/components/ErrorsViewer.module.css | 1 - .../src/components/Playground.module.css | 4 ++- .../website/src/components/Playground.tsx | 9 ++++++- .../src/components/ast/ASTViewer.module.css | 5 ++-- 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/packages/website/src/components/EditorTabs.tsx b/packages/website/src/components/EditorTabs.tsx index 6edbee224220..0d961fb81d8d 100644 --- a/packages/website/src/components/EditorTabs.tsx +++ b/packages/website/src/components/EditorTabs.tsx @@ -2,21 +2,20 @@ import EditIcon from '@site/src/icons/edit.svg'; import React from 'react'; import styles from './Playground.module.css'; -import type { TabType } from './types'; -export interface FileTabsProps { - readonly tabs: TabType[]; - readonly activeTab: TabType; - readonly change: (tab: TabType) => void; - readonly showModal: () => void; +export interface FileTabsProps { + readonly tabs: { value: T; label: string }[]; + readonly activeTab: T; + readonly change: (tab: T) => void; + readonly showModal?: () => void; } -export default function EditorTabs({ +export default function EditorTabs({ tabs, activeTab, change, showModal, -}: FileTabsProps): JSX.Element { +}: FileTabsProps): JSX.Element { return (
@@ -25,17 +24,17 @@ export default function EditorTabs({ ); })}
- {activeTab !== 'code' && ( + {activeTab !== 'code' && showModal && ( ); })}
- {activeTab !== 'code' && showModal && ( + {activeTab !== 'code' && (