@@ -12,25 +12,110 @@ struct SettingsScreen: View {
1212 @ObservedObject var model : AppViewModel
1313
1414 var body : some View {
15- List {
16- HStack {
17- Circle ( )
18- . fill ( model. authState == AuthState . loggedIn ? Color . green : Color . red)
19- . frame ( width: 6 )
20- Text ( model. authState == AuthState . loggedIn ? " Logout " : " Login " )
15+ ScrollView {
16+ LazyVStack ( spacing: 8 ) {
2117 Spacer ( )
22- Image ( systemName: " message.fill " )
23- . font ( . system( size: 12 ) )
24- . foregroundStyle ( model. authState == AuthState . loggedIn ? Color . blue : Color . gray)
25- Image ( systemName: " arrow.up " )
26- . font ( . system( size: 12 ) )
27- . foregroundStyle ( model. authState == AuthState . loggedIn ? Color . green : Color . gray)
18+ . frame ( height: 68 )
19+ VStack ( alignment: . leading, spacing: 4 ) {
20+ Text ( " Profile " )
21+ . font ( . custom( " IBMPlexSans-Medium " , size: 12 ) )
22+ LoginRow ( loggedIn: model. authState == AuthState . loggedIn) {
23+ model. gotoLogin ( )
24+ }
25+ }
26+
27+ VStack ( alignment: . leading, spacing: 4 ) {
28+ Text ( " About " )
29+ . font ( . custom( " IBMPlexSans-Medium " , size: 12 ) )
30+ SettingsRow (
31+ text: " Follow Emerge " ,
32+ leadingIcon: {
33+ Image ( systemName: " bird.fill " )
34+ . font ( . system( size: 12 ) )
35+ . foregroundStyle ( . blue)
36+ } ,
37+ trailingIcon: {
38+ Image ( systemName: " arrow.up.right " )
39+ . font ( . system( size: 12 ) )
40+ . foregroundStyle ( . onBackground)
41+
42+ } ,
43+ action: {
44+ model. openLink ( url: URL ( string: " https://www.twitter.com/emergetools " ) !)
45+
46+ }
47+ )
48+
49+ SettingsRow (
50+ text: " Follow Supergooey " ,
51+ leadingIcon: {
52+ Image ( systemName: " bird.fill " )
53+ . font ( . system( size: 12 ) )
54+ . foregroundStyle ( . blue)
55+ } ,
56+ trailingIcon: {
57+ Image ( systemName: " arrow.up.right " )
58+ . font ( . system( size: 12 ) )
59+ . foregroundStyle ( . onBackground)
60+
61+ } ,
62+ action: {
63+ model. openLink ( url: URL ( string: " https://www.twitter.com/heyrikin " ) !)
64+ }
65+ )
66+
67+ SettingsRow (
68+ text: " Send Feedback " ,
69+ leadingIcon: {
70+ Image ( systemName: " exclamationmark.triangle.fill " )
71+ . font ( . system( size: 12 ) )
72+ . foregroundStyle ( . yellow)
73+ } ,
74+ trailingIcon: {
75+ Image ( systemName: " arrow.up.right " )
76+ . font ( . system( size: 12 ) )
77+ . foregroundStyle ( . onBackground)
78+
79+ } ,
80+ action: {
81+ model. openLink ( url: URL ( string: " https://forms.gle/YYno9sUehE5xuKAq9 " ) !)
82+ }
83+ )
84+
85+ SettingsRow (
86+ text: " Privacy Policy " ,
87+ leadingIcon: {
88+ Image ( systemName: " lock.fill " )
89+ . font ( . system( size: 12 ) )
90+ . foregroundStyle ( . hnRed)
91+ } ,
92+ trailingIcon: {
93+ Image ( systemName: " arrow.up.right " )
94+ . font ( . system( size: 12 ) )
95+ . foregroundStyle ( . onBackground)
96+
97+ } ,
98+ action: {
99+ model. openLink ( url: URL ( string: " https://www.emergetools.com/HackerNewsPrivacyPolicy.html " ) ! )
100+ }
101+ )
102+ }
28103 }
29- . onTapGesture {
30- model. gotoLogin ( )
104+ . padding ( . horizontal, 8 )
105+ }
106+ . overlay {
107+ ZStack ( alignment: . leading) {
108+ Color . clear
109+ . background ( . ultraThinMaterial)
110+ . containerShape ( . rect( cornerRadius: 24 , style: . continuous) )
111+
112+ Text ( " Settings " )
113+ . font ( . custom( " IBMPlexMono-Bold " , size: 24 ) )
114+ . padding ( . horizontal, 16 )
31115 }
116+ . frame ( height: 60 )
117+ . frame ( maxHeight: . infinity, alignment: . top)
32118 }
33- . navigationTitle ( " Settings " )
34119 }
35120}
36121
0 commit comments