From 160eaf8084deb21d15fe03e6984a5bb057a57e94 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Wed, 7 Jul 2021 16:19:38 -0400 Subject: Add more styling to choosing category screen --- src/screens/profile/CaptionScreen.tsx | 10 ++-- src/screens/profile/ChoosingCategoryScreen.tsx | 82 ++++++++++++++++++++------ 2 files changed, 69 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index a8664d85..280319b4 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -224,13 +224,15 @@ const CaptionScreen: React.FC = ({route, navigation}) => { onPress: () => void; }> = ({text, imageUri, onPress}) => { return ( - + {text === 'Category' && !momentCategory && ( * )} - {text} + {text} {text === 'Tag Friends' && ( @@ -359,14 +361,14 @@ const styles = StyleSheet.create({ flex: { flex: 1, }, - tagFriendsTitle: { + selectableItemTitle: { color: 'white', fontSize: normalize(14), lineHeight: normalize(16.71), letterSpacing: normalize(0.3), fontWeight: '600', }, - tagFriendsContainer: { + selectableItemContainer: { marginHorizontal: '5%', flexDirection: 'row', justifyContent: 'space-between', diff --git a/src/screens/profile/ChoosingCategoryScreen.tsx b/src/screens/profile/ChoosingCategoryScreen.tsx index dd3bc1bb..a591cd69 100644 --- a/src/screens/profile/ChoosingCategoryScreen.tsx +++ b/src/screens/profile/ChoosingCategoryScreen.tsx @@ -1,4 +1,3 @@ -import AsyncStorage from '@react-native-community/async-storage'; import {useBottomTabBarHeight} from '@react-navigation/bottom-tabs'; import {RouteProp, useNavigation} from '@react-navigation/native'; import React, {FC} from 'react'; @@ -9,10 +8,13 @@ import { TouchableOpacity, View, } from 'react-native'; -import {SafeAreaView, useSafeAreaInsets} from 'react-native-safe-area-context'; -import {CaptionScreenHeader, SearchBackground} from '../../components'; +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 {MainStackParams} from '../../routes'; -import {StatusBarHeight} from '../../utils'; +import {RootState} from '../../store/rootReducer'; +import {normalize, SCREEN_HEIGHT, StatusBarHeight} from '../../utils'; type ChoosingCategoryScreenRouteProps = RouteProp< MainStackParams, @@ -26,33 +28,57 @@ interface ChoosingCategoryScreenProps { const ChoosingCategoryScreen: React.FC = ({ route, }) => { + const {momentCategories} = useSelector( + (state: RootState) => state.momentCategories, + ); const navigation = useNavigation(); const tabBarHeight = useBottomTabBarHeight(); const insetTop = useSafeAreaInsets().top; + const MomentItem: FC<{ title: string; - }> = ({title}) => ( - - navigation.navigate('CaptionScreen', { - selectedCategory: 'Food', - }) - }> - foo + onPress: () => void; + }> = ({title, onPress}) => ( + + + + {/* */} + {title} + + + + ); + return ( - {/* */} - {/* */} - - {[0, 0, 0, 0].map((item) => ( - + + {momentCategories.map((title) => ( + + navigation.navigate('CaptionScreen', { + selectedCategory: title, + }) + } + /> ))} - {/* */} ); }; @@ -61,7 +87,25 @@ const styles = StyleSheet.create({ container: { marginTop: StatusBarHeight, }, - scrollContainer: {}, + itemContainer: { + marginHorizontal: '5%', + flexDirection: 'row', + justifyContent: 'space-between', + alignItems: 'center', + marginBottom: normalize(20), + }, + itemTitle: { + color: 'white', + fontSize: normalize(14), + lineHeight: normalize(16.71), + letterSpacing: normalize(0.3), + fontWeight: '600', + alignSelf: 'center', + marginLeft: normalize(25), + }, + row: { + flexDirection: 'row', + }, }); export default ChoosingCategoryScreen; -- cgit v1.2.3-70-g09d2