Skip to content

Commit 8f6868b

Browse files
committed
updated Select feature list screen
1 parent b35ee96 commit 8f6868b

File tree

3 files changed

+80
-33
lines changed

3 files changed

+80
-33
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" : "0xA8",
9+
"green" : "0x4B",
10+
"red" : "0xD7"
11+
}
12+
},
13+
"idiom" : "universal"
14+
}
15+
],
16+
"info" : {
17+
"author" : "xcode",
18+
"version" : 1
19+
}
20+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ internal enum Asset {
3333
internal static let accentLavender = ColorAsset(name: "Accent Lavender")
3434
internal static let accentPink = ColorAsset(name: "Accent Pink")
3535
internal static let d5DBE6BorderColorGray = ColorAsset(name: "D5DBE6 Border Color gray")
36+
internal static let d74BA827Pink = ColorAsset(name: "D74BA827 Pink")
3637
internal static let ddddddLine = ColorAsset(name: "DDDDDD line")
3738
internal static let e5E5E5GrayBackgroudn = ColorAsset(name: "E5E5E5 Gray backgroudn")
3839
internal static let e7E3EELightPurpuleBg = ColorAsset(name: "E7E3EE Light Purpule bg")

GoInfoGame/GoInfoGame/UI/Map/AddFeatureView.swift

Lines changed: 59 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ struct FeatureDetail : Identifiable{
1616
}
1717

1818
struct AddFeatureView: View {
19+
@Environment(\.presentationMode) var presentationMode
1920
@State var tappedCoordinate: CLLocationCoordinate2D
2021
@Binding var isPresented: Bool
2122
@State private var selectedFeature: FeatureDetail? = nil
@@ -38,70 +39,95 @@ struct AddFeatureView: View {
3839

3940
var body: some View {
4041
ZStack {
41-
VStack {
42+
VStack(alignment: .leading) {
4243

43-
Text("Select a feature to add")
44-
.padding([.top], 15)
44+
HStack {
45+
Text("Select a feature to add")
46+
.font(FontFamily.Lato.bold.swiftUIFont(fixedSize: 18))
47+
.foregroundStyle(Asset.Colors._42526ETextFieldText.swiftUIColor)
48+
.padding()
49+
50+
Spacer()
51+
52+
Button {
53+
presentationMode.wrappedValue.dismiss()
54+
} label: {
55+
Image(systemName: "xmark.circle")
56+
.font(FontFamily.Lato.bold.swiftUIFont(size: 24))
57+
.foregroundStyle(Asset.Colors._83879BTextFiledTitle.swiftUIColor)
58+
.padding()
59+
}
60+
61+
}
4562

4663
ScrollView {
4764
VStack {
4865
ForEach(featureDetails, id: \.id) { feature in
4966
Button(action: {
5067
selectedFeature = feature
5168
}) {
52-
HStack {
69+
HStack(spacing: 5) {
5370
VStack(alignment: .leading) {
5471
Text(feature.name)
5572
.frame(maxWidth: .infinity, alignment: .leading)
56-
.foregroundColor(.primary)
57-
.font(.custom("Lato-Medium", size: 15)) // Adjust size as needed
73+
.foregroundColor(Asset.Colors._42526ETextFieldText.swiftUIColor)
74+
.font(FontFamily.Lato.bold.swiftUIFont(size: 16))
5875

5976
Text(feature.description)
6077
.frame(maxWidth: .infinity, alignment: .leading)
61-
.foregroundColor(Color.gray)
62-
.font(.custom("Lato-Regular", size: 12))
78+
.foregroundColor(Asset.Colors._83879BTextFiledTitle.swiftUIColor)
79+
.font(FontFamily.Lato.regular.swiftUIFont(size: 12))
6380
.multilineTextAlignment(.leading)
6481
}
6582

6683
if selectedFeature?.name == feature.name {
6784
Image(systemName: "checkmark.circle.fill")
68-
.foregroundColor(.blue)
85+
.foregroundColor(Asset.Colors.d74BA827Pink.swiftUIColor)
86+
} else {
87+
Image(systemName: "circle")
88+
.foregroundColor(Asset.Colors._83879BTextFiledTitle.swiftUIColor)
6989
}
7090
}
71-
.padding([.bottom, .leading, .trailing], 10)
72-
.padding([.bottom,.top], 4)
73-
.background(selectedFeature?.name == feature.name ? Color.blue.opacity(0.2) : Color.clear)
74-
.cornerRadius(10)
91+
.padding()
92+
.background(selectedFeature?.name == feature.name ? Asset.Colors.d74BA827Pink.swiftUIColor.opacity(0.1) : Color.clear)
93+
.border(Asset.Colors.ddddddLine.swiftUIColor, width: 1)
94+
.cornerRadius(5)
7595
}
7696
}
7797
}
98+
.padding()
7899
}
79100

80101
Spacer()
81102

82-
Button(action: {
83-
Task {
84-
do {
85-
await addFeature()
86-
} catch {
87-
print("Error adding feature: \(error)")
103+
HStack {
104+
Spacer()
105+
Button(action: {
106+
Task {
107+
do {
108+
await addFeature()
109+
} catch {
110+
print("Error adding feature: \(error)")
111+
}
112+
}
113+
}) {
114+
if isLoading {
115+
ProgressView()
116+
} else {
117+
Text("Add feature")
118+
.font(FontFamily.Lato.bold.swiftUIFont(size: 20))
119+
.foregroundColor(.white)
120+
.padding()
121+
.frame(width: 155, height: 46)
122+
.background(selectedFeature?.name != nil ? Asset.Colors.huskyPurple.swiftUIColor : Color.gray)
123+
.cornerRadius(20)
88124
}
89125
}
90-
}) {
91-
if isLoading {
92-
ProgressView()
93-
} else {
94-
Text("Add feature")
95-
.font(.custom("Lato-Bold", size: 16))
96-
.foregroundColor(.white)
97-
.padding()
98-
.frame(width: 200, height: 40)
99-
.background(selectedFeature?.name != nil ? Asset.Colors.huskyPurple.swiftUIColor : Color.gray)
100-
.cornerRadius(20)
101-
}
126+
.disabled(selectedFeature?.name == nil)
127+
.padding()
128+
129+
Spacer()
102130
}
103-
.disabled(selectedFeature?.name == nil)
104-
.padding()
105131
}
106132
}
107133
}

0 commit comments

Comments
 (0)