|
| 1 | +// @mst replace-next-line |
| 2 | +import { observer } from "mobx-react-lite" |
| 3 | +import React from "react" |
| 4 | +import { Image, ImageStyle, TextStyle, View, ViewStyle } from "react-native" |
| 5 | +import { Text } from "src/components" |
| 6 | +import { isRTL } from "../i18n" |
| 7 | +import { colors, spacing } from "../theme" |
| 8 | +import { useSafeAreaInsetsStyle } from "../utils/useSafeAreaInsetsStyle" |
| 9 | + |
| 10 | +const welcomeLogo = require("../../assets/images/logo.png") |
| 11 | +const welcomeFace = require("../../assets/images/welcome-face.png") |
| 12 | + |
| 13 | +// @mst replace-next-line export default function WelcomeScreen() { |
| 14 | +export default observer(function WelcomeScreen() { |
| 15 | + const $bottomContainerInsets = useSafeAreaInsetsStyle(["bottom"]) |
| 16 | + |
| 17 | + return ( |
| 18 | + <View style={$container}> |
| 19 | + <View style={$topContainer}> |
| 20 | + <Image style={$welcomeLogo} source={welcomeLogo} resizeMode="contain" /> |
| 21 | + <Text |
| 22 | + testID="welcome-heading" |
| 23 | + style={$welcomeHeading} |
| 24 | + tx="welcomeScreen.readyForLaunch" |
| 25 | + preset="heading" |
| 26 | + /> |
| 27 | + <Text tx="welcomeScreen.exciting" preset="subheading" /> |
| 28 | + <Image style={$welcomeFace} source={welcomeFace} resizeMode="contain" /> |
| 29 | + </View> |
| 30 | + |
| 31 | + <View style={[$bottomContainer, $bottomContainerInsets]}> |
| 32 | + <Text tx="welcomeScreen.postscript" size="md" /> |
| 33 | + </View> |
| 34 | + </View> |
| 35 | + ) |
| 36 | +// @mst replace-next-line } |
| 37 | +}) |
| 38 | + |
| 39 | +const $container: ViewStyle = { |
| 40 | + flex: 1, |
| 41 | + backgroundColor: colors.background, |
| 42 | +} |
| 43 | + |
| 44 | +const $topContainer: ViewStyle = { |
| 45 | + flexShrink: 1, |
| 46 | + flexGrow: 1, |
| 47 | + flexBasis: "57%", |
| 48 | + justifyContent: "center", |
| 49 | + paddingHorizontal: spacing.lg, |
| 50 | +} |
| 51 | + |
| 52 | +const $bottomContainer: ViewStyle = { |
| 53 | + flexShrink: 1, |
| 54 | + flexGrow: 0, |
| 55 | + flexBasis: "43%", |
| 56 | + backgroundColor: colors.palette.neutral100, |
| 57 | + borderTopLeftRadius: 16, |
| 58 | + borderTopRightRadius: 16, |
| 59 | + paddingHorizontal: spacing.lg, |
| 60 | + justifyContent: "space-around", |
| 61 | +} |
| 62 | +const $welcomeLogo: ImageStyle = { |
| 63 | + height: 88, |
| 64 | + width: "100%", |
| 65 | + marginBottom: spacing.xxl, |
| 66 | +} |
| 67 | + |
| 68 | +const $welcomeFace: ImageStyle = { |
| 69 | + height: 169, |
| 70 | + width: 269, |
| 71 | + position: "absolute", |
| 72 | + bottom: -47, |
| 73 | + right: -80, |
| 74 | + transform: [{ scaleX: isRTL ? -1 : 1 }], |
| 75 | +} |
| 76 | + |
| 77 | +const $welcomeHeading: TextStyle = { |
| 78 | + marginBottom: spacing.md, |
| 79 | +} |
0 commit comments