diff --git a/src/OnboardingSPA/components/Animate/index.js b/src/OnboardingSPA/components/Animate/index.js new file mode 100644 index 000000000..fb9b58d18 --- /dev/null +++ b/src/OnboardingSPA/components/Animate/index.js @@ -0,0 +1,37 @@ +/** + * A Animator to show animation + * + * @param {string} type The name of Animation to be shown. + * @param { object | boolean } after The variable to look after for before showing the animation, by default true to show the children right away. + * + */ +const Animate = ( { type, after = true, children } ) => { + const prefix = 'animate'; + + /** + * Returns the appropriate className + * + * @return {string | void} ClassName that applies the animations + */ + function getAnimateClassName() { + if ( type ) { + let classname = ''; + + switch ( type ) { + // Add animation types and appropriate CSS + case 'fade-in': + classname = prefix.concat( '__fade-in' ); + break; + } + return classname; + } + } + + return ! after ? ( +
{ children }
+ ) : ( +
{ children }
+ ); +}; + +export default Animate; diff --git a/src/OnboardingSPA/components/Animate/stylesheet.scss b/src/OnboardingSPA/components/Animate/stylesheet.scss new file mode 100644 index 000000000..04c4e89ba --- /dev/null +++ b/src/OnboardingSPA/components/Animate/stylesheet.scss @@ -0,0 +1,11 @@ +.animate { + + &__blank { + opacity: 0; + pointer-events: none; + } + + &__fade-in { + animation: fadeInWithDisabledClicks 500ms ease-in; + } +} diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js index 3c376b28b..deb7bebc5 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js @@ -13,6 +13,7 @@ import content from '../content.json'; import countries from '../countries.json'; import currencies from '../currencies.json'; import { useWPSettings } from '../useWPSettings'; +import Animate from '../../../../components/Animate'; import { EcommerceStateHandler } from '../../../../components/StateHandlers'; const StepAddress = () => { @@ -148,131 +149,132 @@ const StepAddress = () => { 'wp-module-onboarding' )} /> - {settings === null &&

Loading your details...

} -
-
- - {settings === null ? ( - - ) : ( - - )} -
-
- - -
-
-
+ +
+
+ {settings === null ? ( + + ) : ( + + )} +
+
+
- {states.length === 0 || settings === null ? null : ( -
+
+
- + />
- )} -
+ {states.length === 0 || settings === null ? null : ( +
+ + +
+ )} +
+ + +
+
+
+
+ + +
+ * required
-
- - -
-
- - -
- * required -
+