@@ -34,6 +34,7 @@ import {
34
34
TouchableOpacity ,
35
35
View ,
36
36
useColorScheme ,
37
+ ViewStyle ,
37
38
} from "react-native" ;
38
39
import { Text } from "@/design-system/Text" ;
39
40
import { useSafeAreaInsets } from "react-native-safe-area-context" ;
@@ -56,7 +57,7 @@ import {
56
57
useWalletStore ,
57
58
} from "@/data/store/accountsStore" ;
58
59
import { useAccountsProfiles } from "@/utils/useAccountsProfiles" ;
59
- import { useAppTheme } from "@/theme/useAppTheme" ;
60
+ import { ThemedStyle , useAppTheme } from "@/theme/useAppTheme" ;
60
61
import { navigate } from "@/utils/navigation" ;
61
62
62
63
import ActivityIndicator from "@components/ActivityIndicator/ActivityIndicator" ;
@@ -101,41 +102,9 @@ import { Gesture, GestureDetector } from "react-native-gesture-handler";
101
102
import { VStack } from "@/design-system/VStack" ;
102
103
import { Button } from "@/design-system/Button/Button" ;
103
104
104
- const useStyles = ( ) => {
105
- const colorScheme = useColorScheme ( ) ;
106
- return StyleSheet . create ( {
107
- title : {
108
- textAlign : "center" ,
109
- fontSize : 34 ,
110
- fontWeight : "bold" ,
111
- marginVertical : 10 ,
112
- color : textPrimaryColor ( colorScheme ) ,
113
- } ,
114
- tableView : { } ,
115
- avatar : {
116
- marginBottom : 10 ,
117
- marginTop : 23 ,
118
- alignSelf : "center" ,
119
- } ,
120
- emoji : {
121
- backgroundColor : "rgba(118, 118, 128, 0.12)" ,
122
- borderRadius : 30 ,
123
- } ,
124
- errorText : {
125
- color : dangerColor ( colorScheme ) ,
126
- textAlign : "center" ,
127
- } ,
128
- errorContainer : {
129
- flexDirection : "row" ,
130
- alignSelf : "center" ,
131
- } ,
132
- errorIcon : {
133
- width : PictoSizes . textButton ,
134
- height : PictoSizes . textButton ,
135
- marginRight : 5 ,
136
- } ,
137
- } ) ;
138
- } ;
105
+ const $sectionContainer : ThemedStyle < ViewStyle > = ( { spacing } ) => ( {
106
+ marginBottom : spacing . lg ,
107
+ } ) ;
139
108
140
109
export default function ProfileScreen ( ) {
141
110
return (
@@ -194,10 +163,15 @@ const ContactCard = memo(function ContactCard({
194
163
backgroundColor : theme . colors . fill . primary ,
195
164
borderRadius : theme . borderRadius . xs ,
196
165
padding : theme . spacing . xl ,
197
- marginVertical : theme . spacing . md ,
166
+ marginTop : theme . spacing . xs ,
167
+ marginBottom : theme . spacing . lg ,
198
168
shadowColor : theme . colors . fill . primary ,
199
169
shadowOpacity : 0.25 ,
200
- shadowRadius : 24 ,
170
+ shadowRadius : 12 ,
171
+ shadowOffset : {
172
+ width : 0 ,
173
+ height : 6 , // Positive value pushes shadow down
174
+ } ,
201
175
elevation : 5 ,
202
176
} ;
203
177
@@ -276,7 +250,7 @@ const ContactCard = memo(function ContactCard({
276
250
} ) ;
277
251
278
252
function ProfileScreenImpl ( ) {
279
- const { theme } = useAppTheme ( ) ;
253
+ const { theme, themed } = useAppTheme ( ) ;
280
254
const router = useRouter ( ) ;
281
255
const account = useCurrentAccount ( ) ;
282
256
const accounts = useAccountsList ( ) ;
@@ -288,7 +262,6 @@ function ProfileScreenImpl() {
288
262
const preferredUserName = usePreferredName ( peerAddress ) ;
289
263
const setPeersStatus = useSettingsStore ( ( s ) => s . setPeersStatus ) ;
290
264
const colorScheme = useColorScheme ( ) ;
291
- const styles = useStyles ( ) ;
292
265
293
266
useHeader (
294
267
{
@@ -512,7 +485,7 @@ function ProfileScreenImpl() {
512
485
leftView : imageURI ? (
513
486
< TableViewImage imageURI = { getIPFSAssetURI ( imageURI ) } />
514
487
) : (
515
- < TableViewEmoji emoji = "👋" style = { styles . emoji } />
488
+ < TableViewEmoji emoji = "👋" />
516
489
) ,
517
490
rightView : (
518
491
< TableViewPicto
@@ -523,7 +496,7 @@ function ProfileScreenImpl() {
523
496
} ;
524
497
} ) as TableViewItemType [ ] ;
525
498
} ,
526
- [ colorScheme , styles . emoji ]
499
+ [ colorScheme ]
527
500
) ;
528
501
529
502
const socialItems = [
@@ -869,7 +842,8 @@ function ProfileScreenImpl() {
869
842
{ ! isMyProfile && ! isBlockedPeer && (
870
843
< ContactCard
871
844
name = { preferredUserName }
872
- bio = "Soccer dad and physical therapist"
845
+ // TODO: implement bio from the profile from Convos backend/local db
846
+ // bio="Soccer dad and physical therapist"
873
847
avatarUri = { preferredAvatarUri }
874
848
/>
875
849
) }
@@ -885,14 +859,31 @@ function ProfileScreenImpl() {
885
859
/>
886
860
887
861
{ isMyProfile && shouldShowError && (
888
- < View style = { styles . errorContainer } >
862
+ < View
863
+ style = { {
864
+ flexDirection : "row" ,
865
+ alignItems : "center" ,
866
+ justifyContent : "center" ,
867
+ marginBottom : theme . spacing . lg ,
868
+ } }
869
+ >
889
870
< Icon
890
871
icon = "exclamationmark.triangle"
891
872
color = { dangerColor ( colorScheme ) }
892
873
size = { PictoSizes . textButton }
893
- style = { styles . errorIcon }
874
+ style = { {
875
+ width : theme . iconSize . sm ,
876
+ height : theme . iconSize . sm ,
877
+ } }
894
878
/>
895
- < Text style = { styles . errorText } > { translate ( "client_error" ) } </ Text >
879
+ < Text
880
+ style = { {
881
+ color : dangerColor ( colorScheme ) ,
882
+ marginLeft : theme . spacing . xxs ,
883
+ } }
884
+ >
885
+ { translate ( "client_error" ) }
886
+ </ Text >
896
887
</ View >
897
888
) }
898
889
@@ -918,22 +909,22 @@ function ProfileScreenImpl() {
918
909
} ,
919
910
] }
920
911
title = { translate ( "youre_the_og" ) }
921
- style = { styles . tableView }
912
+ style = { themed ( $sectionContainer ) }
922
913
/>
923
914
) }
924
915
925
916
{ usernamesItems . length > 0 && (
926
917
< TableView
927
918
items = { usernamesItems }
928
919
title = { `USERNAME${ usernamesItems . length > 1 ? "S" : "" } ` }
929
- style = { styles . tableView }
920
+ style = { themed ( $sectionContainer ) }
930
921
/>
931
922
) }
932
923
933
924
< TableView
934
925
items = { addressItems }
935
926
title = { translate ( "address" ) }
936
- style = { styles . tableView }
927
+ style = { themed ( $sectionContainer ) }
937
928
/>
938
929
939
930
{ route . params ?. fromGroupTopic && ! isMyProfile && (
@@ -953,15 +944,15 @@ function ProfileScreenImpl() {
953
944
} ,
954
945
} ,
955
946
] }
956
- style = { styles . tableView }
947
+ style = { themed ( $sectionContainer ) }
957
948
/>
958
949
) }
959
950
960
951
{ socialItems . length > 0 && (
961
952
< TableView
962
953
items = { socialItems }
963
954
title = { translate ( "social" ) }
964
- style = { styles . tableView }
955
+ style = { themed ( $sectionContainer ) }
965
956
/>
966
957
) }
967
958
{ ! isMyProfile && (
@@ -975,13 +966,13 @@ function ProfileScreenImpl() {
975
966
leftView : < TableViewImage imageURI = { t . image } /> ,
976
967
} ) ) }
977
968
title = { translate ( "common_activity" ) }
978
- style = { styles . tableView }
969
+ style = { themed ( $sectionContainer ) }
979
970
/>
980
971
) }
981
972
< TableView
982
973
items = { actionsTableViewItems }
983
974
title = { translate ( "actions" ) }
984
- style = { styles . tableView }
975
+ style = { themed ( $sectionContainer ) }
985
976
/>
986
977
</ >
987
978
) }
@@ -1111,7 +1102,7 @@ function ProfileScreenImpl() {
1111
1102
! ( notificationsPermissionStatus === "granted" )
1112
1103
) }
1113
1104
title = { translate ( "actions" ) }
1114
- style = { styles . tableView }
1105
+ style = { themed ( $sectionContainer ) }
1115
1106
/>
1116
1107
1117
1108
< TableView
@@ -1122,7 +1113,7 @@ function ProfileScreenImpl() {
1122
1113
} ,
1123
1114
] }
1124
1115
title = { translate ( "app_version" ) }
1125
- style = { styles . tableView }
1116
+ style = { themed ( $sectionContainer ) }
1126
1117
/>
1127
1118
</ >
1128
1119
) }
0 commit comments