Browse Source

FIX | Fix styles app

pull/2/head
Vlad Narizhnyi 1 year ago
parent
commit
ff39c1eed7
  1. 167
      src/assets/image/glass.svg
  2. 36
      src/assets/image/winners-cup.svg
  3. 3
      src/module/common/colors/colors.ts
  4. 8
      src/module/common/components/buttons/button-primary.component.tsx
  5. 15
      src/module/common/components/buttons/button-with-icon.tsx
  6. 19
      src/module/common/components/header/header.component.tsx
  7. 16
      src/module/common/components/layout/screen-layout-content.component.tsx
  8. 11
      src/module/common/components/layout/screen-layout.component.tsx
  9. 3
      src/module/common/events/app-events.ts
  10. 10
      src/module/common/helpers/helper-height-view.ts
  11. 1
      src/module/common/helpers/index.ts
  12. 68
      src/module/common/widgets/alert-confirm/alert-confirm-widget.component.tsx
  13. 59
      src/module/common/widgets/alert/alert-widget.component.tsx
  14. 23
      src/module/game/components/question-block.tsx
  15. 68
      src/module/game/screens/game.screen.tsx
  16. 37
      src/module/game/screens/questions.screen.tsx
  17. 30
      src/module/packages/atoms/packages-page-separator.atom.tsx
  18. 84
      src/module/packages/components/packages-item.component.tsx
  19. 294
      src/module/packages/config/packages-list.config.tsx
  20. 45
      src/module/packages/screens/packages-list.screen.tsx
  21. 39
      src/module/root/atoms/dots.atom.tsx
  22. 3
      src/module/root/atoms/index.ts
  23. 59
      src/module/root/atoms/on-boarding-button.component.tsx
  24. 89
      src/module/root/atoms/premium-button.component.tsx
  25. 99
      src/module/root/components/content-on-boarding.component.tsx
  26. 3
      src/module/root/components/index.tsx
  27. 3
      src/module/root/config/on-boarding.config.ts
  28. 83
      src/module/root/screens/on-boarding.screen.tsx
  29. 6
      src/module/settings/components/settings-item.component.tsx
  30. 6
      src/module/settings/config/settings.config.tsx
  31. 8
      src/module/settings/screens/privacy-policy.tsx
  32. 5
      src/module/settings/screens/settings.screen.tsx

167
src/assets/image/glass.svg

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 38 KiB

36
src/assets/image/winners-cup.svg

