Skip to content

Commit a729f03

Browse files
committed
Updated profile screen with new design and feedback
1 parent 6358567 commit a729f03

File tree

9 files changed

+193
-41
lines changed

9 files changed

+193
-41
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0x69",
9+
"green" : "0x03",
10+
"red" : "0x2D"
11+
}
12+
},
13+
"idiom" : "universal"
14+
}
15+
],
16+
"info" : {
17+
"author" : "xcode",
18+
"version" : 1
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0xDE",
9+
"green" : "0x57",
10+
"red" : "0x8F"
11+
}
12+
},
13+
"idiom" : "universal"
14+
}
15+
],
16+
"info" : {
17+
"author" : "xcode",
18+
"version" : 1
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0xDD",
9+
"green" : "0xDD",
10+
"red" : "0xDD"
11+
}
12+
},
13+
"idiom" : "universal"
14+
}
15+
],
16+
"info" : {
17+
"author" : "xcode",
18+
"version" : 1
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0xF5",
9+
"green" : "0xF5",
10+
"red" : "0xF5"
11+
}
12+
},
13+
"idiom" : "universal"
14+
}
15+
],
16+
"info" : {
17+
"author" : "xcode",
18+
"version" : 1
19+
}
20+
}

GoInfoGame/GoInfoGame/Helpers/Generated/Strings+Generated.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ internal enum L10n {
1717
internal static let cantSay = L10n.tr("Localizable", "cant_say", fallback: "Can't Say")
1818
/// Don't show again for this session
1919
internal static let dontShowAgain = L10n.tr("Localizable", "dont_show_again", fallback: "Don't show again for this session")
20+
/// My Profile
21+
internal static let myProfile = L10n.tr("Localizable", "My Profile", fallback: "My Profile")
2022
/// OTHER ANSWERS...
2123
internal static let otherAnswers = L10n.tr("Localizable", "other_answers", fallback: "OTHER ANSWERS...")
24+
/// Preferences
25+
internal static let preferences = L10n.tr("Localizable", "Preferences", fallback: "Preferences")
2226
/// Are there one or more street lamps within 10 feet of this Bus stop?
2327
internal static let questBusStopLitTitle = L10n.tr("Localizable", "quest_busStopLit_title", fallback: "Are there one or more street lamps within 10 feet of this Bus stop?")
2428
/// What’s the height of the curbs at this crossing?

GoInfoGame/GoInfoGame/Helpers/Generated/XCAssets+Generated.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@ internal typealias AssetImageTypeAlias = ImageAsset.Image
2626
internal enum Asset {
2727
internal static let accentColor = ColorAsset(name: "AccentColor")
2828
internal enum Colors {
29+
internal static let _2D0369ProfileIcon = ColorAsset(name: "2D0369 Profile icon")
2930
internal static let _42526ETextFieldText = ColorAsset(name: "42526E Text field text")
3031
internal static let _83879BTextFiledTitle = ColorAsset(name: "83879B Text filed title")
32+
internal static let _8F57DEProfileIcon = ColorAsset(name: "8F57DE Profile icon ")
3133
internal static let accentLavender = ColorAsset(name: "Accent Lavender")
3234
internal static let accentPink = ColorAsset(name: "Accent Pink")
3335
internal static let d5DBE6BorderColorGray = ColorAsset(name: "D5DBE6 Border Color gray")
36+
internal static let ddddddLine = ColorAsset(name: "DDDDDD line")
3437
internal static let e5E5E5GrayBackgroudn = ColorAsset(name: "E5E5E5 Gray backgroudn")
3538
internal static let e7E3EELightPurpuleBg = ColorAsset(name: "E7E3EE Light Purpule bg")
39+
internal static let f5F5F5LightGrayBackground = ColorAsset(name: "F5F5F5 light gray background")
3640
internal static let huskyGold = ColorAsset(name: "Husky Gold")
3741
internal static let huskyPurple = ColorAsset(name: "Husky Purple")
3842
internal static let theme = ColorAsset(name: "theme")

GoInfoGame/GoInfoGame/Login/BiometricToggleView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ struct BiometricToggleView: View {
2929
}
3030
)) {
3131
Text(biometricToggleText)
32+
.font(FontFamily.Lato.regular.swiftUIFont(size: 16))
33+
.foregroundStyle(Asset.Colors._42526ETextFieldText.swiftUIColor)
3234
}
3335
.tint(Asset.Colors.accentPink.swiftUIColor)
3436
}

