Bladeren bron

feat: settings screen | update routes

Oleksandr Honcharov 1 jaar geleden
bovenliggende
commit
1b8132a3fd

+ 2 - 0
Route.tsx

@@ -19,6 +19,7 @@ import ProfileScreen from './src/screens/InAppScreens/ProfileScreen';
 import TravellersScreen from './src/screens/InAppScreens/TravellersScreen';
 
 import { EditPersonalInfo } from './src/screens/InAppScreens/ProfileScreen/Profile/edit-personal-info';
+import Settings from './src/screens/InAppScreens/ProfileScreen/Settings/';
 
 import { NAVIGATION_PAGES } from './src/types';
 import { storage, StoreType } from './src/storage';
@@ -115,6 +116,7 @@ const Route = () => {
                     name={NAVIGATION_PAGES.EDIT_PERSONAL_INFO}
                     component={EditPersonalInfo}
                   />
+                  <ScreenStack.Screen name={NAVIGATION_PAGES.SETTINGS} component={Settings} />
                 </ScreenStack.Navigator>
               )}
             </BottomTab.Screen>

+ 10 - 0
assets/icons/bell.svg

@@ -0,0 +1,10 @@
+<svg width="14" height="16" viewBox="0 0 14 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_664_4081)">
+<path d="M6.99989 0C6.44676 0 5.99989 0.446875 5.99989 1V1.6C3.71864 2.0625 1.99989 4.08125 1.99989 6.5V7.0875C1.99989 8.55625 1.45927 9.975 0.484265 11.075L0.253015 11.3344C-0.00948489 11.6281 -0.0719849 12.05 0.0873901 12.4094C0.246765 12.7688 0.60614 13 0.99989 13H12.9999C13.3936 13 13.7499 12.7688 13.9124 12.4094C14.0749 12.05 14.0093 11.6281 13.7468 11.3344L13.5155 11.075C12.5405 9.975 11.9999 8.55937 11.9999 7.0875V6.5C11.9999 4.08125 10.2811 2.0625 7.99989 1.6V1C7.99989 0.446875 7.55301 0 6.99989 0ZM8.41551 15.4156C8.79051 15.0406 8.99989 14.5312 8.99989 14H6.99989H4.99989C4.99989 14.5312 5.20926 15.0406 5.58426 15.4156C5.95926 15.7906 6.46864 16 6.99989 16C7.53114 16 8.04051 15.7906 8.41551 15.4156Z" fill="#0F3F4F"/>
+</g>
+<defs>
+<clipPath id="clip0_664_4081">
+<rect width="14" height="16" fill="white"/>
+</clipPath>
+</defs>
+</svg>

+ 10 - 0
assets/icons/document.svg

@@ -0,0 +1,10 @@
+<svg width="12" height="16" viewBox="0 0 12 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_649_3992)">
+<path d="M2 0C0.896875 0 0 0.896875 0 2V14C0 15.1031 0.896875 16 2 16H10C11.1031 16 12 15.1031 12 14V5H8C7.44688 5 7 4.55312 7 4V0H2ZM8 0V4H12L8 0ZM3.5 8H8.5C8.775 8 9 8.225 9 8.5C9 8.775 8.775 9 8.5 9H3.5C3.225 9 3 8.775 3 8.5C3 8.225 3.225 8 3.5 8ZM3.5 10H8.5C8.775 10 9 10.225 9 10.5C9 10.775 8.775 11 8.5 11H3.5C3.225 11 3 10.775 3 10.5C3 10.225 3.225 10 3.5 10ZM3.5 12H8.5C8.775 12 9 12.225 9 12.5C9 12.775 8.775 13 8.5 13H3.5C3.225 13 3 12.775 3 12.5C3 12.225 3.225 12 3.5 12Z" fill="#0F3F4F"/>
+</g>
+<defs>
+<clipPath id="clip0_649_3992">
+<rect width="12" height="16" fill="white"/>
+</clipPath>
+</defs>
+</svg>

+ 3 - 0
assets/icons/exit.svg

