Skip to content

Commit e0fdeac

Browse files
committed
Update settings about modal
1 parent b8b44ad commit e0fdeac

File tree

9 files changed

+133
-26
lines changed

9 files changed

+133
-26
lines changed

assets/images/company-icon-dark.png

17.2 KB
Loading

assets/images/company-icon-light.png

18.4 KB
Loading

src/components/Page/PageHeader/index.tsx

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
import React from 'react';
2-
import {Platform, StatusBar} from 'react-native';
2+
import {Platform, StatusBar, View} from 'react-native';
33
import {Text, Layout} from '@ui-kitten/components';
44
import {iOSUIKit} from 'react-native-typography';
5+
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
56

67
import {HeaderText} from '../../Text/Header';
78
import {K} from '../../../store/constants';
89
export const PageHeader = (props: {
910
theme: any;
1011
title: string;
1112
type: string;
13+
bottomBar?: boolean;
14+
leadingButton?: string;
15+
actionButton?: string;
16+
navigation: any;
1217
}) => {
1318
const themeColor = props.theme === 'dark' ? K.color.dark : K.color.light;
1419
return (
@@ -28,7 +33,7 @@ export const PageHeader = (props: {
2833
<Layout
2934
style={{
3035
paddingLeft: 30,
31-
paddingBottom: 30,
36+
paddingBottom: props.bottomBar === true ? 10 : 30,
3237
backgroundColor: 'transparent',
3338
}}>
3439
<Text
@@ -42,19 +47,42 @@ export const PageHeader = (props: {
4247
) : (
4348
<Layout
4449
style={{
45-
paddingBottom: 12,
50+
paddingBottom: props.bottomBar === false ? 10 : 30,
4651
backgroundColor: 'transparent',
4752
width: '100%',
53+
flexDirection: 'row',
4854
}}>
55+
<View style={{flex: 1}}>
56+
{typeof props.leadingButton === 'string' ? (
57+
<Icon
58+
name={props.leadingButton}
59+
size={30}
60+
color={themeColor.lightText}
61+
onPress={props.navigation.goBack}
62+
style={{marginHorizontal: 20}}
63+
/>
64+
) : null}
65+
</View>
4966
<Text
5067
style={{
5168
...iOSUIKit.bodyEmphasizedObject,
5269
color: themeColor.lightText,
53-
width: '100%',
5470
textAlign: 'center',
71+
flex: 3,
5572
}}>
5673
{props.title}
5774
</Text>
75+
<View style={{flex: 1}}>
76+
{typeof props.actionButton === 'string' ? (
77+
<Icon
78+
name={props.actionButton}
79+
size={30}
80+
color={themeColor.lightText}
81+
onPress={props.navigation.goBack}
82+
style={{marginHorizontal: 20}}
83+
/>
84+
) : null}
85+
</View>
5886
</Layout>
5987
)}
6088
</Layout>

src/pages/Find/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { PageHeader } from '../../components/Page/PageHeader';
88
const FindPageC = (props: any) => {
99
return (
1010
<Layout style={{height: '100%'}}>
11-
<PageHeader theme={props.theme} title="Find" type='small' />
11+
<PageHeader theme={props.theme} title="Find" type='small' bottomBar={false} navigation={props.navigation}/>
1212
</Layout>
1313
)
1414
}

src/pages/Home/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const HomePageC = (props: any) => {
1010
return (
1111
<Layout style={{height: '100%'}}>
1212
<ScrollView>
13-
<PageHeader title="Home" theme={props.theme} type='large' />
13+
<PageHeader title="Home" theme={props.theme} type='large' navigation={props.navigation}/>
1414
<Layout style={{marginHorizontal: 20}}>
1515
<ViewShadow theme={props.theme} style={{marginTop: -20}}>
1616
<Layout style={{overflow: 'hidden', borderRadius: 20}}>

src/pages/Settings/index.tsx

Lines changed: 82 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
import React, {ReactNode} from 'react';
2-
import {Text, View, ScrollView} from 'react-native';
2+
import {Text, View, ScrollView, Image} from 'react-native';
33
import {Layout, List, ListItem} from '@ui-kitten/components';
44
import {connect} from 'react-redux';
55
import Modal, {
66
ModalContent,
77
ModalTitle,
88
SlideAnimation,
99
} from 'react-native-modals';
10+
import {iOSUIKit} from 'react-native-typography';
1011

1112
import {K} from '../../store/constants';
1213
import {PageHeader} from '../../components/Page/PageHeader';
1314
import {ViewShadow} from '../../components/Shadow/View';
1415

15-
const SettingsPageC = (props: any, {navigation}) => {
16+
const SettingsPageC = (props: any) => {
1617
const themeColor = props.theme === 'dark' ? K.color.dark : K.color.light;
1718

1819
const list1 = [
1920
{
2021
title: 'Change Theme',
21-
onPress: () => {props.navigation.navigate('Theme')},
22+
onPress: () => {
23+
props.navigation.navigate('Theme');
24+
},
2225
},
2326
{
2427
title: 'Privacy',
@@ -34,11 +37,64 @@ const SettingsPageC = (props: any, {navigation}) => {
3437
onPress: () => {
3538
props.toggleSettingsModal(true, [
3639
'About',
37-
<View>
38-
<Text style={{color: themeColor.primaryText}}>
39-
We are a team of developers based in Singapore aiming to help the
40-
community through what we do best.
41-
</Text>
40+
<View style={{height: '100%', justifyContent: 'space-between'}}>
41+
<View>
42+
<Text
43+
style={{
44+
...iOSUIKit.subheadEmphasizedObject,
45+
color: themeColor.secondaryText,
46+
letterSpacing: 2,
47+
marginTop: 10,
48+
marginBottom: 5,
49+
}}>
50+
US
51+
</Text>
52+
<Text style={{color: themeColor.primaryText}}>
53+
We are a team of developers based in Singapore, aiming to help
54+
the community through what we do best, and Elliot.
55+
</Text>
56+
<Text
57+
style={{
58+
...iOSUIKit.subheadEmphasizedObject,
59+
color: themeColor.secondaryText,
60+
letterSpacing: 2,
61+
marginTop: 15,
62+
marginBottom: 5,
63+
}}>
64+
APP
65+
</Text>
66+
<Text style={{color: themeColor.primaryText}}>
67+
This application was made for our school project, Project SF,
68+
for people who have dementia.
69+
</Text>
70+
</View>
71+
<View style={{marginBottom: 50}}>
72+
<Text
73+
style={{
74+
...iOSUIKit.subheadObject,
75+
color: themeColor.primaryText,
76+
marginBottom: -5,
77+
marginTop: 20,
78+
textAlign: 'center',
79+
width: '100%',
80+
}}>
81+
Made with ♡, {`\n`}
82+
Exponential Inc.
83+
</Text>
84+
<Image
85+
style={{
86+
width: 40,
87+
height: 40,
88+
marginVertical: 20,
89+
alignSelf: 'center',
90+
}}
91+
source={
92+
props.theme === 'dark'
93+
? require('../../../assets/images/company-icon-dark.png')
94+
: require('../../../assets/images/company-icon-light.png')
95+
}
96+
/>
97+
</View>
4298
</View>,
4399
]);
44100
},
@@ -70,7 +126,12 @@ const SettingsPageC = (props: any, {navigation}) => {
70126
return (
71127
<Layout style={{height: '100%', flex: 1}}>
72128
<ScrollView>
73-
<PageHeader title="Settings" theme={props.theme} type='large' />
129+
<PageHeader
130+
title="Settings"
131+
theme={props.theme}
132+
type="large"
133+
navigation={props.navigation}
134+
/>
74135
<Layout style={{marginHorizontal: 20}}>
75136
<ViewShadow theme={props.theme} style={{height: 100, marginTop: -20}}>
76137
<List
@@ -102,7 +163,10 @@ const SettingsPageC = (props: any, {navigation}) => {
102163
modalTitle={
103164
<ModalTitle
104165
title={props.settingsModalContent?.[0] ?? 'Blank'}
105-
style={{backgroundColor: themeColor.secondaryBG, borderBottomColor: themeColor.primaryBG}}
166+
style={{
167+
backgroundColor: themeColor.secondaryBG,
168+
borderBottomColor: themeColor.primaryBG,
169+
}}
106170
textStyle={{color: themeColor.primaryText}}
107171
/>
108172
}
@@ -121,13 +185,14 @@ const SettingsPageC = (props: any, {navigation}) => {
121185
props.toggleSettingsModal(false);
122186
}}>
123187
<ModalContent style={{paddingHorizontal: 0}}>
124-
<View style={{height: '100%', backgroundColor: themeColor.primaryBG, paddingHorizontal: 20, paddingTop: 15}}>
125-
{props.settingsModalContent?.[1] ?? (
126-
<Text style={{color: themeColor.primaryText}}>
127-
If you expected content here, an error might have occured.
128-
Please submit a bug report. Thanks!
129-
</Text>
130-
)}
188+
<View
189+
style={{
190+
height: '100%',
191+
backgroundColor: themeColor.primaryBG,
192+
paddingHorizontal: 20,
193+
paddingTop: 15,
194+
}}>
195+
{props.settingsModalContent?.[1] ?? null}
131196
</View>
132197
</ModalContent>
133198
</Modal>

src/pages/SettingsToggleTheme/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ const SettingsToggleThemePageC = (props: any) => {
3939
title={`${item.title}`}
4040
onPress={item.onPress}
4141
style={{height: 50, ...selectedStyle}}
42-
icon={() => item.selected ? <Icon name={'checkbox-marked-circle'} size={20} color={themeColor.contrast} style={{position: "absolute", right: 10, top: 15}} /> : <View style={{width: 0, marginHorizontal: 0, paddingHorizontal: 0}}/>}
42+
icon={() => item.selected ? <Icon name={'check'} size={20} color={themeColor.contrast} style={{position: "absolute", right: 10, top: 15}} /> : <View style={{width: 0, marginHorizontal: 0, paddingHorizontal: 0}}/>}
4343
/>
4444
);
4545
};
4646

4747
return (
4848
<Layout style={{height: '100%', flex: 1}}>
49-
<PageHeader title="Theme" theme={props.theme} type='small' />
49+
<PageHeader title="Theme" theme={props.theme} type='small' navigation={props.navigation} leadingButton='arrow-left'/>
5050
<Layout style={{marginHorizontal: 20}}>
5151
<ViewShadow theme={props.theme} style={{height: 150, marginTop: -20}}>
5252
<List

src/store/constants.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const K = {
55
secondaryBG: '#F8F8F8',
66
linkBG: '#6197FF',
77
primaryText: '#000F31',
8+
secondaryText: '#535A6C',
89
darkText: '#000F31',
910
lightText: '#FFFFFF',
1011
greyText: '#E9E9E9',
@@ -15,6 +16,7 @@ export const K = {
1516
secondaryBG: '#161E37',
1617
linkBG: '#051135',
1718
primaryText: '#FFFFFF',
19+
secondaryText: '#E5E5E5',
1820
darkText: '#000F31',
1921
lightText: '#FFFFFF',
2022
greyText: '#E9E9E9',

src/store/reducer.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
import React from 'react';
2-
import {Text} from 'react-native';
2+
import {Text, AsyncStorage} from 'react-native';
33
import { Appearance } from 'react-native-appearance';
44

5+
_retrieveData = async () => {
6+
try {
7+
const value = await AsyncStorage.getItem('TASKS');
8+
if (value !== null) {
9+
// We have data!!
10+
console.log(value);
11+
}
12+
} catch (error) {
13+
// Error retrieving data
14+
}
15+
};
16+
517
const initialState = {
618
orientation: 'portrait', //portrait/landscape
719
theme: 'light', //dark/light

0 commit comments

Comments
 (0)