aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-11 18:50:42 +0530
committerLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-08-11 13:38:04 +0000
commit11c2b649388687570851fcb58ab59f5daaa3f194 (patch)
tree257acfbcc42e542978b67a1e4edccc87ca0be4a6 /packages
parent5.6.1-nightly.22 [skip ci] (diff)
downloadferdium-app-11c2b649388687570851fcb58ab59f5daaa3f194.tar.gz
ferdium-app-11c2b649388687570851fcb58ab59f5daaa3f194.tar.zst
ferdium-app-11c2b649388687570851fcb58ab59f5daaa3f194.zip
revert: fixing #1757 by commenting out partial fix
- Fixes issue with ferdi not starting up. - Also adds some defensive checks for the same code in other repeated locations.
Diffstat (limited to 'packages')
-rw-r--r--packages/forms/src/button/index.tsx2
-rw-r--r--packages/forms/src/select/index.tsx2
-rw-r--r--packages/forms/src/toggle/index.tsx2
-rw-r--r--packages/ui/src/infobox/index.tsx15
4 files changed, 11 insertions, 10 deletions
diff --git a/packages/forms/src/button/index.tsx b/packages/forms/src/button/index.tsx
index 0aef04a6c..48fb61635 100644
--- a/packages/forms/src/button/index.tsx
+++ b/packages/forms/src/button/index.tsx
@@ -38,7 +38,7 @@ interface IProps extends IFormField, IWithStyle {
38let buttonTransition: string = 'none'; 38let buttonTransition: string = 'none';
39let loaderContainerTransition: string = 'none'; 39let loaderContainerTransition: string = 'none';
40 40
41if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { 41if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) {
42 buttonTransition = 'background .5s, opacity 0.3s'; 42 buttonTransition = 'background .5s, opacity 0.3s';
43 loaderContainerTransition = 'all 0.3s'; 43 loaderContainerTransition = 'all 0.3s';
44} 44}
diff --git a/packages/forms/src/select/index.tsx b/packages/forms/src/select/index.tsx
index ef3e70ddb..d7479f63e 100644
--- a/packages/forms/src/select/index.tsx
+++ b/packages/forms/src/select/index.tsx
@@ -49,7 +49,7 @@ interface IState {
49let popupTransition: string = 'none'; 49let popupTransition: string = 'none';
50let toggleTransition: string = 'none'; 50let toggleTransition: string = 'none';
51 51
52if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { 52if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) {
53 popupTransition = 'all 0.3s'; 53 popupTransition = 'all 0.3s';
54 toggleTransition = 'transform 0.3s'; 54 toggleTransition = 'transform 0.3s';
55} 55}
diff --git a/packages/forms/src/toggle/index.tsx b/packages/forms/src/toggle/index.tsx
index e525d2906..bdf1d22cf 100644
--- a/packages/forms/src/toggle/index.tsx
+++ b/packages/forms/src/toggle/index.tsx
@@ -19,7 +19,7 @@ interface IProps
19 19
20let buttonTransition: string = 'none'; 20let buttonTransition: string = 'none';
21 21
22if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { 22if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) {
23 buttonTransition = 'all .5s'; 23 buttonTransition = 'all .5s';
24} 24}
25 25
diff --git a/packages/ui/src/infobox/index.tsx b/packages/ui/src/infobox/index.tsx
index a6e4b3240..88cfdb620 100644
--- a/packages/ui/src/infobox/index.tsx
+++ b/packages/ui/src/infobox/index.tsx
@@ -44,13 +44,14 @@ const buttonStyles = (theme: Theme) => {
44 return styles; 44 return styles;
45}; 45};
46 46
47let infoBoxTransition: string = 'none'; 47const infoBoxTransition: string = 'none';
48let ctaTransition: string = 'none'; 48const ctaTransition: string = 'none';
49 49
50if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { 50// TODO: Not sure why, but this location alone, the `dinwo` is not defined - and it throws an error thus aborting the startup sequence of ferdi
51 infoBoxTransition = 'all 0.5s'; 51// if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) {
52 ctaTransition = 'opacity 0.3s'; 52// infoBoxTransition = 'all 0.5s';
53} 53// ctaTransition = 'opacity 0.3s';
54// }
54 55
55const styles = (theme: Theme) => ({ 56const styles = (theme: Theme) => ({
56 wrapper: { 57 wrapper: {