mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-14 10:35:11 +00:00
drop settingsToggleShowDocs
We can change the event handler in App.tsx do we no longer need the settingsToggleShowDocs action or related sagas.
This commit is contained in:
+4
-6
@@ -8,7 +8,6 @@ import SplitterLayout from 'react-splitter-layout';
|
||||
import { useLocalStorage, useTernaryDarkMode } from 'usehooks-ts';
|
||||
import Editor, { EditorType } from '../editor/Editor';
|
||||
import Explorer from '../explorer/Explorer';
|
||||
import { settingsToggleShowDocs } from '../settings/actions';
|
||||
import { useSettingIsShowDocsEnabled } from '../settings/hooks';
|
||||
import StatusBar from '../status-bar/StatusBar';
|
||||
import Terminal from '../terminal/Terminal';
|
||||
@@ -19,7 +18,7 @@ import 'react-splitter-layout/lib/index.css';
|
||||
import './app.scss';
|
||||
|
||||
const Docs: React.VFC = () => {
|
||||
const dispatch = useDispatch();
|
||||
const { setIsSettingShowDocsEnabled } = useSettingIsShowDocsEnabled();
|
||||
|
||||
return (
|
||||
<iframe
|
||||
@@ -104,10 +103,9 @@ const Docs: React.VFC = () => {
|
||||
e.key == 'd'
|
||||
) {
|
||||
e.preventDefault();
|
||||
// we have to use dispatch here instead of
|
||||
// toggleIsSettingShowDocsEnabled since this
|
||||
// isn't updated on state changes
|
||||
dispatch(settingsToggleShowDocs());
|
||||
// since the iframe is only visible when docs are shown
|
||||
// the only action is to hide the docs
|
||||
setIsSettingShowDocsEnabled(false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user