From f39a320fd9e07750c8fcf7cc1882f21324a0ce58 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Wed, 7 Jul 2021 15:07:18 -0400 Subject: Fix navigation error handling --- src/constants/strings.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'src/constants') diff --git a/src/constants/strings.ts b/src/constants/strings.ts index 112bc546..071b3835 100644 --- a/src/constants/strings.ts +++ b/src/constants/strings.ts @@ -45,6 +45,7 @@ export const ERROR_SELECT_GENDER = 'Please select your gender'; export const ERROR_SELECT_UNIVERSITY = 'Please select your University'; export const ERROR_SERVER_DOWN = 'mhm, looks like our servers are down, please refresh and try again in a few mins'; export const ERROR_SOMETHING_WENT_WRONG = 'Oh dear, don’t worry someone will be held responsible for this error, In the meantime refresh the app'; +export const ERROR_NO_MOMENT_CATEGORY = 'Please select a category!'; export const ERROR_SOMETHING_WENT_WRONG_REFRESH = "Ha, looks like this one's on us, please refresh and try again"; export const ERROR_SOMETHING_WENT_WRONG_RELOAD = "You broke it, Just kidding! we don't know what happened... Please reload the app and try again"; export const ERROR_T_AND_C_NOT_ACCEPTED = 'You must first agree to the terms and conditions.'; -- cgit v1.2.3-70-g09d2 From 2a6035061a8a8a37dc74905180928aa75d92983f Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Wed, 7 Jul 2021 16:57:41 -0400 Subject: Add more styling to choosing category --- src/constants/constants.ts | 1 + src/screens/profile/ChoosingCategoryScreen.tsx | 80 ++++++++++++++++++-------- 2 files changed, 57 insertions(+), 24 deletions(-) (limited to 'src/constants') diff --git a/src/constants/constants.ts b/src/constants/constants.ts index f4ffd750..13a73208 100644 --- a/src/constants/constants.ts +++ b/src/constants/constants.ts @@ -66,6 +66,7 @@ export const YOUTUBE_FONT_COLOR: string = '#FCA4A4'; export const TAGG_PURPLE = '#8F01FF'; export const TAGG_DARK_BLUE = '#4E699C'; +export const TAGG_DARK_PURPLEISH_BLUE = '#4755A1'; export const TAGG_LIGHT_BLUE: string = '#698DD3'; export const TAGG_LIGHT_BLUE_2: string = '#6EE7E7'; export const TAGG_LIGHT_PURPLE = '#F4DDFF'; diff --git a/src/screens/profile/ChoosingCategoryScreen.tsx b/src/screens/profile/ChoosingCategoryScreen.tsx index a591cd69..daf7642d 100644 --- a/src/screens/profile/ChoosingCategoryScreen.tsx +++ b/src/screens/profile/ChoosingCategoryScreen.tsx @@ -2,19 +2,27 @@ import {useBottomTabBarHeight} from '@react-navigation/bottom-tabs'; import {RouteProp, useNavigation} from '@react-navigation/native'; import React, {FC} from 'react'; import { + Image, ScrollView, StyleSheet, Text, TouchableOpacity, View, } from 'react-native'; +import LinearGradient from 'react-native-linear-gradient'; import {useSafeAreaInsets} from 'react-native-safe-area-context'; import {useSelector} from 'react-redux'; import FrontArrow from '../../assets/icons/front-arrow.svg'; import {SearchBackground} from '../../components'; +import {TAGGS_GRADIENT, TAGG_DARK_PURPLEISH_BLUE} from '../../constants'; import {MainStackParams} from '../../routes'; import {RootState} from '../../store/rootReducer'; -import {normalize, SCREEN_HEIGHT, StatusBarHeight} from '../../utils'; +import { + getMomentCategoryIconInfo, + normalize, + SCREEN_HEIGHT, + StatusBarHeight, +} from '../../utils'; type ChoosingCategoryScreenRouteProps = RouteProp< MainStackParams, @@ -38,28 +46,32 @@ const ChoosingCategoryScreen: React.FC = ({ const MomentItem: FC<{ title: string; onPress: () => void; - }> = ({title, onPress}) => ( - - - - {/* */} - {title} - - - - - - ); + }> = ({title, onPress}) => { + const icon = getMomentCategoryIconInfo(title).icon; + return ( + + + + + + + + {title} + + + + + + ); + }; return ( @@ -69,6 +81,7 @@ const ChoosingCategoryScreen: React.FC = ({ contentContainerStyle={{paddingBottom: tabBarHeight}}> {momentCategories.map((title) => ( navigation.navigate('CaptionScreen', { @@ -92,7 +105,26 @@ const styles = StyleSheet.create({ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', - marginBottom: normalize(20), + marginVertical: normalize(20), + borderRadius: 4, + }, + gradientIcon: { + width: normalize(40), + height: normalize(40), + justifyContent: 'center', + alignItems: 'center', + borderRadius: 4, + }, + iconBackground: { + height: '85%', + width: '85%', + justifyContent: 'center', + alignItems: 'center', + backgroundColor: TAGG_DARK_PURPLEISH_BLUE, + }, + icon: { + height: normalize(25), + width: normalize(25), }, itemTitle: { color: 'white', -- cgit v1.2.3-70-g09d2