diff options
author | Hailey <me@haileyok.com> | 2024-12-02 16:16:39 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-02 16:16:39 -0800 |
commit | 2f10be2cfe0567516e6df06b0ca6429726a3e858 (patch) | |
tree | 66a43d793c1220677dd620a1abdec7ec375155b3 | |
parent | 770eeb59ca583c9bbc121790e0393195eda6b796 (diff) | |
download | voidsky-2f10be2cfe0567516e6df06b0ca6429726a3e858.tar.zst |
remove masked view dependency (#6886)
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | src/Splash.tsx | 85 | ||||
-rw-r--r-- | yarn.lock | 5 |
3 files changed, 22 insertions, 69 deletions
diff --git a/package.json b/package.json index ddb90c4f6..b7f3e4d49 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,6 @@ "@radix-ui/react-focus-guards": "^1.1.1", "@radix-ui/react-focus-scope": "^1.1.0", "@react-native-async-storage/async-storage": "1.23.1", - "@react-native-masked-view/masked-view": "0.3.0", "@react-native-menu/menu": "^1.1.0", "@react-native-picker/picker": "2.6.1", "@react-navigation/bottom-tabs": "^6.5.20", diff --git a/src/Splash.tsx b/src/Splash.tsx index a52b8837d..c31723aaa 100644 --- a/src/Splash.tsx +++ b/src/Splash.tsx @@ -18,9 +18,7 @@ import {useSafeAreaInsets} from 'react-native-safe-area-context' import Svg, {Path, SvgProps} from 'react-native-svg' import {Image} from 'expo-image' import * as SplashScreen from 'expo-splash-screen' -import MaskedView from '@react-native-masked-view/masked-view' -import {isAndroid} from '#/platform/detection' import {Logotype} from '#/view/icons/Logotype' // @ts-ignore import splashImagePointer from '../assets/splash.png' @@ -53,8 +51,6 @@ type Props = { isReady: boolean } -const AnimatedLogo = Animated.createAnimatedComponent(Logo) - export function Splash(props: React.PropsWithChildren<Props>) { 'use no memo' const insets = useSafeAreaInsets() @@ -152,8 +148,6 @@ export function Splash(props: React.PropsWithChildren<Props>) { {duration: 400, easing: Easing.out(Easing.cubic)}, async () => { // set these values to check animation at specific point - // outroLogo.set(0.1) - // outroApp.set(0.1) outroLogo.set(() => withTiming( 1, @@ -221,66 +215,31 @@ export function Splash(props: React.PropsWithChildren<Props>) { </View> )} - {isReady && - (isAndroid || reduceMotion === true ? ( - // Use a simple fade on older versions of android (work around a bug) - <> - <Animated.View style={[{flex: 1}, appAnimation]}> - {props.children} - </Animated.View> + {isReady && ( + <> + <Animated.View style={[{flex: 1}, appAnimation]}> + {props.children} + </Animated.View> - {!isAnimationComplete && ( - <Animated.View - style={[ - StyleSheet.absoluteFillObject, - logoWrapperAnimation, - { - flex: 1, - justifyContent: 'center', - alignItems: 'center', - transform: [{translateY: -(insets.top / 2)}, {scale: 0.1}], // scale from 1000px to 100px - }, - ]}> - <AnimatedLogo - fill={logoBg} - style={[{opacity: 0}, logoAnimations]} - /> + {!isAnimationComplete && ( + <Animated.View + style={[ + StyleSheet.absoluteFillObject, + logoWrapperAnimation, + { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + transform: [{translateY: -(insets.top / 2)}, {scale: 0.1}], // scale from 1000px to 100px + }, + ]}> + <Animated.View style={[logoAnimations]}> + <Logo fill={logoBg} /> </Animated.View> - )} - </> - ) : ( - <MaskedView - style={[StyleSheet.absoluteFillObject]} - maskElement={ - <Animated.View - style={[ - { - // Transparent background because mask is based off alpha channel. - backgroundColor: 'transparent', - flex: 1, - justifyContent: 'center', - alignItems: 'center', - transform: [{translateY: -(insets.top / 2)}, {scale: 0.1}], // scale from 1000px to 100px - }, - ]}> - <AnimatedLogo fill={logoBg} style={[logoAnimations]} /> - </Animated.View> - }> - {!isAnimationComplete && ( - <View - style={[ - StyleSheet.absoluteFillObject, - { - backgroundColor: logoBg, - }, - ]} - /> - )} - <Animated.View style={[{flex: 1}, appAnimation]}> - {props.children} </Animated.View> - </MaskedView> - ))} + )} + </> + )} </View> ) } diff --git a/yarn.lock b/yarn.lock index f70489e17..54e0ddd33 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5655,11 +5655,6 @@ prompts "^2.4.2" semver "^7.5.2" -"@react-native-masked-view/masked-view@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@react-native-masked-view/masked-view/-/masked-view-0.3.0.tgz#bd29fae18d148a685331910a3c7b766ce87eafcc" - integrity sha512-qLyoObcjzrkpNcoJjXquUePXfL1dXjHtuv+yX0zZ0Q4kG5yvVqd620+tSh7WbRoHkjpXhFBfLwvGhcWB2I0Lpw== - "@react-native-menu/menu@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@react-native-menu/menu/-/menu-1.1.0.tgz#e89c0850f7e5aa4c671c44a9c10edafadb23c35a" |