@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M11.8094 3.30938L15.6469 7.14687C15.8719 7.37187 16 7.68125 16 8C16 8.31875 15.8719 8.62812 15.6469 8.85312L11.8094 12.6906C11.6094 12.8906 11.3406 13 11.0594 13C10.475 13 10 12.525 10 11.9406V10H6C5.44688 10 5 9.55313 5 9V7C5 6.44688 5.44688 6 6 6H10V4.05937C10 3.475 10.475 3 11.0594 3C11.3406 3 11.6094 3.1125 11.8094 3.30938ZM5 3H3C2.44688 3 2 3.44688 2 4V12C2 12.5531 2.44688 13 3 13H5C5.55312 13 6 13.4469 6 14C6 14.5531 5.55312 15 5 15H3C1.34375 15 0 13.6562 0 12V4C0 2.34375 1.34375 1 3 1H5C5.55312 1 6 1.44687 6 2C6 2.55313 5.55312 3 5 3Z" />
+</svg>

+ 10 - 0
assets/icons/faq.svg

@@ -0,0 +1,10 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_648_3987)">
+<path d="M8 16C10.1217 16 12.1566 15.1571 13.6569 13.6569C15.1571 12.1566 16 10.1217 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0C5.87827 0 3.84344 0.842855 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8C0 10.1217 0.842855 12.1566 2.34315 13.6569C3.84344 15.1571 5.87827 16 8 16ZM5.30625 5.16563C5.55312 4.46875 6.21563 4 6.95625 4H8.77812C9.86875 4 10.75 4.88438 10.75 5.97188C10.75 6.67813 10.3719 7.33125 9.75937 7.68437L8.75 8.2625C8.74375 8.66875 8.40938 9 8 9C7.58437 9 7.25 8.66562 7.25 8.25V7.82812C7.25 7.55937 7.39375 7.3125 7.62813 7.17812L9.0125 6.38438C9.15938 6.3 9.25 6.14375 9.25 5.975C9.25 5.7125 9.0375 5.50313 8.77812 5.50313H6.95625C6.85 5.50313 6.75625 5.56875 6.72188 5.66875L6.70937 5.70625C6.57188 6.09688 6.14062 6.3 5.75313 6.1625C5.36563 6.025 5.15938 5.59375 5.29688 5.20625L5.30937 5.16875L5.30625 5.16563ZM7 11C7 10.7348 7.10536 10.4804 7.29289 10.2929C7.48043 10.1054 7.73478 10 8 10C8.26522 10 8.51957 10.1054 8.70711 10.2929C8.89464 10.4804 9 10.7348 9 11C9 11.2652 8.89464 11.5196 8.70711 11.7071C8.51957 11.8946 8.26522 12 8 12C7.73478 12 7.48043 11.8946 7.29289 11.7071C7.10536 11.5196 7 11.2652 7 11Z" fill="#0F3F4F"/>
+</g>
+<defs>
+<clipPath id="clip0_648_3987">
+<rect width="16" height="16" fill="white"/>
+</clipPath>
+</defs>
+</svg>

File diff suppressed because it is too large
+ 2 - 0
assets/icons/gear.svg


+ 3 - 0
assets/icons/mail.svg

@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M1.5 2C0.671875 2 0 2.67188 0 3.5C0 3.97187 0.221875 4.41562 0.6 4.7L7.4 9.8C7.75625 10.0656 8.24375 10.0656 8.6 9.8L15.4 4.7C15.7781 4.41562 16 3.97187 16 3.5C16 2.67188 15.3281 2 14.5 2H1.5ZM0 5.5V12C0 13.1031 0.896875 14 2 14H14C15.1031 14 16 13.1031 16 12V5.5L9.2 10.6C8.4875 11.1344 7.5125 11.1344 6.8 10.6L0 5.5Z" fill="#0F3F4F"/>
+</svg>

+ 1 - 1
assets/icons/right-arrow.svg

@@ -1,6 +1,6 @@
 <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
 <g clip-path="url(#clip0_4051_13205)">
-<path fill-rule="evenodd" clip-rule="evenodd" d="M5.79194 2.32325C6.1657 2.02424 6.71109 2.08484 7.0101 2.4586L11.0101 7.4586C11.2633 7.77512 11.2633 8.22488 11.0101 8.5414L7.0101 13.5414C6.71109 13.9152 6.1657 13.9758 5.79194 13.6768C5.41818 13.3777 5.35758 12.8324 5.65659 12.4586L9.22347 8L5.65659 3.5414C5.35758 3.16764 5.41818 2.62225 5.79194 2.32325Z" fill="#0F3F4F"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M5.79194 2.32325C6.1657 2.02424 6.71109 2.08484 7.0101 2.4586L11.0101 7.4586C11.2633 7.77512 11.2633 8.22488 11.0101 8.5414L7.0101 13.5414C6.71109 13.9152 6.1657 13.9758 5.79194 13.6768C5.41818 13.3777 5.35758 12.8324 5.65659 12.4586L9.22347 8L5.65659 3.5414C5.35758 3.16764 5.41818 2.62225 5.79194 2.32325Z" />
 </g>
 <defs>
 <clipPath id="clip0_4051_13205">

