Skip to content

Commit 62b9204

Browse files
committed
Merge pull request #37 from daostack/user-profile-improvements
CM-123 User profile improvements
1 parent b896bcd commit 62b9204

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1888
-215
lines changed

packages/common/App.js

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
*/
88

99
import React, {useState, useEffect} from 'react';
10-
import {Image} from 'react-native';
10+
import {Image, StyleSheet} from 'react-native';
1111
import {ApolloProvider} from 'react-apollo';
1212
import {NavigationContainer} from '@react-navigation/native';
1313
import {createStackNavigator} from '@react-navigation/stack';
1414
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
15-
import {colors} from './src/Theme';
15+
import {colors, text} from './src/Theme';
1616
import AsyncStorage from '@react-native-community/async-storage';
1717

1818
import {
@@ -26,6 +26,7 @@ import {
2626
CreateAccount,
2727
CompleteAccount,
2828
EditProfile,
29+
UserProfileReadMode,
2930
NativeBridgeTests,
3031
} from './src/Screens';
3132
import {ApolloClientConfig as client} from './src/Config';
@@ -38,6 +39,7 @@ const Stack = createStackNavigator();
3839
import {filterObjectByKeys} from './src/Util';
3940
import {userInfoFields} from './src/Stores/UserStore';
4041
import {observer, inject} from 'mobx-react';
42+
import Icon from './src/Assets/iconfont/Icon';
4143

4244
const CommonHome = () => {
4345
return (
@@ -91,6 +93,7 @@ const CommonHome = () => {
9193
<Tab.Screen name="My feed" component={UserProfile} />
9294
<Tab.Screen name="Explore" component={CommonsList} />
9395
<Tab.Screen name="Profile" component={UserProfile} />
96+
<Tab.Screen name="UserProfileReadMode" component={UserProfileReadMode} />
9497
</Tab.Navigator>
9598
);
9699
};
@@ -177,22 +180,60 @@ const App = ({userStore}) => {
177180
</NavigationContainer>
178181
*/}
179182
<NavigationContainer>
180-
<Stack.Navigator>
183+
<Stack.Navigator
184+
screenOptions={{
185+
headerStyle: styles.headerStyle,
186+
headerTitleStyle: styles.headerTitleStyle,
187+
headerTintColor: colors.black,
188+
headerBackTitleVisible: false,
189+
headerBackImage: () => <Icon name="left-arrow" size={32} />,
190+
}}>
181191
<Stack.Screen
182192
name="CommonHome"
183193
component={CommonHome}
184194
options={{headerShown: false}}
185195
/>
186196
<Stack.Screen name="Profile" component={UserProfile} />
187-
<Stack.Screen name="EditProfile" component={EditProfile} />
197+
<Stack.Screen
198+
options={{
199+
title: 'Edit my profile',
200+
}}
201+
name="EditProfile"
202+
component={EditProfile}
203+
/>
188204
<Stack.Screen name="CompleteAccount" component={CompleteAccount} />
189205
<Stack.Screen name="CreateAccount" component={CreateAccount} />
190-
<Stack.Screen name="MyWallet" component={MyWallet} />
206+
<Stack.Screen
207+
options={{
208+
title: 'My wallet',
209+
}}
210+
name="MyWallet"
211+
component={MyWallet}
212+
/>
191213
<Stack.Screen name="HUDTest" component={HUDTest} />
214+
<Stack.Screen
215+
name="UserProfileReadMode"
216+
component={UserProfileReadMode}
217+
/>
192218
</Stack.Navigator>
193219
</NavigationContainer>
194220
</ApolloProvider>
195221
);
196222
};
197223

224+
const styles = StyleSheet.create({
225+
headerStyle: {
226+
borderWidth: 0,
227+
borderBottomWidth: 0,
228+
shadowRadius: 0,
229+
shadowOffset: {
230+
height: 0,
231+
},
232+
},
233+
234+
headerTitleStyle: {
235+
...text.h4Black,
236+
},
237+
});
238+
198239
export default inject('userStore')(observer(App));

