From e2393d2abec4dcc57d1bd9e67de29d38bfc055c5 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/Onboarding/OnboardingPage.tsx | 144 +++++++++++++++++ .../Onboarding/OnboardingSwiper.tsx | 0 src/screens/OnboardingScreen.tsx | 146 +++--------------- 4 files changed, 165 insertions(+), 127 deletions(-) create mode 100644 src/components/Onboarding/OnboardingPage.tsx create mode 100644 src/components/Onboarding/OnboardingSwiper.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 = () => { /> 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 && +