+ 10 - 0
assets/icons/shield.svg

@@ -0,0 +1,10 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_650_4020)">
+<path d="M8.00001 0C8.14376 0 8.28751 0.03125 8.41876 0.090625L14.3031 2.5875C14.9906 2.87813 15.5031 3.55625 15.5 4.375C15.4844 7.475 14.2094 13.1469 8.82501 15.725C8.30314 15.975 7.69689 15.975 7.17501 15.725C1.79064 13.1469 0.515639 7.475 0.500014 4.375C0.496889 3.55625 1.00939 2.87813 1.69689 2.5875L7.58439 0.090625C7.71251 0.03125 7.85626 0 8.00001 0ZM8.00001 2.0875V13.9C12.3125 11.8125 13.4719 7.19062 13.5 4.41875L8.00001 2.0875Z" fill="#0F3F4F"/>
+</g>
+<defs>
+<clipPath id="clip0_650_4020">
+<rect width="16" height="16" fill="white"/>
+</clipPath>
+</defs>
+</svg>

+ 10 - 0
assets/icons/user-pen.svg

@@ -0,0 +1,10 @@
+<svg width="16" height="13" viewBox="0 0 16 13" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_645_3961)">
+<path d="M5.6 6.4C6.44869 6.4 7.26263 6.06286 7.86274 5.46274C8.46286 4.86263 8.8 4.04869 8.8 3.2C8.8 2.35131 8.46286 1.53737 7.86274 0.937258C7.26263 0.337142 6.44869 0 5.6 0C4.75131 0 3.93737 0.337142 3.33726 0.937258C2.73714 1.53737 2.4 2.35131 2.4 3.2C2.4 4.04869 2.73714 4.86263 3.33726 5.46274C3.93737 6.06286 4.75131 6.4 5.6 6.4ZM4.4575 7.6C1.995 7.6 0 9.595 0 12.0575C0 12.4675 0.3325 12.8 0.7425 12.8H8.07C7.9925 12.58 7.9775 12.34 8.035 12.105L8.41 10.6025C8.48 10.32 8.625 10.065 8.83 9.86L9.8375 8.8525C9.035 8.0775 7.945 7.6 6.74 7.6H4.4575ZM15.345 5.8925C14.955 5.5025 14.3225 5.5025 13.93 5.8925L13.195 6.6275L14.97 8.4025L15.705 7.6675C16.095 7.2775 16.095 6.645 15.705 6.2525L15.345 5.8925ZM9.3975 10.425C9.295 10.5275 9.2225 10.655 9.1875 10.7975L8.8125 12.3C8.7775 12.4375 8.8175 12.58 8.9175 12.68C9.0175 12.78 9.16 12.82 9.2975 12.785L10.8 12.41C10.94 12.375 11.07 12.3025 11.1725 12.2L14.4025 8.9675L12.6275 7.1925L9.3975 10.425Z" />
+</g>
+<defs>
+<clipPath id="clip0_645_3961">
+<rect width="16" height="12.8" fill="white"/>
+</clipPath>
+</defs>
+</svg>

+ 10 - 0
assets/icons/user-plus.svg

