Skip to content

Commit

Permalink
Merge pull request #1043 from 0x1-company/find-location
Browse files Browse the repository at this point in the history
feat: 🎸 find location
  • Loading branch information
tomokisun authored Dec 2, 2023
2 parents f9ef342 + 5713327 commit 9f0c539
Show file tree
Hide file tree
Showing 6 changed files with 224 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Packages/GodPackage/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ let package = Package(
.library(name: "CupertinoMessageFeature", targets: ["CupertinoMessageFeature"]),
.library(name: "DeleteAccountFeature", targets: ["DeleteAccountFeature"]),
.library(name: "EmailFeature", targets: ["EmailFeature"]),
.library(name: "FindLocationFeature", targets: ["FindLocationFeature"]),
.library(name: "ForceUpdateFeature", targets: ["ForceUpdateFeature"]),
.library(name: "FriendRequestFeature", targets: ["FriendRequestFeature"]),
.library(name: "GodFeature", targets: ["GodFeature"]),
Expand Down Expand Up @@ -131,6 +132,11 @@ let package = Package(
.product(name: "UIPasteboardClient", package: "CupertinoPackage"),
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
]),
.target(name: "FindLocationFeature", dependencies: [
.product(name: "Styleguide", package: "UIComponentPackage"),
.product(name: "AnalyticsClient", package: "DependencyPackage"),
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
]),
.target(name: "ForceUpdateFeature", dependencies: [
.product(name: "Constants", package: "DependencyPackage"),
.product(name: "Styleguide", package: "UIComponentPackage"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
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
}
}
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 Packages/GodPackage/Sources/FindLocationFeature/FindLocation.swift
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() }
)
)
}
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"
}

0 comments on commit 9f0c539

Please sign in to comment.