Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ’„ support(UI): Onboarding quizz pixel polish LLM #1402

Merged
merged 4 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/real-keys-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": patch
---

Onboarding quizz pixel polish LLM
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ import { Flex, Carousel, Text, Button, Icons } from "@ledgerhq/native-ui";
import { useNavigation, useRoute, RouteProp } from "@react-navigation/native";
import { SafeAreaView } from "react-native-safe-area-context";
import styled from "styled-components/native";
import { space } from "@ledgerhq/native-ui/styles/theme";
import { StyleSheet } from "react-native";
import { ScreenName } from "../../../const";
import Illustration from "../../../images/illustration/Illustration";

import { normalize } from "../../../helpers/normalizeSize";

import { DeviceNames } from "../types";
import InvertTheme from "../../../components/theme/InvertTheme";

const StyledSafeAreaView = styled(SafeAreaView)`
flex: 1;
Expand All @@ -33,7 +36,7 @@ const Card = ({ index /* , deviceModelId */ }: CardType) => {
const { t } = useTranslation();
return (
<Flex flex={1} justifyContent="center" alignItems="center" px={20}>
<Flex>
<Flex mb={`${space[8]}px`}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You just need to do Flex mb=8, it should not be imported like this

<Illustration
size={normalize(240)}
darkSource={images.light[index]}
Expand All @@ -43,7 +46,7 @@ const Card = ({ index /* , deviceModelId */ }: CardType) => {
<Text variant="h2" mb={3} textAlign="center" color="constant.black">
{t(`onboarding.stepNewDevice.${index}.title`)}
</Text>
<Text textAlign="center" variant="body" color="constant.black">
<Text textAlign="center" variant="bodyLineHeight" color="constant.black">
{t(`onboarding.stepNewDevice.${index}.desc`)}
</Text>
</Flex>
Expand Down Expand Up @@ -76,7 +79,7 @@ const Footer = ({ index }: { index: number }) => {

return (
<Animatable.View
style={{ width: "100%" }}
style={styles.animatable}
animation="fadeIn"
useNativeDriver
>
Expand All @@ -95,35 +98,55 @@ function OnboardingStepNewDevice() {
const route = useRoute<CurrentRouteType>();
const navigation = useNavigation();
const { deviceModelId } = route.params;

const { t } = useTranslation();
const handleBack = useCallback(() => navigation.goBack(), [navigation]);

return (
<StyledSafeAreaView>
<Flex
flexDirection="row"
justifyContent="space-between"
justifyContent="center"
alignItems="center"
width="100%"
height={48}
>
<Button Icon={Icons.ArrowLeftMedium} onPress={handleBack} />
</Flex>
<Carousel onChange={setCurrentIndex}>
{new Array(5).fill(null).map((_, index) => (
<Card index={index} key={index} deviceModelId={deviceModelId} />
))}
</Carousel>
<Flex
minHeight="60px"
width="100%"
justifyContent="center"
alignItems="center"
>
<Footer index={currentIndex} />
<Button
Icon={() => <Icons.ArrowLeftMedium color="neutral.c00" size={24} />}
onPress={handleBack}
style={styles.backArrow}
/>
<Text variant="h3" mb={3} textAlign="center" color="constant.black">
{t(`onboarding.stepNewDevice.${currentIndex}.label`)}
</Text>
</Flex>
<InvertTheme>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the expected behavior of this, but i think you wanted to use something like this :
<ForceTheme selectedPalette={"dark"}>

<Carousel onChange={setCurrentIndex}>
{new Array(5).fill(null).map((_, index) => (
<Card index={index} key={index} deviceModelId={deviceModelId} />
))}
</Carousel>
<Flex
minHeight="60px"
width="100%"
justifyContent="center"
alignItems="center"
>
<Footer index={currentIndex} />
</Flex>
</InvertTheme>
</StyledSafeAreaView>
);
}

const styles = StyleSheet.create({
animatable: {
width: "100%",
},
backArrow: {
position: "absolute",
Copy link
Contributor

@nparigi-ledger nparigi-ledger Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<Button> component should already accept these position props

top: -5,
left: 0,
},
});

export default OnboardingStepNewDevice;