@ -1,19 +1,19 @@ @@ -1,19 +1,19 @@
<svg width="375" height="310" viewBox="0 0 375 310" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M253.5 75.5C253.5 75.5686 253.472 75.678 253.335 75.8353C253.194 75.9959 252.962 76.1786 252.616 76.3751C251.923 76.7679 250.869 77.163 249.467 77.5479C246.67 78.3156 242.598 79.0124 237.54 79.5995C227.431 80.773 213.451 81.5 198 81.5C182.549 81.5 168.569 80.773 158.46 79.5995C153.402 79.0124 149.33 78.3156 146.533 77.5479C145.131 77.163 144.077 76.7679 143.384 76.3751C143.038 76.1786 142.806 75.9959 142.665 75.8353C142.528 75.678 142.5 75.5686 142.5 75.5C142.5 75.4314 142.528 75.322 142.665 75.1647C142.806 75.0041 143.038 74.8214 143.384 74.6249C144.077 74.2321 145.131 73.837 146.533 73.4521C149.33 72.6844 153.402 71.9876 158.46 71.4005C168.569 70.227 182.549 69.5 198 69.5C213.451 69.5 227.431 70.227 237.54 71.4005C242.598 71.9876 246.67 72.6844 249.467 73.4521C250.869 73.837 251.923 74.2321 252.616 74.6249C252.962 74.8214 253.194 75.0041 253.335 75.1647C253.472 75.322 253.5 75.4314 253.5 75.5Z" stroke="#9AC4F8"/>
<path d="M155.944 176.124C160.385 176.124 163.569 175.914 163.855 175.895L163.245 167.095C163.054 167.095 142.925 168.415 132.574 164.226C124.339 160.859 115.247 137.616 111.225 117.089C108.67 104.081 110.062 99.9873 111.129 98.6865C111.358 98.4187 111.968 97.6726 114.294 97.6726H122.319C124.644 104.693 128.361 111.752 133.966 111.752H150.149V102.972H134.614C133.279 101.633 131.087 96.697 129.81 92.1058L128.914 88.892H114.294C112.421 88.7803 110.548 89.1057 108.821 89.8425C107.095 90.5794 105.562 91.7076 104.343 93.1388C100.531 97.7491 100.016 105.669 102.609 118.83C104.696 129.425 107.805 139.792 111.892 149.782C117.172 162.255 123.024 169.888 129.276 172.432C136.977 175.531 148.357 176.124 155.944 176.124Z" fill="#9AC4F8"/>
<path opacity="0.2" d="M137.302 102.933H150.168V111.752H139.284L137.302 102.933Z" fill="black"/>
<path opacity="0.2" d="M163.855 175.895C163.511 175.895 160.385 176.124 155.944 176.124C155.2 176.124 154.438 176.124 153.637 176.124L151.731 167.286C158.117 167.478 163.168 167.152 163.321 167.133L163.855 175.895Z" fill="black"/>
<path d="M240.16 176.124C235.718 176.124 232.535 175.914 232.249 175.895L232.84 167.095C233.049 167.095 253.179 168.415 263.51 164.226C271.764 160.859 280.838 137.616 284.879 117.089C287.414 104.081 286.023 99.9873 284.879 98.6865C284.65 98.4186 284.04 97.6726 281.715 97.6726H273.689C271.364 104.693 267.628 111.752 262.043 111.752H245.84V102.972H261.375C263.618 99.6686 265.252 95.9882 266.198 92.1058L267.094 88.892H281.715C283.587 88.7818 285.46 89.1078 287.186 89.8446C288.912 90.5813 290.445 91.7088 291.665 93.1388C295.477 97.7491 295.973 105.669 293.399 118.83C291.306 129.426 288.191 139.792 284.097 149.782C278.836 162.255 272.984 169.888 266.732 172.432C259.107 175.531 247.727 176.124 240.16 176.124Z" fill="#9AC4F8"/>
<path opacity="0.2" d="M258.802 102.933H245.935V111.752H256.82L258.802 102.933Z" fill="black"/>
<path opacity="0.2" d="M232.249 175.895C232.592 175.895 235.718 176.124 240.16 176.124C240.903 176.124 241.665 176.124 242.466 176.124L244.372 167.286C237.986 167.478 232.935 167.152 232.783 167.133L232.249 175.895Z" fill="black"/>
<path d="M152.227 264.065V269H243.858V264.065H236.004L230.171 255.647L203.503 244.992V192.767H192.6V244.992L165.932 255.647L160.08 264.065H152.227Z" fill="#9AC4F8"/>
<path d="M189.588 199.731H206.515V194.24H189.588V199.731Z" fill="#9AC4F8"/>
<path opacity="0.2" d="M189.588 197.741L206.515 196.995V194.24H189.588V197.741Z" fill="black"/>
<path d="M141.971 76C141.971 76 146.26 154.144 157.431 173.81C168.601 193.475 192.447 195.139 198.014 195.139C203.58 195.139 227.407 193.456 238.577 173.81C249.748 154.163 254.037 76 254.037 76C254.037 76 248 81 198.004 81C148.008 81 141.971 76 141.971 76Z" fill="#9AC4F8"/>
<path opacity="0.3" d="M189.626 194.336C180.095 192.71 165.551 187.851 157.564 173.81C146.394 154.144 142.105 76 142.105 76L153 79C154.449 93.9405 156.935 155.005 165.017 171.61C171.994 186.129 188.406 193.915 189.626 194.336Z" fill="white"/>
<path opacity="0.2" d="M236.004 264.064H160.08L162.177 261.042L232.058 258.383L236.004 264.064Z" fill="black"/>
<path d="M198.006 120L202.024 128.239L211 129.55L204.503 135.951L206.042 145L198.006 140.733L189.971 145L191.51 135.951L185 129.55L193.989 128.239L198.006 120Z" fill="white"/>
<path d="M118.006 195L121.714 202.58L130 203.786L124.003 209.675L125.423 218L118.006 214.074L110.589 218L112.009 209.675L106 203.786L114.297 202.58L118.006 195Z" fill="#A798FF"/>
<path d="M198.006 32L201.714 39.58L210 40.7861L204.003 46.6751L205.423 55L198.006 51.074L190.589 55L192.009 46.6751L186 40.7861L194.297 39.58L198.006 32Z" fill="#A798FF"/>
<path d="M276.006 195L279.714 202.58L288 203.786L282.003 209.675L283.423 218L276.006 214.074L268.589 218L270.009 209.675L264 203.786L272.297 202.58L276.006 195Z" fill="#A798FF"/>
<svg width="194" height="257" viewBox="0 0 194 237" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M152.5 43.5C152.5 43.5686 152.472 43.678 152.335 43.8353C152.194 43.9959 151.962 44.1786 151.616 44.3751C150.923 44.7679 149.869 45.163 148.467 45.5479C145.67 46.3156 141.598 47.0124 136.54 47.5995C126.431 48.773 112.451 49.5 97 49.5C81.549 49.5 67.5692 48.773 57.4597 47.5995C52.4016 47.0124 48.3304 46.3156 45.5331 45.5479C44.1305 45.163 43.0769 44.7679 42.3844 44.3751C42.038 44.1786 41.8059 43.9959 41.6654 43.8353C41.5277 43.678 41.5 43.5686 41.5 43.5C41.5 43.4314 41.5277 43.322 41.6654 43.1647C41.8059 43.0041 42.038 42.8214 42.3844 42.6249C43.0769 42.2321 44.1305 41.837 45.5331 41.4521C48.3304 40.6844 52.4016 39.9876 57.4597 39.4005C67.5692 38.227 81.549 37.5 97 37.5C112.451 37.5 126.431 38.227 136.54 39.4005C141.598 39.9876 145.67 40.6844 148.467 41.4521C149.869 41.837 150.923 42.2321 151.616 42.6249C151.962 42.8214 152.194 43.0041 152.335 43.1647C152.472 43.322 152.5 43.4314 152.5 43.5Z" stroke="#9AC4F8"/>
<path d="M54.9439 144.124C59.3854 144.124 62.5687 143.914 62.8546 143.895L62.2447 135.095C62.054 135.095 41.9247 136.415 31.574 132.226C23.3393 128.859 14.2467 105.616 10.2246 85.0895C7.67035 72.0811 9.06189 67.9873 10.1294 66.6865C10.3581 66.4187 10.9681 65.6726 13.2936 65.6726H21.3187C23.6443 72.6933 27.3613 79.7522 32.9655 79.7522H49.1491V70.9716H33.6136C32.2793 69.6325 30.0872 64.697 28.81 60.1058L27.9141 56.892H13.2936C11.4209 56.7803 9.54784 57.1057 7.82143 57.8425C6.09503 58.5794 4.56222 59.7076 3.34329 61.1388C-0.469093 65.7491 -0.983743 73.6689 1.60868 86.8303C3.6956 97.4254 6.80462 107.792 10.8918 117.782C16.172 130.255 22.024 137.888 28.2763 140.432C35.9773 143.531 47.3573 144.124 54.9439 144.124Z" fill="#9AC4F8"/>
<path opacity="0.2" d="M36.3015 70.9333H49.1683V79.7522H38.2839L36.3015 70.9333Z" fill="black"/>
<path opacity="0.2" d="M62.8546 143.895C62.5115 143.895 59.3853 144.124 54.9439 144.124C54.2005 144.124 53.438 144.124 52.6374 144.124L50.7312 135.286C57.1169 135.478 62.1684 135.152 62.3209 135.133L62.8546 143.895Z" fill="black"/>
<path d="M139.16 144.124C134.718 144.124 131.535 143.914 131.249 143.895L131.84 135.095C132.049 135.095 152.179 136.415 162.51 132.226C170.764 128.859 179.838 105.616 183.879 85.0894C186.414 72.0811 185.023 67.9873 183.879 66.6865C183.65 66.4186 183.04 65.6726 180.715 65.6726H172.689C170.364 72.6932 166.628 79.7522 161.043 79.7522H144.84V70.9716H160.375C162.618 67.6686 164.252 63.9882 165.198 60.1058L166.094 56.892H180.715C182.587 56.7818 184.46 57.1078 186.186 57.8446C187.912 58.5813 189.445 59.7088 190.665 61.1388C194.477 65.7491 194.973 73.6689 192.399 86.8302C190.306 97.426 187.191 107.792 183.097 117.782C177.836 130.255 171.984 137.888 165.732 140.432C158.107 143.531 146.727 144.124 139.16 144.124Z" fill="#9AC4F8"/>
<path opacity="0.2" d="M157.802 70.9333H144.935V79.7522H155.82L157.802 70.9333Z" fill="black"/>
<path opacity="0.2" d="M131.249 143.895C131.592 143.895 134.718 144.124 139.16 144.124C139.903 144.124 140.665 144.124 141.466 144.124L143.372 135.286C136.986 135.478 131.935 135.152 131.783 135.133L131.249 143.895Z" fill="black"/>
<path d="M51.2268 232.065V237H142.858V232.065H135.004L129.171 223.647L102.503 212.992V160.767H91.6V212.992L64.9323 223.647L59.0803 232.065H51.2268Z" fill="#9AC4F8"/>
<path d="M88.5881 167.731H105.515V162.24H88.5881V167.731Z" fill="#9AC4F8"/>
<path opacity="0.2" d="M88.5881 165.741L105.515 164.995V162.24H88.5881V165.741Z" fill="black"/>
<path d="M40.9715 44C40.9715 44 45.2604 122.144 56.4307 141.81C67.601 161.475 91.4475 163.139 97.0136 163.139C102.58 163.139 126.407 161.456 137.577 141.81C148.748 122.163 153.037 44 153.037 44C153.037 44 147 49 97.004 49C47.0081 49 40.9715 44 40.9715 44Z" fill="#9AC4F8"/>
<path opacity="0.3" d="M88.6262 162.336C79.0952 160.71 64.551 155.851 56.564 141.81C45.3937 122.144 41.1048 44 41.1048 44L52 47C53.4487 61.9405 55.935 123.005 64.0172 139.61C70.9939 154.129 87.4062 161.915 88.6262 162.336Z" fill="white"/>
<path opacity="0.2" d="M135.004 232.064H59.0804L61.1773 229.042L131.058 226.383L135.004 232.064Z" fill="black"/>
<path d="M97.0064 88L101.024 96.2391L110 97.5501L103.503 103.951L105.042 113L97.0064 108.733L88.9712 113L90.5095 103.951L84 97.5501L92.9887 96.2391L97.0064 88Z" fill="white"/>
<path d="M17.0059 163L20.7144 170.58L29 171.786L23.0029 177.675L24.423 186L17.0059 182.074L9.58876 186L11.0088 177.675L5 171.786L13.2973 170.58L17.0059 163Z" fill="#A798FF"/>
<path d="M97.0059 0L100.714 7.57995L109 8.78611L103.003 14.6751L104.423 23L97.0059 19.074L89.5888 23L91.0088 14.6751L85 8.78611L93.2973 7.57995L97.0059 0Z" fill="#A798FF"/>
<path d="M175.006 163L178.714 170.58L187 171.786L181.003 177.675L182.423 186L175.006 182.074L167.589 186L169.009 177.675L163 171.786L171.297 170.58L175.006 163Z" fill="#A798FF"/>
</svg>

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

3
src/module/common/colors/colors.ts