@@ -0,0 +1,10 @@
+<svg width="16" height="13" viewBox="0 0 16 13" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_648_3970)">
+<path d="M2.4 3.2C2.4 2.35131 2.73714 1.53737 3.33726 0.937258C3.93737 0.337142 4.75131 0 5.6 0C6.44869 0 7.26263 0.337142 7.86274 0.937258C8.46286 1.53737 8.8 2.35131 8.8 3.2C8.8 4.04869 8.46286 4.86263 7.86274 5.46274C7.26263 6.06286 6.44869 6.4 5.6 6.4C4.75131 6.4 3.93737 6.06286 3.33726 5.46274C2.73714 4.86263 2.4 4.04869 2.4 3.2ZM0 12.0575C0 9.595 1.995 7.6 4.4575 7.6H6.7425C9.205 7.6 11.2 9.595 11.2 12.0575C11.2 12.4675 10.8675 12.8 10.4575 12.8H0.7425C0.3325 12.8 0 12.4675 0 12.0575ZM12.6 7.8V6.2H11C10.6675 6.2 10.4 5.9325 10.4 5.6C10.4 5.2675 10.6675 5 11 5H12.6V3.4C12.6 3.0675 12.8675 2.8 13.2 2.8C13.5325 2.8 13.8 3.0675 13.8 3.4V5H15.4C15.7325 5 16 5.2675 16 5.6C16 5.9325 15.7325 6.2 15.4 6.2H13.8V7.8C13.8 8.1325 13.5325 8.4 13.2 8.4C12.8675 8.4 12.6 8.1325 12.6 7.8Z" fill="#0F3F4F"/>
+</g>
+<defs>
+<clipPath id="clip0_648_3970">
+<rect width="16" height="12.8" fill="white"/>
+</clipPath>
+</defs>
+</svg>

+ 10 - 0
assets/icons/user-xmark.svg

@@ -0,0 +1,10 @@
+<svg width="16" height="13" viewBox="0 0 16 13" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_649_4016)">
+<path d="M2.4 3.2C2.4 2.35131 2.73714 1.53737 3.33726 0.937258C3.93737 0.337142 4.75131 0 5.6 0C6.44869 0 7.26263 0.337142 7.86274 0.937258C8.46286 1.53737 8.8 2.35131 8.8 3.2C8.8 4.04869 8.46286 4.86263 7.86274 5.46274C7.26263 6.06286 6.44869 6.4 5.6 6.4C4.75131 6.4 3.93737 6.06286 3.33726 5.46274C2.73714 4.86263 2.4 4.04869 2.4 3.2ZM0 12.0575C0 9.595 1.995 7.6 4.4575 7.6H6.7425C9.205 7.6 11.2 9.595 11.2 12.0575C11.2 12.4675 10.8675 12.8 10.4575 12.8H0.7425C0.3325 12.8 0 12.4675 0 12.0575ZM11.775 3.575C12.01 3.34 12.39 3.34 12.6225 3.575L13.7975 4.75L14.9725 3.575C15.2075 3.34 15.5875 3.34 15.82 3.575C16.0525 3.81 16.055 4.19 15.82 4.4225L14.645 5.5975L15.82 6.7725C16.055 7.0075 16.055 7.3875 15.82 7.62C15.585 7.8525 15.205 7.855 14.9725 7.62L13.7975 6.445L12.6225 7.62C12.3875 7.855 12.0075 7.855 11.775 7.62C11.5425 7.385 11.54 7.005 11.775 6.7725L12.95 5.5975L11.775 4.4225C11.54 4.1875 11.54 3.8075 11.775 3.575Z" />
+</g>
+<defs>
+<clipPath id="clip0_649_4016">
+<rect width="16" height="12.8" fill="white"/>
+</clipPath>
+</defs>
+</svg>

+ 117 - 0
src/screens/InAppScreens/ProfileScreen/Settings/index.tsx