packages/common/iconfont.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"symbol_url": "http://at.alicdn.com/t/font_1704341_x3cvyngts8.js",
2+
"symbol_url": "http://at.alicdn.com/t/font_1704341_59qxjs4i588.js",
33
"use_typescript": false,
44
"save_dir": "./src/Assets/iconfont",
55
"trim_icon_prefix": "icon",

packages/common/src/Assets/iconfont/Icon.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ViewProps } from 'react-native';
66
import { GProps } from 'react-native-svg';
77

88
interface Props extends GProps, ViewProps {
9-
name: 'approved-' | 'declined-' | 'close' | 'account-selected' | 'commons-selected' | 'check-' | 'edit-' | 'follow' | 'feed-selected' | 'follow-' | 'following-' | 'group' | 'following' | 'menu' | 'report-' | 'picture' | 'pencil' | 'save' | 'verification' | 'wallet' | 'left-arrow' | 'common' | 'right-arrow' | 'left-arrow-16' | 'account-place-holder' | 'feed' | 'google' | 'account';
9+
name: 'group1' | 'alert' | 'wallet1' | 'account-place-holder2' | 'save1' | 'agenda' | 'dao-general-info' | 'funds' | 'style' | 'account-place-holder1' | 'approved' | 'declined' | 'close' | 'account-selected' | 'commons-selected' | 'check' | 'edit' | 'follow' | 'feed-selected' | 'group' | 'following' | 'menu' | 'report' | 'picture' | 'pencil' | 'save' | 'verification' | 'wallet' | 'left-arrow' | 'common' | 'right-arrow' | 'account-place-holder' | 'feed' | 'google' | 'account';
1010
size?: number;
1111
color?: string | string[];
1212
}

packages/common/src/Assets/iconfont/Icon.js

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,25 @@
22

33
import React from 'react';
44

5+
import Icongroup1 from './Icongroup1';
6+
import Iconalert from './Iconalert';
7+
import Iconwallet1 from './Iconwallet1';
8+
import IconaccountPlaceHolder2 from './IconaccountPlaceHolder2';
9+
import Iconsave1 from './Iconsave1';
10+
import Iconagenda from './Iconagenda';
11+
import IcondaoGeneralInfo from './IcondaoGeneralInfo';
12+
import Iconfunds from './Iconfunds';
13+
import Iconstyle from './Iconstyle';
14+
import IconaccountPlaceHolder1 from './IconaccountPlaceHolder1';
515
import Iconapproved from './Iconapproved';
616
import Icondeclined from './Icondeclined';
717
import Iconclose from './Iconclose';
818
import IconaccountSelected from './IconaccountSelected';
919
import IconcommonsSelected from './IconcommonsSelected';
1020
import Iconcheck from './Iconcheck';
1121
import Iconedit from './Iconedit';
12-
import IconfeedSelected from './IconfeedSelected';
1322
import Iconfollow from './Iconfollow';
23+
import IconfeedSelected from './IconfeedSelected';
1424
import Icongroup from './Icongroup';
1525
import Iconfollowing from './Iconfollowing';
1626
import Iconmenu from './Iconmenu';
@@ -23,43 +33,58 @@ import Iconwallet from './Iconwallet';
2333
import IconleftArrow from './IconleftArrow';
2434
import Iconcommon from './Iconcommon';
2535
import IconrightArrow from './IconrightArrow';
26-
import IconleftArrow16 from './IconleftArrow16';
2736
import IconaccountPlaceHolder from './IconaccountPlaceHolder';
2837
import Iconfeed from './Iconfeed';
2938
import Icongoogle from './Icongoogle';
3039
import Iconaccount from './Iconaccount';
3140

