diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-08-16 21:14:50 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-08-16 21:14:50 +0200 |
commit | 19cd11118cde7160cd447c81bc965007c0437479 (patch) | |
tree | 5fea613e7a46d69380995368a68cc72f186078a4 /subprojects/frontend/src/editor/EditorButtons.tsx | |
parent | chore(deps): bump frontend dependencies (diff) | |
download | refinery-19cd11118cde7160cd447c81bc965007c0437479.tar.gz refinery-19cd11118cde7160cd447c81bc965007c0437479.tar.zst refinery-19cd11118cde7160cd447c81bc965007c0437479.zip |
refactor(frondend): improve editor store and theme
Also bumps frontend dependencies.
Diffstat (limited to 'subprojects/frontend/src/editor/EditorButtons.tsx')
-rw-r--r-- | subprojects/frontend/src/editor/EditorButtons.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/subprojects/frontend/src/editor/EditorButtons.tsx b/subprojects/frontend/src/editor/EditorButtons.tsx index 1412a314..34b64751 100644 --- a/subprojects/frontend/src/editor/EditorButtons.tsx +++ b/subprojects/frontend/src/editor/EditorButtons.tsx | |||
@@ -19,7 +19,7 @@ import { useRootStore } from '../RootStore'; | |||
19 | 19 | ||
20 | // Exhastive switch as proven by TypeScript. | 20 | // Exhastive switch as proven by TypeScript. |
21 | // eslint-disable-next-line consistent-return | 21 | // eslint-disable-next-line consistent-return |
22 | function getLintIcon(severity: Diagnostic['severity'] | null) { | 22 | function getLintIcon(severity: Diagnostic['severity'] | undefined) { |
23 | switch (severity) { | 23 | switch (severity) { |
24 | case 'error': | 24 | case 'error': |
25 | return <ErrorIcon fontSize="small" />; | 25 | return <ErrorIcon fontSize="small" />; |
@@ -61,16 +61,16 @@ function EditorButtons(): JSX.Element { | |||
61 | <FormatListNumberedIcon fontSize="small" /> | 61 | <FormatListNumberedIcon fontSize="small" /> |
62 | </ToggleButton> | 62 | </ToggleButton> |
63 | <ToggleButton | 63 | <ToggleButton |
64 | selected={editorStore.showSearchPanel} | 64 | selected={editorStore.searchPanel.state} |
65 | onClick={() => editorStore.toggleSearchPanel()} | 65 | onClick={() => editorStore.searchPanel.toggle()} |
66 | aria-label="Show find/replace" | 66 | aria-label="Show find/replace" |
67 | value="show-search-panel" | 67 | value="show-search-panel" |
68 | > | 68 | > |
69 | <SearchIcon fontSize="small" /> | 69 | <SearchIcon fontSize="small" /> |
70 | </ToggleButton> | 70 | </ToggleButton> |
71 | <ToggleButton | 71 | <ToggleButton |
72 | selected={editorStore.showLintPanel} | 72 | selected={editorStore.lintPanel.state} |
73 | onClick={() => editorStore.toggleLintPanel()} | 73 | onClick={() => editorStore.lintPanel.toggle()} |
74 | aria-label="Show diagnostics panel" | 74 | aria-label="Show diagnostics panel" |
75 | value="show-lint-panel" | 75 | value="show-lint-panel" |
76 | > | 76 | > |