@@ -0,0 +1,117 @@
+import React, { FC, ReactNode } from 'react';
+import { Text, TouchableOpacity, View } from 'react-native';
+
+import { NavigationProp, useNavigation } from '@react-navigation/native';
+
+import { styles } from './styles';
+
+import { Header, PageWrapper } from '../../../../components';
+import { NAVIGATION_PAGES } from '../../../../types';
+import { Colors } from '../../../../theme';
+
+import UserPenIcon from '../../../../../assets/icons/user-pen.svg';
+import UserPlusIcon from '../../../../../assets/icons/user-plus.svg';
+import BellIcon from '../../../../../assets/icons/bell.svg';
+import MailIcon from '../../../../../assets/icons/mail.svg';
+import FAQIcon from '../../../../../assets/icons/faq.svg';
+import DocumentIcon from '../../../../../assets/icons/document.svg';
+import ShieldIcon from '../../../../../assets/icons/shield.svg';
+import ExitIcon from '../../../../../assets/icons/exit.svg';
+import UserXMark from '../../../../../assets/icons/user-xmark.svg';
+
+import ArrowRightIcon from '../../../../../assets/icons/right-arrow.svg';
+
+type ButtonType = {
+  label: string;
+  icon: ReactNode;
+  red?: boolean;
+  buttonFn?: (navigationHook: NavigationProp<ReactNavigation.RootParamList>) => void;
+};
+
+const buttons: ButtonType[] = [
+  {
+    label: 'Edit Profile',
+    icon: <UserPenIcon fill={Colors.DARK_BLUE} width={20} height={20} />,
+    buttonFn: (navigation) => {
+      navigation.navigate(NAVIGATION_PAGES.EDIT_PERSONAL_INFO);
+    }
+  },
+  {
+    label: 'Invite a Friend',
+    icon: <UserPlusIcon fill={Colors.DARK_BLUE} width={20} height={20} />
+  },
+  {
+    label: 'Notification',
+    icon: <BellIcon fill={Colors.DARK_BLUE} width={20} height={20} />
+  },
+  {
+    label: 'Contact Us',
+    icon: <MailIcon fill={Colors.DARK_BLUE} width={20} height={20} />
+  },
+  {
+    label: 'FAQs',
+    icon: <FAQIcon fill={Colors.DARK_BLUE} width={20} height={20} />
+  },
+  {
+    label: 'Terms & Conditions',
+    icon: <DocumentIcon fill={Colors.DARK_BLUE} width={20} height={20} />
+  },
+  {
+    label: 'Privacy Notice',
+    icon: <ShieldIcon fill={Colors.DARK_BLUE} width={20} height={20} />
+  },
+  {
+    label: 'Logout',
+    icon: <ExitIcon fill={Colors.RED} width={20} height={20} />,
+    red: true
+  },
+  {
+    label: 'Delete account',
+    icon: <UserXMark fill={Colors.RED} width={20} height={20} />,
+    red: true
+  }
+];
+
+const Settings = () => {
+  return (
+    <PageWrapper>
+      <Header label={'Settings'} />
+      {buttons.map((button) => (
+        <SettingsButton
+          label={button.label}
+          icon={button.icon}
+          red={button.red}
+          buttonFn={button.buttonFn}
+        />
+      ))}
+    </PageWrapper>
+  );
+};
+
+type ButtonProps = {
+  label: string;
+  icon: ReactNode;
+  buttonFn?: (navigate: NavigationProp<ReactNavigation.RootParamList>) => void;
+  red?: boolean;
+};
+
+const SettingsButton: FC<ButtonProps> = ({ label, icon, buttonFn, red }) => {
+  const navigation = useNavigation();
+
+  return (
+    <TouchableOpacity
+      style={[styles.alignStyle, styles.buttonWrapper, { justifyContent: 'space-between' }]}
+      onPress={() => (buttonFn ? buttonFn(navigation) : null)}
+    >
+      <View style={styles.alignStyle}>
+        {icon}
+        <Text style={[styles.buttonLabel, red ? { color: Colors.RED } : null]}>{label}</Text>
+      </View>
+      <View>
+        <ArrowRightIcon fill={red ? Colors.RED : Colors.LIGHT_GRAY} width={20} height={20} />
+      </View>
+    </TouchableOpacity>
+  );
+};
+
+export default Settings;

+ 21 - 0
src/screens/InAppScreens/ProfileScreen/Settings/styles.ts

@@ -0,0 +1,21 @@
+import { StyleSheet } from 'react-native';
+import { Colors } from '../../../../theme';
+import { getFontSize } from '../../../../utils';
+
+export const styles = StyleSheet.create({
+  alignStyle: {
+    display: 'flex',
+    flexDirection: 'row',
+    alignItems: 'center'
+  },
+  buttonWrapper: {
+    width: '100%',
+    height: 48
+  },
+  buttonLabel: {
+    color: Colors.DARK_BLUE,
+    fontSize: getFontSize(12),
+    fontWeight: '700',
+    marginLeft: 15
+  }
+});

+ 2 - 1
src/types/navigation.ts

@@ -11,5 +11,6 @@ export enum NAVIGATION_PAGES {
   TRAVELLERS_TAB = 'Travellers',
   IN_APP_PROFILE = 'Profile',
   PROFILE_TAB = 'inAppProfile',
-  EDIT_PERSONAL_INFO = 'editPersonalInfo'
+  EDIT_PERSONAL_INFO = 'editPersonalInfo',
+  SETTINGS = 'settings'
 }

Some files were not shown because too many files changed in this diff