@ -6,5 +6,6 @@ export const colors = { @@ -6,5 +6,6 @@ export const colors = {
red: '#E36588',
darkPurple: '#2C205C',
purple: '#A798FF',
lightPurple2: '#51418D',
lightPurple: '#51418D',
blue: '#9AC4F8',
}

8
src/module/common/components/buttons/button-primary.component.tsx

@ -2,7 +2,9 @@ import React, { FC, PropsWithChildren } from 'react' @@ -2,7 +2,9 @@ import React, { FC, PropsWithChildren } from 'react'
import {
ActivityIndicator,
DimensionValue,
StyleProp,
StyleSheet,
TextStyle,
TouchableOpacity,
View,
ViewStyle,
@ -26,6 +28,7 @@ interface IButtonPrimaryProps { @@ -26,6 +28,7 @@ interface IButtonPrimaryProps {
txtFont?: Font
txtColor?: string
disabled?: boolean
styleTxt?: any
}
export const ButtonPrimary: FC<PropsWithChildren<IButtonPrimaryProps>> = ({
@ -34,12 +37,13 @@ export const ButtonPrimary: FC<PropsWithChildren<IButtonPrimaryProps>> = ({ @@ -34,12 +37,13 @@ export const ButtonPrimary: FC<PropsWithChildren<IButtonPrimaryProps>> = ({
onPress,
isLoading,
mb = $size(20),
mb = 0,
width = '100%',
txtFont = Font.Roboto700,
txtMod = 'md',
txtColor = colors.textPrimary,
disabled = false,
styleTxt,
}) => {
if (isLoading) {
return (
@ -60,7 +64,7 @@ export const ButtonPrimary: FC<PropsWithChildren<IButtonPrimaryProps>> = ({ @@ -60,7 +64,7 @@ export const ButtonPrimary: FC<PropsWithChildren<IButtonPrimaryProps>> = ({
<Txt
font={txtFont}
mod={txtMod}
style={[styles.txtBtn, { color: txtColor }]}>
style={[styles.txtBtn, { color: txtColor }, styleTxt]}>
{children}
</Txt>
</TouchableOpacity>

15
src/module/common/components/buttons/button-with-icon.tsx

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
import React from 'react'
import { StyleSheet, TouchableOpacity } from 'react-native'
import { StyleSheet, TouchableOpacity, ViewStyle } from 'react-native'
import { colors } from '../../colors'
import { Icon } from '../icon'
import { $size } from '../../helpers'
@ -7,12 +7,19 @@ import { $size } from '../../helpers' @@ -7,12 +7,19 @@ import { $size } from '../../helpers'
interface IProps {
iconName: string
onPress: () => void
styleBtn?: ViewStyle
}
export const ButtonWithIcon: React.FC<IProps> = ({ iconName, onPress }) => {
export const ButtonWithIcon: React.FC<IProps> = ({
iconName,
onPress,
styleBtn,
}) => {
return (
<TouchableOpacity style={styles.container} onPress={onPress}>
<Icon name={iconName} size={$size(24)} />
<TouchableOpacity
style={[styles.container, styleBtn]}
onPress={onPress}>
<Icon name={iconName} size={$size(24)} color={colors.textPrimary} />
</TouchableOpacity>
)
}

19
src/module/common/components/header/header.component.tsx

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
import React, { FC } from 'react'
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'
import { StyleSheet, TouchableOpacity, View } from 'react-native'
import { colors } from '../../colors'
import { Icon } from '../icon'
import { $size } from '../../helpers'
@ -23,7 +23,7 @@ export const Header: FC<IProps> = ({ @@ -23,7 +23,7 @@ export const Header: FC<IProps> = ({
onPressRight,
}) => {
return (
<View style={[styles.header, gamer && { marginBottom: $size(16) }]}>
<View style={styles.header}>
<View style={styles.button}>
{leftIcon && (
<TouchableOpacity
@ -38,8 +38,14 @@ export const Header: FC<IProps> = ({ @@ -38,8 +38,14 @@ export const Header: FC<IProps> = ({
)}
</View>
<View style={styles.titleContainer}>
<Txt style={styles.title}>{title}</Txt>
<View
style={[
styles.titleContainer,
gamer && { backgroundColor: colors.darkPurple },
]}>
<Txt mod="xxl" style={styles.title}>
{title}
</Txt>
</View>
<View style={styles.button}>
@ -62,17 +68,16 @@ export const Header: FC<IProps> = ({ @@ -62,17 +68,16 @@ export const Header: FC<IProps> = ({
const styles = StyleSheet.create({
header: {
height: $size(54),
marginBottom: $size(24),
flexDirection: 'row',
alignContent: 'center',
alignItems: 'center',
justifyContent: 'space-between',
paddingHorizontal: 24,
},
title: {
color: colors.turquoise,
fontFamily: Font.Roboto700,
},
titleContainer: {
backgroundColor: colors.darkPurple,
borderRadius: 60,
minWidth: $size(130),
padding: $size(14),

16
src/module/common/components/layout/screen-layout-content.component.tsx

@ -12,7 +12,7 @@ import { $size } from '../../helpers' @@ -12,7 +12,7 @@ import { $size } from '../../helpers'
interface ScreenLayoutContentProps {
children: JSX.Element | JSX.Element[]
header?: () => React.ReactNode
horizontalPadding?: number
paddingHorizontal?: number
needScroll?: Boolean
scrollStyle?: ViewStyle
viewStyle?: ViewStyle
@ -22,14 +22,14 @@ interface ScreenLayoutContentProps { @@ -22,14 +22,14 @@ interface ScreenLayoutContentProps {
scrollRef?: React.MutableRefObject<KeyboardAwareScrollView>
extraHeight?: number
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined
topPadding?: number
paddingTop?: number
}
export const ScreenLayoutContent: FC<ScreenLayoutContentProps> = ({
children,
header,
topPadding = 16,
horizontalPadding = 16,
paddingTop = $size(16),
paddingHorizontal = 16,
needScroll,
scrollStyle,
viewStyle,
@ -50,8 +50,8 @@ export const ScreenLayoutContent: FC<ScreenLayoutContentProps> = ({ @@ -50,8 +50,8 @@ export const ScreenLayoutContent: FC<ScreenLayoutContentProps> = ({
pointerEvents={pointerEvents}
contentContainerStyle={[
{
paddingTop: 16,
paddingHorizontal: $size(horizontalPadding),
paddingTop,
paddingHorizontal: $size(paddingHorizontal),
},
scrollStyle,
]}>
@ -71,8 +71,8 @@ export const ScreenLayoutContent: FC<ScreenLayoutContentProps> = ({ @@ -71,8 +71,8 @@ export const ScreenLayoutContent: FC<ScreenLayoutContentProps> = ({
style={[
viewStyle,
{
paddingTop: topPadding,
paddingHorizontal: $size(horizontalPadding),
paddingTop,
paddingHorizontal: $size(paddingHorizontal),
flex: 1,
},
]}

11
src/module/common/components/layout/screen-layout.component.tsx

@ -12,6 +12,7 @@ import { ScreenLayoutContent } from './screen-layout-content.component' @@ -12,6 +12,7 @@ import { ScreenLayoutContent } from './screen-layout-content.component'
import _ from 'lodash'
import { gcService } from '../../tools'
import { colors } from '../../colors'
import { $size } from '../../helpers'
export interface ScreenLayoutProps {
children: JSX.Element | JSX.Element[]
@ -21,7 +22,7 @@ export interface ScreenLayoutProps { @@ -21,7 +22,7 @@ export interface ScreenLayoutProps {
leftBottomRound?: boolean
statusBarBg?: ColorValue
background?: string
horizontalPadding?: number
paddingHorizontal?: number
keyboardSpacerOn?: boolean
headerComponent?: ReactElement
scrollRef?: React.MutableRefObject<KeyboardAwareScrollView>
@ -30,14 +31,14 @@ export interface ScreenLayoutProps { @@ -30,14 +31,14 @@ export interface ScreenLayoutProps {
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined
bottomSafeArea?: boolean
bottomBarSafeArea?: boolean
topPadding?: number
paddingTop?: number
}
export const ScreenLayout = ({
statusBarBg,
background,
bottomSafeArea = false,
topPadding,
paddingTop,
bottomBarSafeArea = false,
...props
}: ScreenLayoutProps) => {
@ -45,7 +46,7 @@ export const ScreenLayout = ({ @@ -45,7 +46,7 @@ export const ScreenLayout = ({
const heightTopDefault = _.defaultTo(
Math.max(insets.top, gcService.get('insetsTop')),
50,
$size(44),
)
return (
@ -74,7 +75,7 @@ export const ScreenLayout = ({ @@ -74,7 +75,7 @@ export const ScreenLayout = ({
<ScreenLayoutContent
{...props}
header={() => props.headerComponent}
topPadding={topPadding}
paddingTop={paddingTop}
/>
{props.footer ? props.footer() : null}

3
src/module/common/events/app-events.ts

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
import { Events } from 'jet-tools'
import { ViewStyle } from 'react-native'
export type AppEvents = {
event: {
@ -9,6 +10,7 @@ export type AppEvents = { @@ -9,6 +10,7 @@ export type AppEvents = {
title: string
subtitle: string
btnText?: string
bottomTxt?: string
onClose?: () => void
}
@ -17,6 +19,7 @@ export type AppEvents = { @@ -17,6 +19,7 @@ export type AppEvents = {
confirmBtnText?: string
title: string
subtitle: string
isRedButton?: boolean
buttons: {
onPress: () => void
}[]

10
src/module/common/helpers/helper-height-view.ts

@ -1,10 +0,0 @@ @@ -1,10 +0,0 @@
import {Dimensions} from 'react-native';
const HEIGHT_SCREEN = Dimensions.get('screen').height;
export const heightPicture = () => {
if (HEIGHT_SCREEN < 1000) {
return 240;
}
return 340;
};

1
src/module/common/helpers/index.ts

@ -1,4 +1,3 @@ @@ -1,4 +1,3 @@
export * from './helper-height-view';
export * from './dimensions.helper';
export * from './style.helper';

68
src/module/common/widgets/alert-confirm/alert-confirm-widget.component.tsx

@ -13,12 +13,13 @@ interface IContent { @@ -13,12 +13,13 @@ interface IContent {
subtitle: string
confirmBtnText?: string
cancelBtnText?: string
isRedButton?: boolean
buttons: IContentButton[]
}
interface IContentButton {
btnText?: string
btnStyle?: ViewStyle
btnStyle?: ViewStyle | ViewStyle[]
txtColor?: string
onPress: () => void
}
@ -54,6 +55,7 @@ export const AlertConfirmWidget: FC = () => { @@ -54,6 +55,7 @@ export const AlertConfirmWidget: FC = () => {
title: data?.title,
subtitle: data?.subtitle,
buttons: data?.buttons,
isRedButton: data.isRedButton,
confirmBtnText: _.defaultTo(data?.confirmBtnText, 'Yes'),
cancelBtnText: _.defaultTo(data?.cancelBtnText, 'No'),
})
@ -79,7 +81,7 @@ export const AlertConfirmWidget: FC = () => { @@ -79,7 +81,7 @@ export const AlertConfirmWidget: FC = () => {
return [
{
btnText: content.cancelBtnText,
btnStyle: { ...styles.button, ...styles.borderRight },
btnStyle: styles.button,
txtColor: colors.textPrimary,
onPress: buttonsOnPress[0].onPress,
},
@ -87,7 +89,12 @@ export const AlertConfirmWidget: FC = () => { @@ -87,7 +89,12 @@ export const AlertConfirmWidget: FC = () => {
btnText: content.confirmBtnText,
onPress: buttonsOnPress[1]?.onPress,
txtColor: colors.textPrimary,
btnStyle: styles.button,
btnStyle: {
...styles.button,
backgroundColor: content?.isRedButton
? colors.red
: colors.darkPurple,
},
},
]
}
@ -100,7 +107,7 @@ export const AlertConfirmWidget: FC = () => { @@ -100,7 +107,7 @@ export const AlertConfirmWidget: FC = () => {
useNativeDriverForBackdrop={true}
backdropTransitionOutTiming={400}
hideModalContentWhileAnimating={true}
backdropColor={'rgba(0,0,0,0.8)'}
backdropColor={'rgba(0,0,0,0.7)'}
animationIn="pulse"
isVisible={Boolean(isVisible)}
onBackdropPress={close}
@ -108,13 +115,9 @@ export const AlertConfirmWidget: FC = () => { @@ -108,13 +115,9 @@ export const AlertConfirmWidget: FC = () => {
style={{ alignItems: 'center', justifyContent: 'center' }}>
<ModalComponent.Container style={styles.container}>
<View style={styles.content}>
<Txt mod="xl" font={Font.Roboto700} style={styles.title}>
{content?.title}
</Txt>
<Txt style={styles.title}>{content?.title}</Txt>
<Txt mod="md" style={styles.subtitle} font={Font.Roboto700}>
{content?.subtitle}
</Txt>
<Txt style={styles.subtitle}>{content?.subtitle}</Txt>
</View>
<View style={styles.buttonsContainer}>
{buttons.map((el: IContentButton, index: number) => (
@ -138,52 +141,55 @@ export const AlertConfirmWidget: FC = () => { @@ -138,52 +141,55 @@ export const AlertConfirmWidget: FC = () => {
const styles = StyleSheet.create({
container: {
borderRadius: 15,
overflow: 'hidden',
backgroundColor: '#262626',
justifyContent: 'space-between',
width: $size(270, 260),
borderRadius: 16,
backgroundColor: colors.lightPurple,
paddingHorizontal: $size(24),
paddingVertical: $size(32),
width: '100%',
},
content: {
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
gap: 8,
paddingHorizontal: $size(16),
paddingVertical: $size(20),
borderBottomWidth: 1,
borderBottomColor: 'rgba(255, 255, 255, 0.30)',
gap: $size(8),
marginBottom: $size(32),
},
title: {
fontSize: $size(24),
lineHeight: $size(34),
color: colors.turquoise,
textAlign: 'center',
width: '80%',
color: colors.textPrimary,
fontWeight: '700',
},
subtitle: {
textAlign: 'center',
width: '80%',
color: 'rgba(255, 255, 255, 0.50)',
fontWeight: '700',
fontSize: $size(18),
lineHeight: $size(28),
},
buttonsContainer: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
justifyContent: 'center',
columnGap: $size(11),
},
red: {
backgroundColor: colors.red,
},
button: {
width: '49.9%',
width: $size(134),
height: $size(50),
paddingHorizontal: $size(16),
paddingVertical: $size(12),
alignItems: 'center',
justifyContent: 'center',
},
borderRight: {
borderRightColor: 'rgba(255, 255, 255, 0.70)',
borderRightWidth: 1,
backgroundColor: colors.darkPurple,
borderRadius: 50,
},
})

59
src/module/common/widgets/alert/alert-widget.component.tsx

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
import React, { useEffect, useRef, useState } from 'react'
import { StyleSheet, View } from 'react-native'
import _ from 'lodash'
import _, { size } from 'lodash'
import { ButtonPrimary, ModalComponent, Txt } from '../../components'
import { $size } from '../../helpers'
import { colors } from '../../colors'
@ -11,12 +11,14 @@ interface IContent { @@ -11,12 +11,14 @@ interface IContent {
title: string
subtitle: string
btnText: string
bottomTxt?: string
}
const contentInitial: IContent = {
title: '',
subtitle: '',
btnText: 'OK',
bottomTxt: '',
}
export const AlertWidget = () => {
@ -35,6 +37,7 @@ export const AlertWidget = () => { @@ -35,6 +37,7 @@ export const AlertWidget = () => {
setContent({
title: data?.title,
subtitle: data?.subtitle,
bottomTxt: data?.bottomTxt,
btnText: _.defaultTo(data.btnText, contentInitial.btnText),
})
},
@ -74,16 +77,16 @@ export const AlertWidget = () => { @@ -74,16 +77,16 @@ export const AlertWidget = () => {
<View style={styles.content}>
<Txt style={styles.title}>{content?.title}</Txt>
<Txt mod="md" style={styles.subtitle}>
{content?.subtitle}
</Txt>
<Txt style={styles.subtitle}>{content?.subtitle}</Txt>
</View>
<View style={styles.button}>
<ButtonPrimary onPress={onConfirm} mb={0}>
{content.btnText}
</ButtonPrimary>
</View>
<ButtonPrimary
onPress={onConfirm}
mb={content?.bottomTxt ? $size(20) : 0}>
{content.btnText}
</ButtonPrimary>
<Txt style={styles.bottomTxt}>{content?.bottomTxt}</Txt>
</ModalComponent.Container>
</ModalComponent>
)
@ -92,43 +95,39 @@ export const AlertWidget = () => { @@ -92,43 +95,39 @@ export const AlertWidget = () => {
const styles = StyleSheet.create({
container: {
borderRadius: 16,
paddingHorizontal: 16,
paddingVertical: $size(80),
overflow: 'hidden',
backgroundColor: colors.darkPurple,
justifyContent: 'space-between',
height: $size(338),
backgroundColor: colors.lightPurple,
paddingHorizontal: $size(24),
paddingVertical: $size(32),
width: '100%',
},
content: {
justifyContent: 'center',
alignItems: 'center',
gap: 8,
gap: $size(8),
marginBottom: $size(32),
},
title: {
fontSize: $size(24),
lineHeight: $size(34),
color: colors.turquoise,
textAlign: 'center',
width: '80%',
color: colors.textPrimary,
fontWeight: '600',
fontSize: 22,
lineHeight: 24,
fontWeight: '700',
},
subtitle: {
textAlign: 'center',
width: '80%',
color: colors.textPrimary,
fontWeight: '600',
fontWeight: '700',
fontSize: $size(18),
lineHeight: $size(28),
},
button: {
alignSelf: 'center',
width: '100%',
bottomTxt: {
fontSize: $size(16),
lineHeight: $size(24),
textAlign: 'center',
},
btnTxt: {},
close: {},
bottomBtn: {},
})
export const Alert = {

23
src/module/game/components/question-block.tsx

@ -3,7 +3,7 @@ import { colors } from '../../common/colors' @@ -3,7 +3,7 @@ import { colors } from '../../common/colors'
import React, { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { GameItem } from '../../common/typing/interfaces/game-item'
import { $size, Icon, useAppDispatch, useAppSelector } from '../../common'
import { $size, Icon, Txt, useAppDispatch, useAppSelector } from '../../common'
import {
getShuffledDares,
getShuffledTruths,
@ -47,39 +47,34 @@ export const QuestionBlock: React.FC<IProps> = ({ isQuestions }) => { @@ -47,39 +47,34 @@ export const QuestionBlock: React.FC<IProps> = ({ isQuestions }) => {
return (
<View style={styles.container}>
<Icon
name="magic-star"
size={$size(24)}
buttonStyle={styles.starIcon}
/>
<Text style={styles.text}>
<Icon name="magic-star" size={$size(24)} style={styles.starIcon} />
<Txt style={styles.text}>
{currentStep < questions.length &&
isQuestions &&
questions[currentStep][lang as keyof GameItem]}
{currentStep < dares.length &&
!isQuestions &&
dares[currentStep][lang as keyof GameItem]}
</Text>
</Txt>
</View>
)
}
const styles = StyleSheet.create({
container: {
marginTop: 88,
width: '100%',
paddingHorizontal: 16,
paddingVertical: 40,
paddingHorizontal: $size(16),
paddingVertical: $size(32),
backgroundColor: colors.darkPurple,
borderRadius: 20,
alignItems: 'center',
},
starIcon: {
marginBottom: $size(14),
},
text: {
color: colors.purple,
fontSize: 22,
fontWeight: '400',
fontSize: $size(22),
lineHeight: $size(32),
textAlign: 'center',
},
})

68
src/module/game/screens/game.screen.tsx

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'
import {
$size,
ButtonPrimary,
ButtonWithIcon,
colors,
@ -18,7 +19,7 @@ export const GameScreen: FC = () => { @@ -18,7 +19,7 @@ export const GameScreen: FC = () => {
const nav = useNav()
const { params }: any = useRoute()
const title = params.title
const packageName = params.packageName
const goBack = () => {
nav.navigate(RouteKey.Package)
@ -26,7 +27,15 @@ export const GameScreen: FC = () => { @@ -26,7 +27,15 @@ export const GameScreen: FC = () => {
const randomGame = () => {
const isQuestions = Math.random() < 0.5
nav.navigate(RouteKey.Questions, { isQuestions, title })
nav.navigate(RouteKey.Questions, { isQuestions, packageName })
}
const onChooseQuestion = () => {
nav.navigate(RouteKey.Questions, { isQuestions: true, packageName })
}
const onChooseDare = () => {
nav.navigate(RouteKey.Questions, { packageName })
}
return (
@ -35,46 +44,59 @@ export const GameScreen: FC = () => { @@ -35,46 +44,59 @@ export const GameScreen: FC = () => {
<Header
leftIcon="arrow"
onPressLeft={() => goBack()}
title={title}
title={packageName}
gamer
/>
}>
<Txt mod="xxl" style={{ fontWeight: '700' }}>
<Txt mod="xxl" style={styles.playerName}>
Player
</Txt>
<View style={styles.buttons}>
<ButtonPrimary onPress={randomGame}>
<View style={styles.wrapButtons}>
<ButtonPrimary
width={188}
style={styles.gameButton}
styleTxt={styles.styleTxtBtn}
onPress={onChooseQuestion}>
{t('buttonsTranslation.truth')}
</ButtonPrimary>
<TouchableOpacity onPress={randomGame}>
<Text style={styles.random}>
{t('buttonsTranslation.random')}
</Text>
<Txt mod="lg">{t('buttonsTranslation.random')}</Txt>
</TouchableOpacity>
<ButtonPrimary onPress={randomGame}>
<ButtonPrimary
width={188}
styleTxt={styles.styleTxtBtn}
style={styles.gameButton}
onPress={onChooseDare}>
{t('buttonsTranslation.dare')}
</ButtonPrimary>
{/* <RedButton
name={t('buttonsTranslation.dare')}
isQuestions={false}
title={title}
/> */}
</View>
</ScreenLayout>
)
}
const styles = StyleSheet.create({
buttons: {
playerName: {
fontWeight: '700',
textAlign: 'center',
marginBottom: $size(122),
},
wrapButtons: {
alignItems: 'center',
height: 240,
justifyContent: 'space-between',
marginTop: 122,
rowGap: $size(40),
},
random: {
color: '#ffffff',
fontWeight: '400',
fontSize: 18,
gameButton: {
height: $size(66),
width: 188,
borderRadius: 40,
backgroundColor: colors.primaryColor,
borderWidth: 1,
borderColor: colors.darkPurple,
},
styleTxtBtn: {
color: colors.red,
fontWeight: '800',
fontSize: $size(36),
lineHeight: $size(46),
},
})

37
src/module/game/screens/questions.screen.tsx

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
import React, { useState } from 'react'
import { StyleSheet, View, Image } from 'react-native'
import React from 'react'
import { StyleSheet, View } from 'react-native'
import { useRoute } from '@react-navigation/native'
import {
ButtonPrimary,
$size,
ButtonWithIcon,
Header,
RouteKey,
@ -15,16 +15,15 @@ import { nextStep, resetSteps, shuffleItems } from '../../../store/slices' @@ -15,16 +15,15 @@ import { nextStep, resetSteps, shuffleItems } from '../../../store/slices'
import { QuestionBlock } from '../components'
export const QuestionsScreen: React.FC = () => {
const [isVisible, setIsVisible] = useState(false)
const nav = useNav()
const { params }: any = useRoute()
const { title, isQuestions } = params
const { packageName, isQuestions } = params
const dispatch = useAppDispatch()
const goBack = () => {
nav.navigate(RouteKey.Game, { title })
nav.navigate(RouteKey.Game, { packageName })
}
const goGameScreen = () => {
@ -44,28 +43,20 @@ export const QuestionsScreen: React.FC = () => { @@ -44,28 +43,20 @@ export const QuestionsScreen: React.FC = () => {
leftIcon="arrow"
gamer
onPressLeft={() => goBack()}
title={title}
title={packageName}
/>
}>
<View
style={{
display: 'flex',
flexDirection: 'column',
flex: 1,
justifyContent: 'space-between',
}}>
<Txt mod="xxl" style={{ fontWeight: '700' }}>
<View style={{ flex: 1 }}>
<Txt mod="xxl" style={styles.playerName}>
Player
</Txt>
<QuestionBlock isQuestions={isQuestions} />
<View style={styles.buttons}>
<ButtonWithIcon iconName="union" onPress={refreshList} />
<ButtonWithIcon iconName="play" onPress={goGameScreen} />
<ButtonWithIcon
iconName="add-plus"
onPress={() => setIsVisible(true)}
/>
<ButtonWithIcon iconName="add-plus" onPress={() => null} />
</View>
</View>
</ScreenLayout>
@ -73,10 +64,16 @@ export const QuestionsScreen: React.FC = () => { @@ -73,10 +64,16 @@ export const QuestionsScreen: React.FC = () => {
}
const styles = StyleSheet.create({
playerName: {
fontWeight: '700',
textAlign: 'center',
marginBottom: $size(88),
},
buttons: {
alignItems: 'center',
flexDirection: 'row',
justifyContent: 'space-between',
marginBottom: 66,
marginBottom: $size(66),
marginTop: 'auto',
},
})

30
src/module/packages/atoms/packages-page-separator.atom.tsx

@ -1,35 +1,35 @@ @@ -1,35 +1,35 @@
import React from 'react'
import { Image, StyleSheet, Text, View } from 'react-native'
import { $size } from '../../common'
import { $size, Txt, colors } from '../../common'
export const PackagesPageSeparator = () => {
return (
<View style={style.container}>
<View style={style.imageContainer}>
<Image source={require('../../../assets/image/line.png')} />
</View>
<Text style={style.text}>OR</Text>
<View style={style.imageContainer}>
<Image source={require('../../../assets/image/line.png')} />
</View>
<View style={styles.container}>
<View style={styles.dashedLine}></View>
<Txt style={styles.text}>OR</Txt>
<View style={styles.dashedLine}></View>
</View>
)
}
const style = StyleSheet.create({
const styles = StyleSheet.create({
container: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
marginBottom: $size(20),
},
imageContainer: {
width: $size(140),
overflow: 'hidden',
dashedLine: {
borderWidth: 1,
borderStyle: 'dashed',
borderColor: 'black',
flex: 1,
backgroundColor: colors.blue,
},
text: {
textAlign: 'center',
color: '#9AC4F8',
color: colors.blue,
fontSize: $size(14),
fontWeight: '900',
marginHorizontal: 16,
},
})

84
src/module/packages/components/packages-item.component.tsx

@ -1,9 +1,11 @@ @@ -1,9 +1,11 @@
import React, { FC } from 'react'
import { StyleSheet, View } from 'react-native'
import {
$size,
ButtonWithIcon,
RouteKey,
Txt,
colors,
useAppDispatch,
useNav,
} from '../../common'
@ -13,86 +15,88 @@ interface IType { @@ -13,86 +15,88 @@ interface IType {
[key: string]: string
}
interface IPackage {
title: string
packageName: string
description: string
image: JSX.Element
questions: IType[]
actions: IType[]
}
export const PackagesItem: FC<IPackage> = ({ title, description, image }) => {
export const PackageItem: FC<IPackage> = ({
packageName,
description,
image,
}) => {
const nav = useNav()
const dispatch = useAppDispatch()
const play = () => {
nav.navigate(RouteKey.Game, { title })
nav.navigate(RouteKey.Game, { packageName })
dispatch(resetSteps())
dispatch(shuffleTruths())
dispatch(shuffleDares())
}
return (
<View style={style.container}>
<View style={style.flex}>
<View style={style.imgContainer}>{image}</View>
<View style={style.textContainer}>
<Txt style={style.title}>{title}</Txt>
<Txt style={style.description}>{description}</Txt>
<View style={styles.container}>
<View style={styles.flex}>
<View style={styles.imgContainer}>{image}</View>
<View style={styles.textContainer}>
<Txt mod="xxl" style={styles.title}>
{packageName}
</Txt>
<Txt style={styles.description}>{description}</Txt>
</View>
</View>
<ButtonWithIcon iconName="play" onPress={play} />
<ButtonWithIcon
iconName="play"
onPress={play}
styleBtn={styles.play}
/>
</View>
)
}
const style = StyleSheet.create({
play: {
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#E36588',
borderRadius: 60,
width: 50,
height: 50,
position: 'absolute',
top: '50%',
right: -25,
transform: [{ translateY: -10 }],
},
const styles = StyleSheet.create({
container: {
backgroundColor: '#2C205C',
borderRadius: 20,
paddingVertical: 16,
paddingLeft: 16,
padding: $size(16),
position: 'relative',
width: '94%',
marginBottom: 16,
marginBottom: $size(16),
},
flex: {
flexDirection: 'row',
marginRight: 50,
},
title: {
fontWeight: '600',
fontSize: 22,
lineHeight: 32,
color: '#9AC4F8',
textTransform: 'capitalize',
color: colors.blue,
marginBottom: $size(5),
},
description: {
fontWeight: '400',
fontSize: 16,
lineHeight: 24,
color: '#7669C2',
marginBottom: $size(5),
color: colors.secondaryText,
fontSize: $size(16),
lineHeight: $size(24),
},
textContainer: {
width: 220,
marginLeft: 12,
alignItems: 'flex-start',
marginLeft: $size(12),
},
imgContainer: {
backgroundColor: '#37296B',
width: 50,
height: 50,
backgroundColor: colors.primaryColor,
width: $size(40),
height: $size(40),
borderRadius: 10,
overflow: 'hidden',
},
play: {
borderRadius: 60,
width: $size(50),
position: 'absolute',
top: '50%',
right: -25,
transform: [{ translateY: -10 }],
},
})

294
src/module/packages/config/packages-list.config.tsx

@ -1,150 +1,150 @@ @@ -1,150 +1,150 @@
import React from 'react';
import {Image} from 'react-native';
import React from 'react'
import { Image } from 'react-native'
export const packageListConfig = [
{
title: {en: 'Under 18', ua: 'До 18 років', hi: '18 स'},
image: (
<Image
source={require('../../../assets/image/rabbit.png')}
style={{width: '100%', height: '100%'}}
/>
),
description: {
en: 'Sharp questions and tasks for young people and of courseno alcohol.',
ua: 'Гострі питання і завдання для молоді і звичайно без алкоголю.',
hi: 'यिए तरशन और कय और निित रप सशरब नह।',
},
questions: [
{
en: 'Under truth',
ua: 'до 18 років правда',
hi: '18 स परषण',
},
{
en: 'Under truth2',
ua: 'до 18 років правда2',
hi: '18 स परषण2',
},
{
en: 'Under truth3',
ua: 'до 18 років правда3',
hi: '18 स परषण3',
},
],
actions: [
{
en: 'Light dare',
ua: 'до 18 років дія',
hi: '18 स परषण',
},
{
en: 'Light dare2',
ua: 'до 18 років дія2',
hi: '18 स परषण2',
},
{
en: 'Light dare3',
ua: 'до 18 років дія3',
hi: '18 स परषण3',
},
],
},
{
title: {en: 'Light', ua: 'Легкий', hi: 'रशन'},
image: (
<Image
source={require('../../../assets/image/feathers.png')}
style={{width: '100%', height: '100%'}}
/>
),
description: {
en: 'Challenge your friends or your significant other and see how far they can go!',
ua: 'Киньте виклик своїм друзям або своїй другій половинці та подивіться, як далеко вони можуть зайти!',
hi: 'अपन अपन महतवपण दसर और दिितनर ज सकत!',
},
questions: [
{
en: 'Light truth',
ua: 'легка правда',
hi: 'रशन परषण',
},
{
en: 'Light truth2',
ua: 'легка правда2',
hi: 'रशन परषण',
},
{
en: 'Light truth3',
ua: 'легка правда3',
hi: 'रशन परषण3',
},
],
actions: [
{
en: 'Light dare',
ua: 'легка дія',
hi: 'रशन परषण',
},
{
en: 'Light dare2',
ua: 'легка дія2',
hi: 'रशन परषण2',
},
{
en: 'Light dare3',
ua: 'легка дія3',
hi: 'रशन परषण3',
},
],
},
{
title: {en: 'Crazy', ua: 'Божевільний', hi: 'पगल'},
image: (
<Image
source={require('../../../assets/image/hand.png')}
style={{width: '100%', height: '100%'}}
/>
),
{
title: { en: 'Under 18', ua: 'До 18 років', hi: '18 स' },
image: (
<Image
source={require('../../../assets/image/rabbit.png')}
style={{ width: '100%', height: '100%' }}
/>
),
description: {
en: 'Sharp questions and tasks for young people and of courseno alcohol.',
ua: 'Гострі питання і завдання для молоді і звичайно без алкоголю.',
hi: 'यिए तरशन और कय और निित रप सशरब नह।',
},
questions: [
{
en: 'Under truth',
ua: 'до 18 років правда',
hi: '18 स परषण',
},
{
en: 'Under truth2',
ua: 'до 18 років правда2',
hi: '18 स परषण2',
},
{
en: 'Under truth3',
ua: 'до 18 років правда3',
hi: '18 स परषण3',
},
],
actions: [
{
en: 'Light dare',
ua: 'до 18 років дія',
hi: '18 स परषण',
},
{
en: 'Light dare2',
ua: 'до 18 років дія2',
hi: '18 स परषण2',
},
{
en: 'Light dare3',
ua: 'до 18 років дія3',
hi: '18 स परषण3',
},
],
},
{
title: { en: 'Light', ua: 'Легкий', hi: 'रशन' },
image: (
<Image
source={require('../../../assets/image/feathers.png')}
style={{ width: '100%', height: '100%' }}
/>
),
description: {
en: 'Challenge your friends or your significant other and see how far they can go!',
ua: 'Киньте виклик своїм друзям або своїй другій половинці та подивіться, як далеко вони можуть зайти!',
hi: 'अपन अपन महतवपण दसर और दिितनर ज सकत!',
},
questions: [
{
en: 'Light truth',
ua: 'легка правда',
hi: 'रशन परषण',
},
{
en: 'Light truth2',
ua: 'легка правда2',
hi: 'रशन परषण',
},
{
en: 'Light truth3',
ua: 'легка правда3',
hi: 'रशन परषण3',
},
],
actions: [
{
en: 'Light dare',
ua: 'легка дія',
hi: 'रशन परषण',
},
{
en: 'Light dare2',
ua: 'легка дія2',
hi: 'रशन परषण2',
},
{
en: 'Light dare3',
ua: 'легка дія3',
hi: 'रशन परषण3',
},
],
},
{
title: { en: 'Crazy', ua: 'Божевільний', hi: 'पगल' },
image: (
<Image
source={require('../../../assets/image/hand.png')}
style={{ width: '100%', height: '100%' }}
/>
),
description: {
en: 'Challenge your friends or your significant other and see how far they can go!',
ua: 'Киньте виклик своїм друзям або своїй другій половинці та подивіться, як далеко вони можуть зайти!',
hi: 'अपन अपन महतवपण दसर और दिितनर ज सकत!',
},
questions: [
{
en: 'Crazy truth',
ua: 'божевільна правда',
hi: 'पगल परषण',
},
{
en: 'Crazy truth2',
ua: 'божевільна правда2',
hi: 'पगल परषण2',
},
{
en: 'Crazy truth3',
ua: 'божевільна правда3',
hi: 'पगल परषण3',
},
],
actions: [
{
en: 'Crazy dare',
ua: 'божевільна дія',
hi: 'पगल परषण',
},
{
en: 'Crazy dare2',
ua: 'божевільна дія2',
hi: 'पगल परषण2',
},
{
en: 'Crazy dare3',
ua: 'божевільна дія3',
hi: 'पगल परषण3',
},
],
},
];
description: {
en: 'Challenge your friends or your significant other and see how far they can go!',
ua: 'Киньте виклик своїм друзям або своїй другій половинці та подивіться, як далеко вони можуть зайти!',
hi: 'अपन अपन महतवपण दसर और दिितनर ज सकत!',
},
questions: [
{
en: 'Crazy truth',
ua: 'божевільна правда',
hi: 'पगल परषण',
},
{
en: 'Crazy truth2',
ua: 'божевільна правда2',
hi: 'पगल परषण2',
},
{
en: 'Crazy truth3',
ua: 'божевільна правда3',
hi: 'पगल परषण3',
},
],
actions: [
{
en: 'Crazy dare',
ua: 'божевільна дія',
hi: 'पगल परषण',
},
{
en: 'Crazy dare2',
ua: 'божевільна дія2',
hi: 'पगल परषण2',
},
{
en: 'Crazy dare3',
ua: 'божевільна дія3',
hi: 'पगल परषण3',
},
],
},
]

45
src/module/packages/screens/packages-list.screen.tsx

@ -1,12 +1,10 @@ @@ -1,12 +1,10 @@
import React, { FC } from 'react'
import { Header, RouteKey, ScreenLayout, useNav } from '../../common'
import { ScrollView } from 'react-native-gesture-handler'
import { StyleSheet, View } from 'react-native'
import { CustomPackage } from '../atoms/create-custom-package.atom'
import { PackagesPageSeparator } from '../atoms/packages-page-separator.atom'
import { PackagesItem } from '../components/packages-item.component'
import { useTranslation } from 'react-i18next'
import { packageListConfig } from '../config'
import { PackageItem } from '../components'
import { CustomPackage, PackagesPageSeparator } from '../atoms'
export const PackagesListScreen: FC = () => {
const nav = useNav()
@ -15,38 +13,31 @@ export const PackagesListScreen: FC = () => { @@ -15,38 +13,31 @@ export const PackagesListScreen: FC = () => {
return (
<ScreenLayout
needScroll
headerComponent={
<Header
rightIcon="setting"
onPressRight={() => nav.navigate(RouteKey.Setting)}
/>
}>
<ScrollView contentContainerStyle={styles.scrollView}>
<View style={styles.container}>
{packageListConfig.map((item: any, index) => (
<PackagesItem
title={item.title[lang]}
description={item.description[lang]}
questions={item.questions}
actions={item.actions}
image={item.image}
key={index}
/>
))}
<PackagesPageSeparator />
<CustomPackage />
</View>
</ScrollView>
<View style={styles.container}>
{packageListConfig.map((item: any, index) => (
<PackageItem
packageName={item.title[lang]}
description={item.description[lang]}
questions={item.questions}
actions={item.actions}
image={item.image}
key={index}
/>
))}
<PackagesPageSeparator />
<CustomPackage />
</View>
</ScreenLayout>
)
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
scrollView: {
paddingBottom: 30,
paddingHorizontal: 5,
},
container: {},
})

39
src/module/root/atoms/dots.atom.tsx

@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
import React, { FC } from 'react'
import { StyleSheet, View } from 'react-native'
import { $size } from '../../common'
import { onBoardingConfig } from '../config'
interface IProps {
activeDot: number
}
export const DotsAtom: FC<IProps> = ({ activeDot }) => {
return (
<View style={styles.container}>
{onBoardingConfig.map((el, index) => (
<View
key={index}
style={[
styles.point,
{
backgroundColor:
index === activeDot ? '#A798FF' : '#2C205C',
},
]}></View>
))}
</View>
)
}
const styles = StyleSheet.create({
container: {
flexDirection: 'row',
marginBottom: $size(50),
},
point: {
height: $size(8),
width: $size(8),
marginRight: 10,
borderRadius: 100,
},
})

3
src/module/root/atoms/index.ts

@ -1 +1,2 @@ @@ -1 +1,2 @@
export * from './premium-button.component'
export * from './on-boarding-button.component'
export * from './dots.atom'

59
src/module/root/atoms/on-boarding-button.component.tsx

@ -0,0 +1,59 @@ @@ -0,0 +1,59 @@
import AsyncStorage from '@react-native-async-storage/async-storage'
import React, { FC } from 'react'
import { useTranslation } from 'react-i18next'
import { StyleSheet, TouchableOpacity, View } from 'react-native'
import {
$size,
ButtonPrimary,
RouteKey,
StorageKey,
Txt,
useNav,
} from '../../common'
interface IProps {
isLastBlock: boolean
onPressSkip: () => void
}
export const OnBoardingBottom: FC<IProps> = ({ isLastBlock, onPressSkip }) => {
const nav = useNav()
const { t } = useTranslation()
const onBoardFinish = async () => {
await AsyncStorage.setItem(StorageKey.OnBoarding, 'true')
nav.navigate(RouteKey.Package)
}
return (
<View style={styles.btnContainer}>
{isLastBlock ? (
<>
<ButtonPrimary onPress={onBoardFinish} width={190}>
{t('buttonsTranslation.priceButton')}
</ButtonPrimary>
<TouchableOpacity onPress={onBoardFinish}>
<Txt style={styles.text}>
{t('buttonsTranslation.later')}
</Txt>
</TouchableOpacity>
</>
) : (
<ButtonPrimary onPress={onPressSkip} width={155}>
{t('buttonsTranslation.skip')}
</ButtonPrimary>
)}
</View>
)
}
const styles = StyleSheet.create({
text: {
fontSize: $size(16),
lineHeight: $size(24),
marginTop: $size(8),
},
btnContainer: {
alignItems: 'center',
marginBottom: $size(20),
},
})

89
src/module/root/atoms/premium-button.component.tsx

@ -1,89 +0,0 @@ @@ -1,89 +0,0 @@
import AsyncStorage from '@react-native-async-storage/async-storage'
import React, { FC } from 'react'
import { useTranslation } from 'react-i18next'
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'
import {
ButtonPrimary,
colors,
RouteKey,
StorageKey,
useNav,
} from '../../common'
interface IProps {
currentIndex: number
data: Array<{
title: string
description: string
image: any
}>
onPressItem: (
data: Array<{
title: string
description: string
image: any
}>,
) => void
}
export const GroupBtn: FC<IProps> = ({ currentIndex, data, onPressItem }) => {
const nav = useNav()
const { t } = useTranslation()
const onBoardFinish = async () => {
await AsyncStorage.setItem(StorageKey.OnBoarding, 'true')
nav.navigate(RouteKey.Package)
}
if (data.length - 1 === currentIndex) {
return (
<View style={styles.btnContainer}>
<ButtonPrimary
onPress={onBoardFinish}
children={
<Text style={styles.text}>
{t('buttonsTranslation.priceButton')}
</Text>
}
width={190}
/>
<TouchableOpacity
style={styles.laterBtn}
onPress={onBoardFinish}>
<Text style={[styles.text, { fontWeight: '400' }]}>
{t('buttonsTranslation.later')}
</Text>
</TouchableOpacity>
</View>
)
} else {
return (
<ButtonPrimary
onPress={() => onPressItem(data)}
children={
<Text style={styles.text}>
{t('buttonsTranslation.skip')}
</Text>
}
width={155}
/>
)
}
}
const styles = StyleSheet.create({
text: {
color: colors.textPrimary,
fontSize: 16,
fontWeight: '700',
},
laterBtn: {
width: 190,
alignItems: 'center',
height: 40,
justifyContent: 'center',
},
btnContainer: {
alignItems: 'center',
marginTop: 'auto',
},
})

99
src/module/root/components/content-on-boarding.component.tsx

@ -1,99 +0,0 @@ @@ -1,99 +0,0 @@
import React, { FC } from 'react'
import { useTranslation } from 'react-i18next'
import { View, Text, StyleSheet } from 'react-native'
import { Language, colors, heightPicture } from '../../common'
import { GroupBtn } from '../atoms/premium-button.component'
import { OnBoardData } from '../config/on-boarding.config'
interface IProps {
currentIndex: number
onPressItem: (data: any) => void
}
export const ContentOnBoarding: FC<IProps> = ({
currentIndex,
onPressItem,
}) => {
const { t, i18n } = useTranslation()
const Picture = OnBoardData[currentIndex].image
const changeFontSize = () => (i18n.language === Language.UA ? 30 : 32)
return (
<View style={styles.container}>
<View style={styles.image}>
<Picture width={'100%'} height={heightPicture()} />
</View>
<View style={styles.textContainer}>
<Text style={[styles.title, { fontSize: changeFontSize() }]}>
{t(OnBoardData[currentIndex].title)}
</Text>
<Text style={styles.description}>
{t(OnBoardData[currentIndex].description)}
</Text>
</View>
<View style={styles.button}>
<View style={styles.dots}>
{OnBoardData.map((el, index) => (
<View
key={`${el} + ${index}`}
style={[
styles.point,
{
backgroundColor:
index === currentIndex
? '#A798FF'
: '#2C205C',
},
]}></View>
))}
</View>
<GroupBtn
data={OnBoardData}
onPressItem={onPressItem}
currentIndex={currentIndex}
/>
</View>
</View>
)
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
},
description: {
color: '#A798FF',
fontSize: 16,
textAlign: 'center',
lineHeight: 24,
width: '100%',
},
title: {
color: colors.textPrimary,
marginBottom: 25,
fontWeight: '700',
textAlign: 'center',
width: '100%',
},
point: {
height: 8,
width: 8,
marginRight: 10,
borderRadius: 100,
},
image: {
width: '100%',
},
button: {
alignItems: 'center',
marginBottom: 30,
marginTop: 'auto',
},
dots: {
flexDirection: 'row',
marginBottom: 20,
},
textContainer: {
flex: 0,
alignItems: 'center',
width: '100%',
},
})

3
src/module/root/components/index.tsx

@ -1,2 +1 @@ @@ -1,2 +1 @@
export * from './content-on-boarding.component';
export * from './language-item.component';
export * from './language-item.component'

3
src/module/root/config/on-boarding.config.ts

@ -2,12 +2,13 @@ import ImageHearts from '../../../assets/image/hearts.svg' @@ -2,12 +2,13 @@ import ImageHearts from '../../../assets/image/hearts.svg'
import ImageGlass from '../../../assets/image/glass.svg'
import ImageCup from '../../../assets/image/winners-cup.svg'
import { OnBoardingLocale } from '../../../i18n/types/on-boarding.types'
const translatePath = (
itemKey: keyof OnBoardingLocale.OnboardingSteps,
key: keyof OnBoardingLocale.IStep,
) => `stepTranslation.${itemKey}.${key}`
export const OnBoardData = [
export const onBoardingConfig = [
{
title: translatePath('step1', 'title'),
description: translatePath('step1', 'description'),

83
src/module/root/screens/on-boarding.screen.tsx

@ -1,14 +1,27 @@ @@ -1,14 +1,27 @@
import React, { FC, useState } from 'react'
import { Header, RouteKey, colors, ScreenLayout, useNav } from '../../common'
import { ContentOnBoarding } from '../components'
import {
$size,
Header,
RouteKey,
ScreenLayout,
Txt,
colors,
useNav,
} from '../../common'
import { StyleSheet, View } from 'react-native'
import { onBoardingConfig } from '../config'
import { DotsAtom, OnBoardingBottom } from '../atoms'
import { useTranslation } from 'react-i18next'
export const OnboardingScreen: FC = () => {
const [currentIndex, setCurrentIndex] = useState(0)
const nav = useNav()
const { t } = useTranslation()
const [currentIndex, setCurrentIndex] = useState(0)
const onPressItem = (data: any) => {
const onPressSkip = () => {
const nextIndex = currentIndex + 1
if (nextIndex < data.length) {
if (nextIndex < onBoardingConfig.length) {
setCurrentIndex(nextIndex)
}
}
@ -21,19 +34,61 @@ export const OnboardingScreen: FC = () => { @@ -21,19 +34,61 @@ export const OnboardingScreen: FC = () => {
}
}
const Picture = onBoardingConfig[currentIndex].image
const isLastBlock = onBoardingConfig.length - 1 === currentIndex
return (
<ScreenLayout
headerComponent={
<Header
leftIcon="arrow"
onPressLeft={() => goBack()}
rightIcon="none"
/>
<Header leftIcon="arrow" onPressLeft={() => goBack()} />
}>
<ContentOnBoarding
currentIndex={currentIndex}
onPressItem={onPressItem}
/>
<View style={styles.container}>
<Picture
width={'100%'}
height={$size(240)}
style={{ marginTop: $size(-50) }}
/>
<Txt style={styles.title}>
{t(onBoardingConfig[currentIndex].title)}
</Txt>
<Txt style={styles.description}>
{t(onBoardingConfig[currentIndex].description)}
</Txt>
<View style={styles.bottomContainer}>
<DotsAtom activeDot={currentIndex} />
<OnBoardingBottom
isLastBlock={isLastBlock}
onPressSkip={onPressSkip}
/>
</View>
</View>
</ScreenLayout>
)
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
title: {
fontSize: $size(32),
lineHeight: $size(38),
fontWeight: '700',
textAlign: 'center',
marginVertical: $size(24),
},
description: {
color: colors.purple,
fontSize: $size(16),
textAlign: 'center',
lineHeight: $size(24),
},
bottomContainer: {
alignItems: 'center',
marginBottom: $size(30),
marginTop: 'auto',
},
})

6
src/module/settings/components/settings-item.component.tsx

@ -25,7 +25,7 @@ export const SettingsItem: FC<IProps> = ({ title, iconName, component }) => { @@ -25,7 +25,7 @@ export const SettingsItem: FC<IProps> = ({ title, iconName, component }) => {
return (
<TouchableOpacity style={styles.container} onPress={goTo}>
<View style={styles.row}>
<Icon name={iconName} size={$size(24)} color="#A798FF" />
<Icon name={iconName} size={$size(24)} color={colors.purple} />
<Txt mod="lg" style={styles.text}>
{t(title)}
</Txt>
@ -41,12 +41,14 @@ const styles = StyleSheet.create({ @@ -41,12 +41,14 @@ const styles = StyleSheet.create({
},
text: {
color: colors.purple,
lineHeight: $size(24),
marginLeft: $size(10),
},
container: {
flexDirection: 'row',
alignContent: 'center',
alignItems: 'center',
marginBottom: $size(24),
height: $size(24),
justifyContent: 'space-between',
},
})

6
src/module/settings/config/settings.config.tsx

@ -5,7 +5,7 @@ import { SettingLocale } from '../../../i18n/types/settings.types' @@ -5,7 +5,7 @@ import { SettingLocale } from '../../../i18n/types/settings.types'
const translatePath = (itemKey: keyof SettingLocale.Core) =>
`settingTranslation.${itemKey}`
export const SettingsData = [
export const settingsConfig = [
{
title: translatePath('purchases'),
image: 'purchases',
@ -31,10 +31,6 @@ export const SettingsData = [ @@ -31,10 +31,6 @@ export const SettingsData = [
title: translatePath('policy'),
image: 'privacy-policy',
},
{
title: translatePath('term'),
image: 'terms-&-cond',
},
{
title: translatePath('information'),
image: 'information',

8
src/module/settings/screens/privacy-policy.tsx

@ -1,13 +1,12 @@ @@ -1,13 +1,12 @@
import React, { FC } from 'react'
import { useTranslation } from 'react-i18next'
import { StyleSheet, View } from 'react-native'
import { colors, Header, ScreenLayout, Txt, useNav } from '../../common'
import { $size, colors, Header, ScreenLayout, Txt, useNav } from '../../common'
import { privacyConfig } from '../config'
export const PrivacyPolicyScreen: FC = () => {
const { t, i18n } = useTranslation()
const nav = useNav()
const lang = i18n.language
return (
<ScreenLayout
@ -20,7 +19,7 @@ export const PrivacyPolicyScreen: FC = () => { @@ -20,7 +19,7 @@ export const PrivacyPolicyScreen: FC = () => {
}>
<View style={styles.container}>
<Txt mod="xl" style={styles.description}>
{privacyConfig[lang]}
{privacyConfig[i18n.language]}
</Txt>
</View>
</ScreenLayout>
@ -31,9 +30,10 @@ const styles = StyleSheet.create({ @@ -31,9 +30,10 @@ const styles = StyleSheet.create({
container: {
backgroundColor: colors.darkPurple,
borderRadius: 20,
paddingHorizontal: 20,
padding: 20,
},
description: {
color: colors.purple,
lineHeight: $size(30),
},
})

5
src/module/settings/screens/settings.screen.tsx

@ -2,7 +2,7 @@ import React, { FC } from 'react' @@ -2,7 +2,7 @@ import React, { FC } from 'react'
import { useTranslation } from 'react-i18next'
import { View } from 'react-native'
import { SettingsItem } from '../components/settings-item.component'
import { SettingsData } from '../config/settings.config'
import { settingsConfig } from '../config/settings.config'
import { Header, colors, ScreenLayout, useNav } from '../../common'
export const SettingsScreen: FC = () => {
@ -14,13 +14,12 @@ export const SettingsScreen: FC = () => { @@ -14,13 +14,12 @@ export const SettingsScreen: FC = () => {
headerComponent={
<Header
leftIcon="arrow"
rightIcon="inst"
title={t('pageTitles.setting')}
onPressLeft={() => nav.goBack()}
/>
}>
<View>
{SettingsData.map((item, index) => (
{settingsConfig.map((item, index) => (
<SettingsItem
key={index}
title={item.title}

Loading…
Cancel
Save