diff options
Diffstat (limited to 'src/components/ui/button/index.tsx')
-rw-r--r-- | src/components/ui/button/index.tsx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/components/ui/button/index.tsx b/src/components/ui/button/index.tsx index 11369dcbd..822ddf48f 100644 --- a/src/components/ui/button/index.tsx +++ b/src/components/ui/button/index.tsx | |||
@@ -35,7 +35,11 @@ interface IProps extends IFormField, WithStylesProps<typeof styles> { | |||
35 | let buttonTransition: string = 'none'; | 35 | let buttonTransition: string = 'none'; |
36 | let loaderContainerTransition: string = 'none'; | 36 | let loaderContainerTransition: string = 'none'; |
37 | 37 | ||
38 | if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) { | 38 | if ( |
39 | typeof window !== 'undefined' && | ||
40 | window && | ||
41 | window.matchMedia('(prefers-reduced-motion: no-preference)') | ||
42 | ) { | ||
39 | buttonTransition = 'background .5s, opacity 0.3s'; | 43 | buttonTransition = 'background .5s, opacity 0.3s'; |
40 | loaderContainerTransition = 'all 0.3s'; | 44 | loaderContainerTransition = 'all 0.3s'; |
41 | } | 45 | } |
@@ -259,6 +263,6 @@ class ButtonComponent extends Component<IProps> { | |||
259 | } | 263 | } |
260 | } | 264 | } |
261 | 265 | ||
262 | export const Button = injectStyle(styles, { injectTheme: true })( | 266 | const Button = injectStyle(styles, { injectTheme: true })(ButtonComponent); |
263 | ButtonComponent, | 267 | |
264 | ); | 268 | export default Button; |