diff options
Diffstat (limited to 'src/components/ui')
-rw-r--r-- | src/components/ui/Loader.tsx | 2 | ||||
-rw-r--r-- | src/components/ui/Slider.tsx | 2 | ||||
-rw-r--r-- | src/components/ui/button/index.tsx | 32 | ||||
-rw-r--r-- | src/components/ui/imageUpload/index.tsx | 2 | ||||
-rw-r--r-- | src/components/ui/select/index.tsx | 16 |
5 files changed, 28 insertions, 26 deletions
diff --git a/src/components/ui/Loader.tsx b/src/components/ui/Loader.tsx index ebb437d9d..17cb35f41 100644 --- a/src/components/ui/Loader.tsx +++ b/src/components/ui/Loader.tsx | |||
@@ -25,7 +25,7 @@ class LoaderComponent extends Component<IProps> { | |||
25 | } = this.props; | 25 | } = this.props; |
26 | 26 | ||
27 | const loaderColor = | 27 | const loaderColor = |
28 | color !== 'ACCENT' ? color : this.props.stores!.settings.app.accentColor; | 28 | color === 'ACCENT' ? this.props.stores!.settings.app.accentColor : color; |
29 | 29 | ||
30 | return ( | 30 | return ( |
31 | <Loader | 31 | <Loader |
diff --git a/src/components/ui/Slider.tsx b/src/components/ui/Slider.tsx index ed9fe9073..be0846513 100644 --- a/src/components/ui/Slider.tsx +++ b/src/components/ui/Slider.tsx | |||
@@ -51,7 +51,7 @@ class Slider extends Component<IProps> { | |||
51 | value={field.value} | 51 | value={field.value} |
52 | min="1" | 52 | min="1" |
53 | max="100" | 53 | max="100" |
54 | onChange={e => (!disabled ? this.onChange(e) : null)} | 54 | onChange={e => (disabled ? null : this.onChange(e))} |
55 | /> | 55 | /> |
56 | </div> | 56 | </div> |
57 | 57 | ||
diff --git a/src/components/ui/button/index.tsx b/src/components/ui/button/index.tsx index dc984bf95..9444efde2 100644 --- a/src/components/ui/button/index.tsx +++ b/src/components/ui/button/index.tsx | |||
@@ -117,12 +117,12 @@ const styles = (theme: Theme) => ({ | |||
117 | zIndex: 9999, | 117 | zIndex: 9999, |
118 | }, | 118 | }, |
119 | loaderContainer: { | 119 | loaderContainer: { |
120 | width: (props: IProps): string => (!props.busy ? '0' : '40px'), | 120 | width: (props: IProps): string => (props.busy ? '40px' : '0'), |
121 | height: 20, | 121 | height: 20, |
122 | overflow: 'hidden', | 122 | overflow: 'hidden', |
123 | transition: loaderContainerTransition, | 123 | transition: loaderContainerTransition, |
124 | marginLeft: (props: IProps): number => (!props.busy ? 10 : 20), | 124 | marginLeft: (props: IProps): number => (props.busy ? 20 : 10), |
125 | marginRight: (props: IProps): number => (!props.busy ? -10 : -20), | 125 | marginRight: (props: IProps): number => (props.busy ? -20 : -10), |
126 | position: (): Property.Position => 'inherit', | 126 | position: (): Property.Position => 'inherit', |
127 | }, | 127 | }, |
128 | icon: { | 128 | icon: { |
@@ -217,38 +217,38 @@ class ButtonComponent extends Component<IProps, IState> { | |||
217 | </> | 217 | </> |
218 | ); | 218 | ); |
219 | 219 | ||
220 | const wrapperComponent = !href ? ( | 220 | const wrapperComponent = href ? ( |
221 | <button | 221 | <a |
222 | id={id} | 222 | href={href} |
223 | type={type} | 223 | target={target} |
224 | onClick={onClick} | 224 | onClick={onClick} |
225 | className={classnames({ | 225 | className={classnames({ |
226 | [`${classes.button}`]: true, | 226 | [`${classes.button}`]: true, |
227 | [`${classes[buttonType as ButtonType]}`]: true, | 227 | [`${classes[buttonType as ButtonType]}`]: true, |
228 | [`${classes.disabled}`]: disabled, | ||
229 | [`${className}`]: className, | 228 | [`${className}`]: className, |
230 | })} | 229 | })} |
231 | disabled={disabled} | 230 | rel={target === '_blank' ? 'noopener' : ''} |
232 | data-type="franz-button" | 231 | data-type="franz-button" |
233 | {...(htmlForm && { form: htmlForm })} | ||
234 | > | 232 | > |
235 | {content} | 233 | {content} |
236 | </button> | 234 | </a> |
237 | ) : ( | 235 | ) : ( |
238 | <a | 236 | <button |
239 | href={href} | 237 | id={id} |
240 | target={target} | 238 | type={type} |
241 | onClick={onClick} | 239 | onClick={onClick} |
242 | className={classnames({ | 240 | className={classnames({ |
243 | [`${classes.button}`]: true, | 241 | [`${classes.button}`]: true, |
244 | [`${classes[buttonType as ButtonType]}`]: true, | 242 | [`${classes[buttonType as ButtonType]}`]: true, |
243 | [`${classes.disabled}`]: disabled, | ||
245 | [`${className}`]: className, | 244 | [`${className}`]: className, |
246 | })} | 245 | })} |
247 | rel={target === '_blank' ? 'noopener' : ''} | 246 | disabled={disabled} |
248 | data-type="franz-button" | 247 | data-type="franz-button" |
248 | {...(htmlForm && { form: htmlForm })} | ||
249 | > | 249 | > |
250 | {content} | 250 | {content} |
251 | </a> | 251 | </button> |
252 | ); | 252 | ); |
253 | 253 | ||
254 | return wrapperComponent; | 254 | return wrapperComponent; |
diff --git a/src/components/ui/imageUpload/index.tsx b/src/components/ui/imageUpload/index.tsx index 89e2c65a2..3b164ed41 100644 --- a/src/components/ui/imageUpload/index.tsx +++ b/src/components/ui/imageUpload/index.tsx | |||
@@ -46,7 +46,7 @@ class ImageUpload extends Component<IProps, IState> { | |||
46 | this.setState({ errorState: false }); | 46 | this.setState({ errorState: false }); |
47 | 47 | ||
48 | for (const file of acceptedFiles) { | 48 | for (const file of acceptedFiles) { |
49 | const imgPath = isWindows ? file.path.replace(/\\/g, '/') : file.path; | 49 | const imgPath = isWindows ? file.path.replaceAll('\\', '/') : file.path; |
50 | this.setState({ | 50 | this.setState({ |
51 | path: imgPath, | 51 | path: imgPath, |
52 | }); | 52 | }); |
diff --git a/src/components/ui/select/index.tsx b/src/components/ui/select/index.tsx index 31aa8a15f..695e70e28 100644 --- a/src/components/ui/select/index.tsx +++ b/src/components/ui/select/index.tsx | |||
@@ -321,10 +321,12 @@ class SelectComponent extends Component<IProps, IState> { | |||
321 | case 39: | 321 | case 39: |
322 | case 38: | 322 | case 38: |
323 | case 40: // Arrow keys | 323 | case 40: // Arrow keys |
324 | case 32: | 324 | case 32: { |
325 | break; // Space | 325 | break; |
326 | default: | 326 | } // Space |
327 | break; // do not block other keys | 327 | default: { |
328 | break; | ||
329 | } // do not block other keys | ||
328 | } | 330 | } |
329 | } | 331 | } |
330 | 332 | ||
@@ -381,12 +383,12 @@ class SelectComponent extends Component<IProps, IState> { | |||
381 | [`${classes.hasError}`]: error, | 383 | [`${classes.hasError}`]: error, |
382 | })} | 384 | })} |
383 | onClick={ | 385 | onClick={ |
384 | !disabled | 386 | disabled |
385 | ? () => | 387 | ? noop |
388 | : () => | ||
386 | this.setState((state: IState) => ({ | 389 | this.setState((state: IState) => ({ |
387 | open: !state.open, | 390 | open: !state.open, |
388 | })) | 391 | })) |
389 | : noop | ||
390 | } | 392 | } |
391 | > | 393 | > |
392 | {selection} | 394 | {selection} |