Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animate sign-in pages #40337

Merged
merged 5 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/animations/Abracadabra.lottie
Binary file not shown.
Binary file added assets/animations/MagicCode.lottie
Binary file not shown.
10 changes: 10 additions & 0 deletions src/components/LottieAnimations/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import variables from '@styles/variables';
import type DotLottieAnimation from './types';

const DotLottieAnimations = {
Abracadabra: {
file: require('@assets/animations/Abracadabra.lottie'),
w: 375,
h: 400,
},
FastMoney: {
file: require('@assets/animations/FastMoney.lottie'),
w: 375,
Expand Down Expand Up @@ -46,6 +51,11 @@ const DotLottieAnimations = {
h: 400,
backgroundColor: colors.ice500,
},
MagicCode: {
file: require('@assets/animations/MagicCode.lottie'),
w: 200,
h: 164,
},
Magician: {
file: require('@assets/animations/Magician.lottie'),
w: 853,
Expand Down
13 changes: 8 additions & 5 deletions src/components/ValidateCode/JustSignedInModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React from 'react';
import {View} from 'react-native';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
import * as Illustrations from '@components/Icon/Illustrations';
import Lottie from '@components/Lottie';
import LottieAnimations from '@components/LottieAnimations';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useTheme from '@hooks/useTheme';
Expand All @@ -22,10 +23,12 @@ function JustSignedInModal({is2FARequired}: JustSignedInModalProps) {
<View style={styles.deeplinkWrapperContainer}>
<View style={styles.deeplinkWrapperMessage}>
<View style={styles.mb2}>
<Icon
width={variables.modalTopIconWidth}
height={is2FARequired ? variables.modalTopIconHeight : variables.modalTopBigIconHeight}
src={is2FARequired ? Illustrations.SafeBlue : Illustrations.Abracadabra}
<Lottie
source={is2FARequired ? LottieAnimations.Safe : LottieAnimations.Abracadabra}
style={styles.justSignedInModalAnimation(is2FARequired)}
webStyle={styles.justSignedInModalAnimation(is2FARequired)}
autoPlay
loop
/>
</View>
<Text style={[styles.textHeadline, styles.textXXLarge, styles.textAlignCenter]}>
Expand Down
13 changes: 8 additions & 5 deletions src/components/ValidateCode/ValidateCodeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import type {OnyxEntry} from 'react-native-onyx';
import {withOnyx} from 'react-native-onyx';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
import * as Illustrations from '@components/Icon/Illustrations';
import Lottie from '@components/Lottie';
import LottieAnimations from '@components/LottieAnimations';
import Text from '@components/Text';
import TextLink from '@components/TextLink';
import useLocalize from '@hooks/useLocalize';
Expand Down Expand Up @@ -37,10 +38,12 @@ function ValidateCodeModal({code, accountID, session = {}}: ValidateCodeModalPro
<View style={styles.deeplinkWrapperContainer}>
<View style={styles.deeplinkWrapperMessage}>
<View style={styles.mb2}>
<Icon
width={variables.modalTopIconWidth}
height={variables.modalTopIconHeight}
src={Illustrations.MagicCode}
<Lottie
source={LottieAnimations.MagicCode}
style={styles.magicCodeAnimation}
webStyle={styles.magicCodeAnimation}
autoPlay
loop
/>
</View>
<Text style={[styles.textHeadline, styles.textXXLarge, styles.textAlignCenter]}>{translate('validateCodeModal.title')}</Text>
Expand Down
9 changes: 9 additions & 0 deletions src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4395,6 +4395,15 @@ const styles = (theme: ThemeColors) =>
borderColor: theme.highlightBG,
borderWidth: 2,
},

magicCodeAnimation: {
width: variables.modalTopIconWidth,
},

justSignedInModalAnimation: (is2FARequired: boolean) => ({
height: is2FARequired ? variables.modalTopIconHeight : variables.modalTopBigIconHeight,
}),

moneyRequestViewImage: {
...spacing.mh5,
...spacing.mv3,
Expand Down
Loading