add the sign in handler

This commit is contained in:
Pablo Velez Vidal 2022-10-27 13:22:55 +02:00
parent 519fcd2181
commit 92087b8c3f
2 changed files with 24 additions and 2 deletions

View file

@ -40,6 +40,9 @@ const Onboarding = ({
console.log('*** end of slide');
}
};
const signInHandler = () => {
console.log('sign in handler');
};
const transform = useAnimatedStyle(() => {
const duration = Platform.OS === 'android' ? 250 : 350;
@ -81,7 +84,7 @@ const Onboarding = ({
renderItem={renderSlide}
listKey={generateId()}
horizontal={true}
showsHorizontalScrollIndicator={true}
showsHorizontalScrollIndicator={false}
pagingEnabled={true}
bounces={false}
onScroll={Animated.event([{nativeEvent: {contentOffset: {x: scrollX}}}], {
@ -98,6 +101,7 @@ const Onboarding = ({
theme={theme}
scrollX={scrollX}
nextSlideHandler={nextSlide}
signInHandler={signInHandler}
/>
</View>
);

View file

@ -15,6 +15,7 @@ type Props = {
theme: Theme;
scrollX: any;
nextSlideHandler: any;
signInHandler: any;
};
const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => ({
@ -42,7 +43,13 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => ({
},
}));
const Paginator = ({theme, data, scrollX, nextSlideHandler}: Props) => {
const Paginator = ({
theme,
data,
scrollX,
nextSlideHandler,
signInHandler,
}: Props) => {
const styles = getStyleSheet(theme);
const {width} = useWindowDimensions();
@ -89,6 +96,17 @@ const Paginator = ({theme, data, scrollX, nextSlideHandler}: Props) => {
style={styles.rowIcon}
/>
</Button>
<Button
testID='mobile.onboaring.sign_in'
onPress={() => signInHandler()}
containerStyle={[styles.button, buttonBackgroundStyle(theme, 'lg', 'link', 'default')]}
>
<FormattedText
id='mobile.onboarding.sign_in'
defaultMessage='Sign in'
style={buttonTextStyle(theme, 'm', 'primary', 'inverted')}
/>
</Button>
</View>
</View>
);