diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-09-06 00:20:27 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-09-06 01:05:24 +0200 |
commit | 13ef6251c688e3139a4f8a7c94ff5dab90719420 (patch) | |
tree | 693e5393c3c792641bda77222818aa3285e8482e /subprojects/frontend/src/editor/GenerateButton.tsx | |
parent | fix(frontend): Lezer bracket matching (diff) | |
download | refinery-13ef6251c688e3139a4f8a7c94ff5dab90719420.tar.gz refinery-13ef6251c688e3139a4f8a7c94ff5dab90719420.tar.zst refinery-13ef6251c688e3139a4f8a7c94ff5dab90719420.zip |
refactor(frontend): toolbar sm breakpoint
Improve toolbar appearance on small screens
Diffstat (limited to 'subprojects/frontend/src/editor/GenerateButton.tsx')
-rw-r--r-- | subprojects/frontend/src/editor/GenerateButton.tsx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/subprojects/frontend/src/editor/GenerateButton.tsx b/subprojects/frontend/src/editor/GenerateButton.tsx index 2ffb1a94..485989b5 100644 --- a/subprojects/frontend/src/editor/GenerateButton.tsx +++ b/subprojects/frontend/src/editor/GenerateButton.tsx | |||
@@ -7,10 +7,12 @@ import type EditorStore from './EditorStore'; | |||
7 | 7 | ||
8 | const GENERATE_LABEL = 'Generate'; | 8 | const GENERATE_LABEL = 'Generate'; |
9 | 9 | ||
10 | export default observer(function GenerateButton({ | 10 | const GenerateButton = observer(function GenerateButton({ |
11 | editorStore, | 11 | editorStore, |
12 | hideWarnings, | ||
12 | }: { | 13 | }: { |
13 | editorStore: EditorStore | undefined; | 14 | editorStore: EditorStore | undefined; |
15 | hideWarnings?: boolean | undefined; | ||
14 | }): JSX.Element { | 16 | }): JSX.Element { |
15 | if (editorStore === undefined) { | 17 | if (editorStore === undefined) { |
16 | return ( | 18 | return ( |
@@ -26,7 +28,7 @@ export default observer(function GenerateButton({ | |||
26 | if (errorCount > 0) { | 28 | if (errorCount > 0) { |
27 | diagnostics.push(`${errorCount} error${errorCount === 1 ? '' : 's'}`); | 29 | diagnostics.push(`${errorCount} error${errorCount === 1 ? '' : 's'}`); |
28 | } | 30 | } |
29 | if (warningCount > 0) { | 31 | if (!(hideWarnings ?? false) && warningCount > 0) { |
30 | diagnostics.push(`${warningCount} warning${warningCount === 1 ? '' : 's'}`); | 32 | diagnostics.push(`${warningCount} warning${warningCount === 1 ? '' : 's'}`); |
31 | } | 33 | } |
32 | const summary = diagnostics.join(' and '); | 34 | const summary = diagnostics.join(' and '); |
@@ -55,3 +57,9 @@ export default observer(function GenerateButton({ | |||
55 | </Button> | 57 | </Button> |
56 | ); | 58 | ); |
57 | }); | 59 | }); |
60 | |||
61 | GenerateButton.defaultProps = { | ||
62 | hideWarnings: false, | ||
63 | }; | ||
64 | |||
65 | export default GenerateButton; | ||