-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1043 from 0x1-company/find-location
feat: 🎸 find location
- Loading branch information
Showing
6 changed files
with
224 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
Packages/GodPackage/Sources/FindLocationFeature/Assets.xcassets/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...s/GodPackage/Sources/FindLocationFeature/Assets.xcassets/world-map.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "world-map.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
91 changes: 91 additions & 0 deletions
91
...ge/Sources/FindLocationFeature/Assets.xcassets/world-map.imageset/world-map.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 94 additions & 0 deletions
94
Packages/GodPackage/Sources/FindLocationFeature/FindLocation.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import AnalyticsClient | ||
import ComposableArchitecture | ||
import Styleguide | ||
import SwiftUI | ||
|
||
@Reducer | ||
public struct FindLocationLogic { | ||
public init() {} | ||
|
||
public struct State: Equatable { | ||
public init() {} | ||
} | ||
|
||
public enum Action: Equatable { | ||
case onTask | ||
case onAppear | ||
} | ||
|
||
@Dependency(\.analytics) var analytics | ||
|
||
public var body: some Reducer<State, Action> { | ||
Reduce<State, Action> { _, action in | ||
switch action { | ||
case .onTask: | ||
return .none | ||
|
||
case .onAppear: | ||
analytics.logScreen(screenName: "FindLocation", of: self) | ||
return .none | ||
} | ||
} | ||
} | ||
} | ||
|
||
public struct FindLocationView: View { | ||
let store: StoreOf<FindLocationLogic> | ||
|
||
public init(store: StoreOf<FindLocationLogic>) { | ||
self.store = store | ||
} | ||
|
||
public var body: some View { | ||
VStack(spacing: 0) { | ||
Spacer() | ||
|
||
VStack(spacing: 28) { | ||
Text("Connect your school to find friends", bundle: .module) | ||
.font(.system(.body, design: .rounded, weight: .bold)) | ||
|
||
Button { | ||
|
||
} label: { | ||
HStack(spacing: 12) { | ||
Image(ImageResource.worldMap) | ||
.resizable() | ||
.aspectRatio(1, contentMode: .fit) | ||
.frame(width: 24, height: 24) | ||
|
||
Text("Find My School") | ||
} | ||
.font(.system(.body, design: .rounded, weight: .bold)) | ||
.frame(height: 54) | ||
.frame(maxWidth: .infinity) | ||
.foregroundStyle(Color.black) | ||
.background(Color.white) | ||
.clipShape(Capsule()) | ||
} | ||
.padding(.horizontal, 32) | ||
} | ||
|
||
Spacer() | ||
|
||
HStack(spacing: 0) { | ||
Image(systemName: "lock") | ||
|
||
Text("God cares intensely about your privacy.\nLocation is only used to find nearby schools.", bundle: .module) | ||
.multilineTextAlignment(.leading) | ||
} | ||
.foregroundStyle(Color.white) | ||
} | ||
.background(Color.godService) | ||
.task { store.send(.onTask) } | ||
.onAppear { store.send(.onAppear) } | ||
} | ||
} | ||
|
||
#Preview { | ||
FindLocationView( | ||
store: .init( | ||
initialState: FindLocationLogic.State(), | ||
reducer: { FindLocationLogic() } | ||
) | ||
) | ||
} |
15 changes: 15 additions & 0 deletions
15
Packages/GodPackage/Sources/FindLocationFeature/Localizable.xcstrings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"sourceLanguage" : "en", | ||
"strings" : { | ||
"Connect your school to find friends" : { | ||
|
||
}, | ||
"Find My School" : { | ||
|
||
}, | ||
"God cares intensely about your privacy.\nLocation is only used to find nearby schools." : { | ||
|
||
} | ||
}, | ||
"version" : "1.0" | ||
} |