GoInfoGame/GoInfoGame/UserProfile/View/UserProfileView.swift

Lines changed: 101 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import SwiftUI
99
import LocalAuthentication
1010

1111
struct UserProfileView: View {
12+
@Environment(\.dismiss) var dismiss
1213

1314
@StateObject private var viewModel = UserProfileViewModel()
1415

@@ -21,42 +22,82 @@ struct UserProfileView: View {
2122
var body: some View {
2223
Group {
2324
ZStack {
25+
Asset.Colors.f5F5F5LightGrayBackground.swiftUIColor
2426
VStack {
25-
Text("My Profile")
26-
.font(.custom("Lato-Bold", size: 25))
27-
.padding(.bottom, 50)
28-
.foregroundStyle(Asset.Colors.huskyPurple.swiftUIColor)
29-
HStack(alignment: .center, spacing: 16) {
30-
profileImage
27+
ZStack {
28+
Asset.Colors.e7E3EELightPurpuleBg.swiftUIColor
29+
.edgesIgnoringSafeArea(.top)
30+
.padding(.top, 0)
3131

32-
VStack(alignment: .leading, spacing: 4) {
33-
Text(userFullName())
34-
.font(.custom("Lato-Bold", size: 20))
35-
Text(viewModel.user?.email ?? "")
36-
.font(.custom("Lato-Regular", size: 18))
32+
VStack(alignment: .center, spacing: 16) {
33+
profileImage
34+
35+
VStack(alignment: .center, spacing: 6) {
36+
Text(userFullName())
37+
.font(FontFamily.Lato.bold.swiftUIFont(fixedSize: 20))
38+
Text(viewModel.user?.email ?? " ")
39+
.font(FontFamily.Lato.regular.swiftUIFont(fixedSize: 16))
40+
}
41+
.foregroundStyle(Asset.Colors._42526ETextFieldText.swiftUIColor)
3742
}
38-
39-
Spacer()
4043
}
41-
.padding([.bottom], 200)
44+
.frame(height: 200)
4245

43-
if BiometricAuthManager.canEvaluateBiometrics() {
44-
BiometricToggleView(isEnabled: $useBiometricID) {status in
45-
if status {
46-
showPasswordAuthenticationView = true
47-
} else {
48-
SessionManager.shared.logout(environment: APIConfiguration.shared.environment, clearBiometricCreds: true)
46+
ZStack {
47+
Color.white
48+
VStack(alignment: .leading, spacing: 25) {
49+
Text(L10n.Localizable.preferences.uppercased())
50+
.font(FontFamily.Lato.bold.swiftUIFont(size: 14))
51+
.foregroundStyle(Asset.Colors._83879BTextFiledTitle.swiftUIColor)
52+
53+
if BiometricAuthManager.canEvaluateBiometrics() {
54+
BiometricToggleView(isEnabled: $useBiometricID) {status in
55+
if status {
56+
showPasswordAuthenticationView = true
57+
} else {
58+
SessionManager.shared.logout(environment: APIConfiguration.shared.environment, clearBiometricCreds: true)
59+
}
60+
}
61+
}
62+
63+
Line()
64+
.stroke(style: .init(dash: [4]))
65+
.foregroundStyle(Asset.Colors.ddddddLine.swiftUIColor)
66+
.frame(height: 1)
67+
68+
HStack {
69+
Spacer()
70+
logOutButton
71+
Spacer()
4972
}
73+
74+
Spacer()
5075
}
51-
.padding([.bottom], 30)
52-
}
53-
54-
logOutButton
76+
.padding()
77+
}
78+
.padding()
79+
.padding(.bottom, 0)
80+
.cornerRadius(20)
81+
.clipped()
82+
}
83+
.navigationBarBackButtonHidden()
84+
.toolbar {
85+
ToolbarItem(placement: .navigationBarLeading) {
86+
Button(action: {
87+
dismiss()
88+
}) {
89+
Image(systemName: "arrow.left")
90+
.resizable()
91+
.foregroundStyle(Asset.Colors.huskyPurple.swiftUIColor)
92+
}
93+
}
5594

56-
Spacer()
95+
ToolbarItem(placement: .principal) {
96+
Text(L10n.Localizable.myProfile)
97+
.font(FontFamily.Lato.bold.swiftUIFont(size: 16))
98+
.foregroundStyle(Asset.Colors._42526ETextFieldText.swiftUIColor)
99+
}
57100
}
58-
.padding(20)
59-
.navigationBarTitleDisplayMode(.inline)
60101
}
61102
.overlay {
62103
if showPasswordAuthenticationView {
@@ -68,10 +109,7 @@ struct UserProfileView: View {
68109
showPasswordAuthenticationView = false
69110
} onFailure: { error in
70111
useBiometricID = false
71-
72-
73112
}
74-
75113
}
76114
}
77115
}
@@ -85,15 +123,23 @@ struct UserProfileView: View {
85123
if let userModel = viewModel.user {
86124
return userModel.getFullName()
87125
}
88-
return ""
126+
return " "
89127

90128
}
91129

92130
private var profileImage: some View {
93-
Image(systemName: "person.fill")
94-
.resizable()
95-
.frame(width: 50, height: 50)
96-
.clipShape(Circle())
131+
ZStack {
132+
Image(systemName: "person.fill")
133+
.resizable()
134+
.frame(width: 50, height: 50)
135+
.foregroundStyle(.white)
136+
.clipShape(Circle())
137+
}
138+
.frame(width: 60, height: 60)
139+
.background{
140+
LinearGradient(gradient: Gradient(colors: [Asset.Colors._8F57DEProfileIcon.swiftUIColor, Asset.Colors._2D0369ProfileIcon.swiftUIColor,]), startPoint: .top, endPoint: .bottom)
141+
}
142+
.clipShape(Circle())
97143
}
98144

99145

@@ -106,16 +152,30 @@ struct UserProfileView: View {
106152
}
107153
// accessToken = nil
108154
} label: {
109-
Text("LOGOUT")
110-
.font(.custom("Lato-Bold", size: 15))
111-
.foregroundColor(Color.white)
112-
.padding()
113-
.background(Color(red: 0.79, green: 0.0, blue: 0.0))
114-
.cornerRadius(25)
155+
HStack(spacing: 10) {
156+
Image(systemName: "rectangle.portrait.and.arrow.right")
157+
.foregroundStyle(.white)
158+
Text("Logout")
159+
.font(FontFamily.Lato.bold.swiftUIFont(fixedSize: 16))
160+
.foregroundColor(Color.white)
161+
162+
}
163+
.padding()
164+
.background(Asset.Colors.accentPink.swiftUIColor)
165+
.cornerRadius(25)
115166
}
116167
}
117168
}
118169

170+
struct Line: Shape {
171+
func path(in rect: CGRect) -> Path {
172+
var path = Path()
173+
path.move(to: CGPoint(x: 0, y: 0))
174+
path.addLine(to: CGPoint(x: rect.width, y: 0))
175+
return path
176+
}
177+
}
178+
119179
#Preview {
120180
UserProfileView()
121181
}

GoInfoGame/GoInfoGame/en.lproj/Localizable.strings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,5 @@
104104

105105
// AVIV
106106
"App Name" = "AVIV ScoutRoute";
107+
"Preferences" = "Preferences";
108+
"My Profile" = "My Profile";

0 commit comments

Comments
 (0)