From 7e4a9b94d548e13393ce2288988fb34721b4ceea Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Mon, 30 Mar 2026 11:01:03 +0200 Subject: [PATCH] app: Move docs button component. Everything is visually unchanged. This just moves the button logic to the app, since it doesn't conceptually belong to the editor component. It controls things such as docs which has nothing to do with the editor. This way we don't have to pass states as props around when we add more buttons later. --- src/app/App.tsx | 18 ++++++++++++++++-- src/app/app.scss | 8 ++++++++ src/app/translations/en.json | 4 ++++ src/editor/Editor.tsx | 25 +------------------------ src/editor/editor.scss | 7 ------- src/editor/translations/en.json | 7 +------ 6 files changed, 30 insertions(+), 39 deletions(-) diff --git a/src/app/App.tsx b/src/app/App.tsx index c1bc7fe9..55fa3753 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -3,7 +3,8 @@ import 'react-splitter-layout/lib/index.css'; import './app.scss'; -import { Classes, Spinner } from '@blueprintjs/core'; +import { Button, Classes, Spinner } from '@blueprintjs/core'; +import { Manual } from '@blueprintjs/icons'; import React, { useEffect, useState } from 'react'; import SplitterLayout from 'react-splitter-layout'; import { useLocalStorage, useTernaryDarkMode } from 'usehooks-ts'; @@ -71,7 +72,8 @@ const Docs: React.FunctionComponent = () => { const App: React.FunctionComponent = () => { const i18n = useI18n(); const { isDarkMode } = useTernaryDarkMode(); - const { isSettingShowDocsEnabled } = useSettingIsShowDocsEnabled(); + const { isSettingShowDocsEnabled, toggleIsSettingShowDocsEnabled } = + useSettingIsShowDocsEnabled(); const [isDragging, setIsDragging] = useState(false); const [docsSplit, setDocsSplit] = useLocalStorage('app-docs-split', 30); @@ -140,6 +142,18 @@ const App: React.FunctionComponent = () => { > +