diff --git a/Packages/GodPackage/Package.swift b/Packages/GodPackage/Package.swift index db90ab9e..c5bf93fe 100644 --- a/Packages/GodPackage/Package.swift +++ b/Packages/GodPackage/Package.swift @@ -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"]), @@ -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"), diff --git a/Packages/GodPackage/Sources/FindLocationFeature/Assets.xcassets/Contents.json b/Packages/GodPackage/Sources/FindLocationFeature/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/Packages/GodPackage/Sources/FindLocationFeature/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Packages/GodPackage/Sources/FindLocationFeature/Assets.xcassets/world-map.imageset/Contents.json b/Packages/GodPackage/Sources/FindLocationFeature/Assets.xcassets/world-map.imageset/Contents.json new file mode 100644 index 00000000..e9fb9365 --- /dev/null +++ b/Packages/GodPackage/Sources/FindLocationFeature/Assets.xcassets/world-map.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "world-map.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Packages/GodPackage/Sources/FindLocationFeature/Assets.xcassets/world-map.imageset/world-map.svg b/Packages/GodPackage/Sources/FindLocationFeature/Assets.xcassets/world-map.imageset/world-map.svg new file mode 100644 index 00000000..d84be525 --- /dev/null +++ b/Packages/GodPackage/Sources/FindLocationFeature/Assets.xcassets/world-map.imageset/world-map.svg @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Packages/GodPackage/Sources/FindLocationFeature/FindLocation.swift b/Packages/GodPackage/Sources/FindLocationFeature/FindLocation.swift new file mode 100644 index 00000000..b017b4bb --- /dev/null +++ b/Packages/GodPackage/Sources/FindLocationFeature/FindLocation.swift @@ -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 { + Reduce { _, 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 + + public init(store: StoreOf) { + 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() } + ) + ) +} diff --git a/Packages/GodPackage/Sources/FindLocationFeature/Localizable.xcstrings b/Packages/GodPackage/Sources/FindLocationFeature/Localizable.xcstrings new file mode 100644 index 00000000..eb70af6c --- /dev/null +++ b/Packages/GodPackage/Sources/FindLocationFeature/Localizable.xcstrings @@ -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" +} \ No newline at end of file