Skip to content

Commit

Permalink
Remove ios options from EdgeAnim
Browse files Browse the repository at this point in the history
Just use the disableType instead
  • Loading branch information
paullinator committed Jan 24, 2024
1 parent 9d32b46 commit fe7ad31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 3 additions & 5 deletions src/components/common/EdgeAnim.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { Platform, ViewProps } from 'react-native'
import { ViewProps } from 'react-native'
import Animated, {
AnimateProps,
ComplexAnimationBuilder,
Expand Down Expand Up @@ -47,8 +47,6 @@ interface Props extends AnimateProps<ViewProps> {
enter?: Anim
exit?: Anim

/** only animate on ios */
ios?: boolean
visible?: boolean
}

Expand Down Expand Up @@ -93,12 +91,12 @@ const getAnimBuilder = (anim?: Anim) => {
return builder
}

export const EdgeAnim = ({ children, disableType, enter, exit, ios = false, visible = true, ...rest }: Props): JSX.Element | null => {
export const EdgeAnim = ({ children, disableType, enter, exit, visible = true, ...rest }: Props): JSX.Element | null => {
if (!visible) return null
const entering = getAnimBuilder(enter)
const exiting = getAnimBuilder(exit)

if (disableType === 'anim' || (ios && Platform.OS !== 'ios')) {
if (disableType === 'anim') {
return <Animated.View {...rest}>{children}</Animated.View>
}

Expand Down
10 changes: 6 additions & 4 deletions src/components/scenes/GettingStartedScene.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CreateAccountType, InitialRouteName } from 'edge-login-ui-rn'
import * as React from 'react'
import { useEffect } from 'react'
import { Image, Pressable, Text, View } from 'react-native'
import { Image, Platform, Pressable, Text, View } from 'react-native'
import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler'
import Animated, {
Extrapolation,
Expand Down Expand Up @@ -171,6 +171,8 @@ export const GettingStartedScene = (props: Props) => {
}
}, [isLoggedIn, localUsers, navigation])

const disableType = Platform.OS === 'android' ? 'view' : undefined

return (
<SceneWrapper hasHeader={false}>
<SkipButton swipeOffset={swipeOffset}>
Expand Down Expand Up @@ -211,7 +213,7 @@ export const GettingStartedScene = (props: Props) => {
)
})}
</HeroContainer>
<EdgeAnim ios enter={{ type: 'fadeInDown', duration: ANIM_DURATION, distance: 20 }}>
<EdgeAnim disableType={disableType} enter={{ type: 'fadeInDown', duration: ANIM_DURATION, distance: 20 }}>
<Pagination>
{Array.from({ length: paginationCount + (isFinalSwipeEnabled ? 0 : 1) }).map((_, index) => (
<Pressable key={index} onPress={() => handlePressIndicator(index)}>
Expand All @@ -235,10 +237,10 @@ export const GettingStartedScene = (props: Props) => {
})}
</Sections>
<Space horizontal={2}>
<EdgeAnim ios enter={{ type: 'fadeInDown', duration: ANIM_DURATION, distance: 40 }}>
<EdgeAnim disableType={disableType} enter={{ type: 'fadeInDown', duration: ANIM_DURATION, distance: 40 }}>
<MainButton onPress={handlePressSignUp} label={lstrings.account_get_started} />
</EdgeAnim>
<EdgeAnim ios enter={{ type: 'fadeInDown', duration: ANIM_DURATION, distance: 60 }}>
<EdgeAnim disableType={disableType} enter={{ type: 'fadeInDown', duration: ANIM_DURATION, distance: 60 }}>
<MainButton type="escape" onPress={handlePressSignIn} label={lstrings.getting_started_button_sign_in} />
</EdgeAnim>
</Space>
Expand Down

0 comments on commit fe7ad31

Please sign in to comment.