3241
export const Icon = ({ name, ...rest }) => {
3342
switch (name) {
34-
case 'approved-':
43+
case 'group1':
44+
return <Icongroup1 {...rest} />;
45+
case 'alert':
46+
return <Iconalert {...rest} />;
47+
case 'wallet1':
48+
return <Iconwallet1 {...rest} />;
49+
case 'account-place-holder2':
50+
return <IconaccountPlaceHolder2 {...rest} />;
51+
case 'save1':
52+
return <Iconsave1 {...rest} />;
53+
case 'agenda':
54+
return <Iconagenda {...rest} />;
55+
case 'dao-general-info':
56+
return <IcondaoGeneralInfo {...rest} />;
57+
case 'funds':
58+
return <Iconfunds {...rest} />;
59+
case 'style':
60+
return <Iconstyle {...rest} />;
61+
case 'account-place-holder1':
62+
return <IconaccountPlaceHolder1 {...rest} />;
63+
case 'approved':
3564
return <Iconapproved {...rest} />;
36-
case 'declined-':
65+
case 'declined':
3766
return <Icondeclined {...rest} />;
3867
case 'close':
3968
return <Iconclose {...rest} />;
4069
case 'account-selected':
4170
return <IconaccountSelected {...rest} />;
4271
case 'commons-selected':
4372
return <IconcommonsSelected {...rest} />;
44-
case 'check-':
73+
case 'check':
4574
return <Iconcheck {...rest} />;
46-
case 'edit-':
75+
case 'edit':
4776
return <Iconedit {...rest} />;
4877
case 'follow':
4978
return <Iconfollow {...rest} />;
5079
case 'feed-selected':
5180
return <IconfeedSelected {...rest} />;
52-
case 'follow-':
53-
return <Iconfollow {...rest} />;
54-
case 'following-':
55-
return <Iconfollowing {...rest} />;
5681
case 'group':
5782
return <Icongroup {...rest} />;
5883
case 'following':
5984
return <Iconfollowing {...rest} />;
6085
case 'menu':
6186
return <Iconmenu {...rest} />;
62-
case 'report-':
87+
case 'report':
6388
return <Iconreport {...rest} />;
6489
case 'picture':
6590
return <Iconpicture {...rest} />;
@@ -77,8 +102,6 @@ export const Icon = ({ name, ...rest }) => {
77102
return <Iconcommon {...rest} />;
78103
case 'right-arrow':
79104
return <IconrightArrow {...rest} />;
80-
case 'left-arrow-16':
81-
return <IconleftArrow16 {...rest} />;
82105
case 'account-place-holder':
83106
return <IconaccountPlaceHolder {...rest} />;
84107
case 'feed':
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* eslint-disable */
2+
3+
import { FunctionComponent } from 'react';
4+
// Don't forget to install package: @types/react-native
5+
import { ViewProps } from 'react-native';
6+
import { GProps } from 'react-native-svg';
7+
8+
interface Props extends GProps, ViewProps {
9+
size?: number;
10+
color?: string | string[];
11+
}
12+
13+
export declare const IconaccountPlaceHolder1: FunctionComponent<Props>;
14+
15+
export default IconaccountPlaceHolder1;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* eslint-disable */
2+
3+
import React from 'react';
4+
import { Svg, Path } from 'react-native-svg';
5+
import { getIconColor } from './helper';
6+
7+
export const IconaccountPlaceHolder1 = ({ size, color, ...rest }) => {
8+
return (
9+
<Svg viewBox="0 0 1024 1024" width={size} height={size} {...rest}>
10+
<Path
11+
d="M650.8416 677.9904c-1.7728-1.76-227.7056 25.6384-227.7056 25.6384-34.5536 23.7952-64 56.5312-81.184 91.3728v0.0128c-5.824 9.792-9.1776 23.2-9.1776 39.5968v157.4592l54.9888 31.744a237.152 237.152 0 0 0 184.48 22.4384A208.128 208.128 0 0 0 696.96 946.2656v-157.4592c0-39.424-19.3664-84-46.112-110.816z"
12+
fill={getIconColor(color, 0, '#CAECFE')}
13+
/>
14+
<Path
15+
d="M512.1024 734.08v0.0128l-48.768-27.9936a165.824 165.824 0 0 1-40.192-32.5312v44.608l12.7104 3.84a488.1792 488.1792 0 0 0 86.4256 17.7664 78.4384 78.4384 0 0 1-10.176-5.696z"
16+
fill={getIconColor(color, 1, '#FDE8F7')}
17+
/>
18+
<Path
19+
d="M592.3584 508.0704a139.8912 139.8912 0 0 1-58.816 66.432l-8.1472 4.7104a135.8464 135.8464 0 0 1-81.5872 17.504c-10.3488-5.9776-23.2704 1.4912-23.2704 13.4336 0 13.9008 7.424 26.752 19.456 33.7088l3.8144 2.2016-20.6592 27.52a165.6896 165.6896 0 0 0 40.1856 32.512l48.768 28v-0.0128c22.4512 15.0208 52.736 18.112 79.4496 2.688a164.064 164.064 0 0 0 82.0352-142.0928V493.6512l-29.248 16.8832a48.1408 48.1408 0 0 1-51.9808-2.464z"
20+
fill={getIconColor(color, 2, '#FFF6FC')}
21+
/>
22+
<Path
23+
d="M691.8656 456.3072a115.168 115.168 0 0 0-79.3664-85.12l-6.6944-1.9968c-1.8496-0.6656-3.712-1.2928-5.6064-1.8496a204.224 204.224 0 0 0-7.2-1.984l-0.0832-0.0192c-69.824-17.9456-163.3792-4.8896-209.9392 84.9152-65.8368 126.9952 40.16 223.3344 40.16 223.3344l20.672-27.5264-3.808-2.1952a38.9312 38.9312 0 0 1-19.4624-33.7088c0-11.9424 12.928-19.4112 23.2704-13.44 28.352 2.88 56.896-3.2448 81.5872-17.4976l8.1536-4.7104a139.9104 139.9104 0 0 0 58.8096-66.432 48.16 48.16 0 0 0 51.9872 2.464l29.248-16.8832v-0.4096l3.5456-2.176a32.4096 32.4096 0 0 0 14.7264-34.752z"
24+
fill={getIconColor(color, 3, '#40C7E0')}
25+
/>
26+
</Svg>
27+
);
28+
};
29+
30+
IconaccountPlaceHolder1.defaultProps = {
31+
size: 18,
32+
};
33+
34+
export default IconaccountPlaceHolder1;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* eslint-disable */
2+
3+
import { FunctionComponent } from 'react';
4+
// Don't forget to install package: @types/react-native
5+
import { ViewProps } from 'react-native';
6+
import { GProps } from 'react-native-svg';
7+
8+
interface Props extends GProps, ViewProps {
9+
size?: number;
10+
color?: string | string[];
11+
}
12+
13+
export declare const IconaccountPlaceHolder2: FunctionComponent<Props>;
14+
15+
export default IconaccountPlaceHolder2;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* eslint-disable */
2+
3+
import React from 'react';
4+
import { Svg, Path } from 'react-native-svg';
5+
import { getIconColor } from './helper';
6+
7+
export const IconaccountPlaceHolder2 = ({ size, color, ...rest }) => {
8+
return (
9+
<Svg viewBox="0 0 1024 1024" width={size} height={size} {...rest}>
10+
<Path
11+
d="M650.8416 677.9904c-1.7728-1.76-227.7056 25.6384-227.7056 25.6384-34.5536 23.7952-64 56.5312-81.184 91.3728v0.0128c-5.824 9.792-9.1776 23.2-9.1776 39.5968v157.4592l54.9888 31.744a237.152 237.152 0 0 0 184.48 22.4384A208.128 208.128 0 0 0 696.96 946.2656v-157.4592c0-39.424-19.3664-84-46.112-110.816z"
12+
fill={getIconColor(color, 0, '#CAECFE')}
13+
/>
14+
<Path
15+
d="M512.1024 734.08v0.0128l-48.768-27.9936a165.824 165.824 0 0 1-40.192-32.5312v44.608l12.7104 3.84a488.1792 488.1792 0 0 0 86.4256 17.7664 78.4384 78.4384 0 0 1-10.176-5.696z"
16+
fill={getIconColor(color, 1, '#FDE8F7')}
17+
/>
18+
<Path
19+
d="M592.3584 508.0704a139.8912 139.8912 0 0 1-58.816 66.432l-8.1472 4.7104a135.8464 135.8464 0 0 1-81.5872 17.504c-10.3488-5.9776-23.2704 1.4912-23.2704 13.4336 0 13.9008 7.424 26.752 19.456 33.7088l3.8144 2.2016-20.6592 27.52a165.6896 165.6896 0 0 0 40.1856 32.512l48.768 28v-0.0128c22.4512 15.0208 52.736 18.112 79.4496 2.688a164.064 164.064 0 0 0 82.0352-142.0928V493.6512l-29.248 16.8832a48.1408 48.1408 0 0 1-51.9808-2.464z"
20+
fill={getIconColor(color, 2, '#FFF6FC')}
21+
/>
22+
<Path
23+
d="M691.8656 456.3072a115.168 115.168 0 0 0-79.3664-85.12l-6.6944-1.9968c-1.8496-0.6656-3.712-1.2928-5.6064-1.8496a204.224 204.224 0 0 0-7.2-1.984l-0.0832-0.0192c-69.824-17.9456-163.3792-4.8896-209.9392 84.9152-65.8368 126.9952 40.16 223.3344 40.16 223.3344l20.672-27.5264-3.808-2.1952a38.9312 38.9312 0 0 1-19.4624-33.7088c0-11.9424 12.928-19.4112 23.2704-13.44 28.352 2.88 56.896-3.2448 81.5872-17.4976l8.1536-4.7104a139.9104 139.9104 0 0 0 58.8096-66.432 48.16 48.16 0 0 0 51.9872 2.464l29.248-16.8832v-0.4096l3.5456-2.176a32.4096 32.4096 0 0 0 14.7264-34.752z"
24+
fill={getIconColor(color, 3, '#40C7E0')}
25+
/>
26+
</Svg>
27+
);
28+
};
29+
30+
IconaccountPlaceHolder2.defaultProps = {
31+
size: 18,
32+
};
33+
34+
export default IconaccountPlaceHolder2;

packages/common/src/Assets/iconfont/IconleftArrow16.d.ts renamed to packages/common/src/Assets/iconfont/Iconagenda.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ interface Props extends GProps, ViewProps {
1010
color?: string | string[];
1111
}
1212

13-
export declare const IconleftArrow16: FunctionComponent<Props>;
13+
export declare const Iconagenda: FunctionComponent<Props>;
1414

15-
export default IconleftArrow16;
15+
export default Iconagenda;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* eslint-disable */
2+
3+
import React from 'react';
4+
import { Svg, Path } from 'react-native-svg';
5+
import { getIconColor } from './helper';
6+
7+
export const Iconagenda = ({ size, color, ...rest }) => {
8+
return (
9+
<Svg viewBox="0 0 1024 1024" width={size} height={size} {...rest}>
10+
<Path
11+
d="M855.637333 682.88h-58.325333V212.096A126.037333 126.037333 0 0 0 671.573333 85.333333H162.218667c-2.261333 0-4.48 0-6.741334 1.152-69.546667 7.893333-118.912 70.144-112.213333 140.330667 6.741333 58.837333 52.736 106.368 112.213333 113.152 2.261333 0 4.48 1.152 6.741334 1.152h6.741333v471.936C170.069333 882.090667 226.133333 938.666667 294.613333 938.666667h561.066667A126.037333 126.037333 0 0 0 981.333333 811.946667a125.866667 125.866667 0 0 0-125.696-129.066667zM194.389333 254.762667C157.354667 254.762667 128 226.730667 128 191.402667 128 156.032 157.354667 128 194.389333 128H640a133.888 133.888 0 0 0 0 128H194.389333v-1.237333zM682.666667 725.333333H256v-85.333333h426.666667v85.333333z m0-128H256v-85.333333h426.666667v85.333333z m0-128H256V384h426.666667v85.333333z m174.08 399.146667c-32.512 0-58.325333-26.026667-58.325334-58.837333v-58.88h58.368c32.512 0 58.325333 26.026667 58.325334 58.88 0 32.853333-25.813333 58.88-58.325334 58.88z"
12+
fill={getIconColor(color, 0, '#3CC7E1')}
13+
/>
14+
</Svg>
15+
);
16+
};
17+
18+
Iconagenda.defaultProps = {
19+
size: 18,
20+
};
21+
22+
export default Iconagenda;

0 commit comments

Comments
 (0)