From 533fa84b774f3bf3811c5187c3c3d77b7b8d2fd8 Mon Sep 17 00:00:00 2001 From: Justin Wyne <1986068+wyne@users.noreply.github.com> Date: Fri, 19 Apr 2024 19:42:05 -0700 Subject: [PATCH] Fix onboarding screen UI and performance --- src/Navigation.tsx | 2 +- src/components/AppInfo/RotatingIcon.tsx | 2 +- src/components/Onboarding/OnboardingPage.tsx | 144 ++++++++++++++++++ src/screens/OnboardingScreen.tsx | 146 +++---------------- 4 files changed, 166 insertions(+), 128 deletions(-) create mode 100644 src/components/Onboarding/OnboardingPage.tsx diff --git a/src/Navigation.tsx b/src/Navigation.tsx index 0a77ae58..10b40da9 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -103,7 +103,7 @@ export const Navigation = () => { /> { await analytics().logEvent('app_icon'); }}> - + void; + index: number; + isLast: boolean; + item: OnboardingScreenItem; + width: number; +} + +const OnboardingPage: React.FC = React.memo(({ + active = false, + closeOnboarding, + isLast, + item, + width, +}) => { + let media; + switch (item.media.type) { + case 'image': + media = ( + + ); + break; + case 'video': + media = ( + + + ); + break; + } + + return ( + + + {item.title} + + + + {media} + + + + + {item.description} + + + {isLast && +