From fd7291f075d9f73b4586eb3133609aa8900d3dda Mon Sep 17 00:00:00 2001 From: MrSmart00 Date: Fri, 28 Jun 2024 12:55:17 +0900 Subject: [PATCH 1/9] Add KMPClient package's dependency with AboutFeature --- app-ios/Package.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app-ios/Package.swift b/app-ios/Package.swift index 0d86b5eb8..f93975bdc 100644 --- a/app-ios/Package.swift +++ b/app-ios/Package.swift @@ -153,7 +153,10 @@ let package = Package( ), .target( name: "StaffFeature", - dependencies: [ .tca ] + dependencies: [ + .tca, + .kmpClient + ] ), .testTarget( name: "StaffFeatureTests", @@ -212,6 +215,7 @@ extension Target.Dependency { static let sponsorFeature: Target.Dependency = "SponsorFeature" static let contributorFeature: Target.Dependency = "ContributorFeature" static let kmpModule: Target.Dependency = "KmpModule" + static let kmpClient: Target.Dependency = "KMPClient" static let theme: Target.Dependency = "Theme" static let firebaseAuth: Target.Dependency = .product(name: "FirebaseAuth", package: "firebase-ios-sdk") From a2e3712a3d2e452520b565d7f1981e42c6f47f81 Mon Sep 17 00:00:00 2001 From: MrSmart00 Date: Fri, 28 Jun 2024 12:56:07 +0900 Subject: [PATCH 2/9] wip --- app-ios/Sources/StaffFeature/StaffReducer.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app-ios/Sources/StaffFeature/StaffReducer.swift b/app-ios/Sources/StaffFeature/StaffReducer.swift index a479c6f50..991e34665 100644 --- a/app-ios/Sources/StaffFeature/StaffReducer.swift +++ b/app-ios/Sources/StaffFeature/StaffReducer.swift @@ -1,7 +1,12 @@ import ComposableArchitecture +import KMPClient +import Dependencies +import shared @Reducer public struct StaffReducer { + @Dependency(\.staffClient) var staffsData + public init() { } @ObservableState @@ -11,6 +16,7 @@ public struct StaffReducer { public enum Action { case onAppear + case response(Result<[Staff], any Error>) } public var body: some ReducerOf { @@ -18,6 +24,15 @@ public struct StaffReducer { switch action { case .onAppear: state.text = "Staff Feature" + return .run { send in + for try await staffs in try staffsData.streamStaffs() { + await send(.response(.success(staffs))) + } + } + case .response(.success(let staffs)): + print(staffs) + return .none + case .response(.failure(let error)): return .none } } From 58207c5c01e5fb5fc931879210c016c54ef819c0 Mon Sep 17 00:00:00 2001 From: MrSmart00 Date: Fri, 28 Jun 2024 15:08:24 +0900 Subject: [PATCH 3/9] Add StaffLabel from KMP datas --- app-ios/Package.swift | 3 +- app-ios/Sources/KMPClient/TestKey.swift | 9 ++++- app-ios/Sources/StaffFeature/StaffLabel.swift | 33 +++++++++++++++++++ .../Sources/StaffFeature/StaffReducer.swift | 21 ++++++++++-- app-ios/Sources/StaffFeature/StaffView.swift | 19 ++++++++--- app-ios/Sources/Theme/Typography.swift | 32 +++++++++--------- .../StaffFeatureTests/StaffFeatureTests.swift | 6 ++-- 7 files changed, 93 insertions(+), 30 deletions(-) create mode 100644 app-ios/Sources/StaffFeature/StaffLabel.swift diff --git a/app-ios/Package.swift b/app-ios/Package.swift index f93975bdc..118423306 100644 --- a/app-ios/Package.swift +++ b/app-ios/Package.swift @@ -155,7 +155,8 @@ let package = Package( name: "StaffFeature", dependencies: [ .tca, - .kmpClient + .kmpClient, + .theme ] ), .testTarget( diff --git a/app-ios/Sources/KMPClient/TestKey.swift b/app-ios/Sources/KMPClient/TestKey.swift index 8a2553afb..a97c67c2b 100644 --- a/app-ios/Sources/KMPClient/TestKey.swift +++ b/app-ios/Sources/KMPClient/TestKey.swift @@ -6,7 +6,14 @@ extension TimetableClient: TestDependencyKey { } extension StaffClient: TestDependencyKey { - public static let previewValue: Self = Self() + public static let previewValue: Self = .init { + .init { + [ + .init(id: 0, username: "Hoge", profileUrl: .init(), iconUrl: .init()), + + ] + } + } public static let testValue: Self = Self() } diff --git a/app-ios/Sources/StaffFeature/StaffLabel.swift b/app-ios/Sources/StaffFeature/StaffLabel.swift new file mode 100644 index 000000000..4f8659e50 --- /dev/null +++ b/app-ios/Sources/StaffFeature/StaffLabel.swift @@ -0,0 +1,33 @@ +import SwiftUI +import Theme + +struct StaffLabel: View { + let name: String + let icon: URL + + var body: some View { + HStack(alignment: .center) { + AsyncImage(url: icon) { image in + image.resizable() + } placeholder: { + Color.gray + } + .frame(width: 60, height: 60) + .scaledToFill() + .clipShape(RoundedRectangle(cornerRadius: 12)) + .overlay( + RoundedRectangle(cornerRadius: 12) + .stroke(AssetColors.Outline.outline.swiftUIColor, lineWidth: 1) + ) + Text(name) + .textStyle(TypographyTokens.bodyLarge) + .foregroundStyle(AssetColors.Surface.onSurface.swiftUIColor) + .lineLimit(2) + } + .frame(maxWidth: .infinity, alignment: .leading) + } +} + +#Preview { + StaffLabel(name: "hoge", icon: .init(string: "")!) +} diff --git a/app-ios/Sources/StaffFeature/StaffReducer.swift b/app-ios/Sources/StaffFeature/StaffReducer.swift index 991e34665..523bdcd6e 100644 --- a/app-ios/Sources/StaffFeature/StaffReducer.swift +++ b/app-ios/Sources/StaffFeature/StaffReducer.swift @@ -1,8 +1,16 @@ import ComposableArchitecture +import Foundation import KMPClient import Dependencies import shared +struct StaffData: Equatable, Identifiable { + let id: Int64 + let name: String + let icon: URL + let github: URL +} + @Reducer public struct StaffReducer { @Dependency(\.staffClient) var staffsData @@ -11,7 +19,8 @@ public struct StaffReducer { @ObservableState public struct State: Equatable { - var text: String + var list: [StaffData] = [] + public init() { } } public enum Action { @@ -23,14 +32,20 @@ public struct StaffReducer { Reduce { state, action in switch action { case .onAppear: - state.text = "Staff Feature" return .run { send in for try await staffs in try staffsData.streamStaffs() { await send(.response(.success(staffs))) } } case .response(.success(let staffs)): - print(staffs) + state.list = staffs.map { + StaffData( + id: $0.id, + name: $0.username, + icon: URL(string: $0.iconUrl)!, + github: URL(string: $0.profileUrl)! + ) + } return .none case .response(.failure(let error)): return .none diff --git a/app-ios/Sources/StaffFeature/StaffView.swift b/app-ios/Sources/StaffFeature/StaffView.swift index 3fea71d2e..db3db78ec 100644 --- a/app-ios/Sources/StaffFeature/StaffView.swift +++ b/app-ios/Sources/StaffFeature/StaffView.swift @@ -9,13 +9,22 @@ public struct StaffView: View { } public var body: some View { - Text(store.text) - .onAppear { - store.send(.onAppear) - } + List(store.list) { data in + Button(action: { + // TODO: present GitHub profile page + }, label: { + StaffLabel(name: data.name, icon: data.icon) + }) + .listRowSeparator(.hidden) + } + + .listStyle(PlainListStyle()) + .onAppear { + store.send(.onAppear) + } } } #Preview { - StaffView(store: .init(initialState: .init(text: "Hoge"), reducer: { StaffReducer() })) + StaffView(store: .init(initialState: .init(), reducer: { StaffReducer() })) } diff --git a/app-ios/Sources/Theme/Typography.swift b/app-ios/Sources/Theme/Typography.swift index 08005d51e..ab7601008 100644 --- a/app-ios/Sources/Theme/Typography.swift +++ b/app-ios/Sources/Theme/Typography.swift @@ -27,20 +27,20 @@ extension TextStyle { public static let labelSmall: TextStyle = TypographyTokens.labelSmall } -enum TypographyTokens { - static let displayLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 57), lineHeight: 64, letterSpacing: -0.25) - static let displayMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 45), lineHeight: 52) - static let displaySmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 36), lineHeight: 44) - static let headlineLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 32), lineHeight: 40) - static let headlineMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 28), lineHeight: 36 - 28) - static let headlineSmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 24), lineHeight: 32) - static let titleLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 22), lineHeight: 28) - static let titleMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 16), lineHeight: 24, letterSpacing: 0.15) - static let titleSmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 14), lineHeight: 20, letterSpacing: 0.1) - static let labelLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 14), lineHeight: 20, letterSpacing: 0.1) - static let labelMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 12), lineHeight: 16, letterSpacing: 0.5) - static let labelSmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 11), lineHeight: 16, letterSpacing: 0.5) - static let bodyLarge = TextStyle(font: FontAssets.Roboto.regular.font(size: 16), lineHeight: 24, letterSpacing: 0.5) - static let bodyMedium = TextStyle(font: FontAssets.Roboto.regular.font(size: 14), lineHeight: 20, letterSpacing: 0.25) - static let bodySmall = TextStyle(font: FontAssets.Roboto.regular.font(size: 12), lineHeight: 16, letterSpacing: 0.4) +public enum TypographyTokens { + public static let displayLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 57), lineHeight: 64, letterSpacing: -0.25) + public static let displayMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 45), lineHeight: 52) + public static let displaySmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 36), lineHeight: 44) + public static let headlineLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 32), lineHeight: 40) + public static let headlineMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 28), lineHeight: 36 - 28) + public static let headlineSmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 24), lineHeight: 32) + public static let titleLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 22), lineHeight: 28) + public static let titleMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 16), lineHeight: 24, letterSpacing: 0.15) + public static let titleSmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 14), lineHeight: 20, letterSpacing: 0.1) + public static let labelLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 14), lineHeight: 20, letterSpacing: 0.1) + public static let labelMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 12), lineHeight: 16, letterSpacing: 0.5) + public static let labelSmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 11), lineHeight: 16, letterSpacing: 0.5) + public static let bodyLarge = TextStyle(font: FontAssets.Roboto.regular.font(size: 16), lineHeight: 24, letterSpacing: 0.5) + public static let bodyMedium = TextStyle(font: FontAssets.Roboto.regular.font(size: 14), lineHeight: 20, letterSpacing: 0.25) + public static let bodySmall = TextStyle(font: FontAssets.Roboto.regular.font(size: 12), lineHeight: 16, letterSpacing: 0.4) } diff --git a/app-ios/Tests/StaffFeatureTests/StaffFeatureTests.swift b/app-ios/Tests/StaffFeatureTests/StaffFeatureTests.swift index c8d5caf9b..3a3cb2af3 100644 --- a/app-ios/Tests/StaffFeatureTests/StaffFeatureTests.swift +++ b/app-ios/Tests/StaffFeatureTests/StaffFeatureTests.swift @@ -6,12 +6,10 @@ final class StaffFeatureTests: XCTestCase { @MainActor func testExample() async throws { - let store = TestStore(initialState: StaffReducer.State(text: "HOGE")) { + let store = TestStore(initialState: StaffReducer.State()) { StaffReducer() } - await store.send(.onAppear) { - $0.text = "Staff Feature" - } +// await store.send(.onAppear) { } } } From b14de030034754d0e898c388fd06008c18bcf03a Mon Sep 17 00:00:00 2001 From: MrSmart00 Date: Fri, 28 Jun 2024 15:14:56 +0900 Subject: [PATCH 4/9] Add navigation title displaymode --- app-ios/Sources/StaffFeature/StaffView.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app-ios/Sources/StaffFeature/StaffView.swift b/app-ios/Sources/StaffFeature/StaffView.swift index db3db78ec..1f3d71736 100644 --- a/app-ios/Sources/StaffFeature/StaffView.swift +++ b/app-ios/Sources/StaffFeature/StaffView.swift @@ -17,11 +17,12 @@ public struct StaffView: View { }) .listRowSeparator(.hidden) } - .listStyle(PlainListStyle()) .onAppear { store.send(.onAppear) } + .navigationBarTitleDisplayMode(.large) + .navigationTitle("Staff") } } From 638645621dd298bdacc3b99b3d47f95a6c645e47 Mon Sep 17 00:00:00 2001 From: MrSmart00 Date: Fri, 28 Jun 2024 16:56:33 +0900 Subject: [PATCH 5/9] Update test data for Unit test --- app-ios/Sources/KMPClient/TestKey.swift | 12 +++++------- app-ios/Sources/StaffFeature/StaffReducer.swift | 4 ++++ .../Tests/StaffFeatureTests/StaffFeatureTests.swift | 5 ++++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app-ios/Sources/KMPClient/TestKey.swift b/app-ios/Sources/KMPClient/TestKey.swift index a97c67c2b..b38408eb5 100644 --- a/app-ios/Sources/KMPClient/TestKey.swift +++ b/app-ios/Sources/KMPClient/TestKey.swift @@ -6,15 +6,13 @@ extension TimetableClient: TestDependencyKey { } extension StaffClient: TestDependencyKey { - public static let previewValue: Self = .init { - .init { - [ - .init(id: 0, username: "Hoge", profileUrl: .init(), iconUrl: .init()), - - ] + public static let previewValue: Self = Self() + public static let testValue: Self = .init { + AsyncThrowingStream { + $0.yield([.init(id: 0, username: "testValue", profileUrl: "https://2024.droidkaigi.jp/", iconUrl: "https://avatars.githubusercontent.com/u/10727543?s=200&v=4"),]) + $0.finish() } } - public static let testValue: Self = Self() } extension SponsorsClient: TestDependencyKey { diff --git a/app-ios/Sources/StaffFeature/StaffReducer.swift b/app-ios/Sources/StaffFeature/StaffReducer.swift index 523bdcd6e..d26933ddd 100644 --- a/app-ios/Sources/StaffFeature/StaffReducer.swift +++ b/app-ios/Sources/StaffFeature/StaffReducer.swift @@ -30,6 +30,8 @@ public struct StaffReducer { public var body: some ReducerOf { Reduce { state, action in + enum CancelID { case connection } + switch action { case .onAppear: return .run { send in @@ -37,6 +39,7 @@ public struct StaffReducer { await send(.response(.success(staffs))) } } + .cancellable(id: CancelID.connection) case .response(.success(let staffs)): state.list = staffs.map { StaffData( @@ -48,6 +51,7 @@ public struct StaffReducer { } return .none case .response(.failure(let error)): + print(error) return .none } } diff --git a/app-ios/Tests/StaffFeatureTests/StaffFeatureTests.swift b/app-ios/Tests/StaffFeatureTests/StaffFeatureTests.swift index 3a3cb2af3..043293bae 100644 --- a/app-ios/Tests/StaffFeatureTests/StaffFeatureTests.swift +++ b/app-ios/Tests/StaffFeatureTests/StaffFeatureTests.swift @@ -9,7 +9,10 @@ final class StaffFeatureTests: XCTestCase { let store = TestStore(initialState: StaffReducer.State()) { StaffReducer() } -// await store.send(.onAppear) { } + await store.send(.onAppear) + await store.receive(\.response.success) { + $0.list = [.init(id: 0, name: "testValue", icon: .init(string: "https://avatars.githubusercontent.com/u/10727543?s=200&v=4")!, github: .init(string: "https://2024.droidkaigi.jp/")!)] + } } } From 902383f916adc11cbddc6ded9af497ed5bbef975 Mon Sep 17 00:00:00 2001 From: MrSmart00 Date: Fri, 28 Jun 2024 17:07:42 +0900 Subject: [PATCH 6/9] parameter tweaks --- app-ios/Sources/StaffFeature/StaffReducer.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app-ios/Sources/StaffFeature/StaffReducer.swift b/app-ios/Sources/StaffFeature/StaffReducer.swift index d26933ddd..87d6859dd 100644 --- a/app-ios/Sources/StaffFeature/StaffReducer.swift +++ b/app-ios/Sources/StaffFeature/StaffReducer.swift @@ -1,11 +1,10 @@ import ComposableArchitecture import Foundation import KMPClient -import Dependencies import shared struct StaffData: Equatable, Identifiable { - let id: Int64 + let id: Int let name: String let icon: URL let github: URL @@ -43,7 +42,7 @@ public struct StaffReducer { case .response(.success(let staffs)): state.list = staffs.map { StaffData( - id: $0.id, + id: Int($0.id), name: $0.username, icon: URL(string: $0.iconUrl)!, github: URL(string: $0.profileUrl)! From 916961dbb018cb647ea3443ceb9366dc31f2f432 Mon Sep 17 00:00:00 2001 From: MrSmart00 Date: Sat, 29 Jun 2024 00:09:13 +0900 Subject: [PATCH 7/9] replace List to ScrollView --- app-ios/Sources/StaffFeature/StaffView.swift | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app-ios/Sources/StaffFeature/StaffView.swift b/app-ios/Sources/StaffFeature/StaffView.swift index 1f3d71736..8c1efb527 100644 --- a/app-ios/Sources/StaffFeature/StaffView.swift +++ b/app-ios/Sources/StaffFeature/StaffView.swift @@ -9,15 +9,18 @@ public struct StaffView: View { } public var body: some View { - List(store.list) { data in - Button(action: { - // TODO: present GitHub profile page - }, label: { - StaffLabel(name: data.name, icon: data.icon) - }) - .listRowSeparator(.hidden) + ScrollView { + LazyVStack { + ForEach(store.list, id: \.id) { staff in + Button { + + } label: { + StaffLabel(name: staff.name, icon: staff.icon) + } + } + } + .padding(16) } - .listStyle(PlainListStyle()) .onAppear { store.send(.onAppear) } From 4c279b8f8e2dae29c7f71fae5734ee128f5179a9 Mon Sep 17 00:00:00 2001 From: MrSmart00 Date: Sat, 29 Jun 2024 23:23:56 +0900 Subject: [PATCH 8/9] Fix update layout --- app-ios/Sources/StaffFeature/StaffLabel.swift | 18 +++++------ app-ios/Sources/StaffFeature/StaffView.swift | 3 ++ app-ios/Sources/Theme/Typography.swift | 32 +++++++++---------- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/app-ios/Sources/StaffFeature/StaffLabel.swift b/app-ios/Sources/StaffFeature/StaffLabel.swift index 4f8659e50..88d9a0814 100644 --- a/app-ios/Sources/StaffFeature/StaffLabel.swift +++ b/app-ios/Sources/StaffFeature/StaffLabel.swift @@ -6,21 +6,19 @@ struct StaffLabel: View { let icon: URL var body: some View { - HStack(alignment: .center) { - AsyncImage(url: icon) { image in - image.resizable() - } placeholder: { - Color.gray + HStack(alignment: .center, spacing: 12) { + AsyncImage(url: icon) { + $0.image?.resizable() } - .frame(width: 60, height: 60) - .scaledToFill() - .clipShape(RoundedRectangle(cornerRadius: 12)) + .frame(width: 52, height: 52) + .clipShape(Circle()) .overlay( - RoundedRectangle(cornerRadius: 12) + Circle() .stroke(AssetColors.Outline.outline.swiftUIColor, lineWidth: 1) ) + Text(name) - .textStyle(TypographyTokens.bodyLarge) + .textStyle(.bodyLarge) .foregroundStyle(AssetColors.Surface.onSurface.swiftUIColor) .lineLimit(2) } diff --git a/app-ios/Sources/StaffFeature/StaffView.swift b/app-ios/Sources/StaffFeature/StaffView.swift index 8c1efb527..625ab8803 100644 --- a/app-ios/Sources/StaffFeature/StaffView.swift +++ b/app-ios/Sources/StaffFeature/StaffView.swift @@ -1,5 +1,6 @@ import ComposableArchitecture import SwiftUI +import Theme public struct StaffView: View { private let store: StoreOf @@ -17,10 +18,12 @@ public struct StaffView: View { } label: { StaffLabel(name: staff.name, icon: staff.icon) } + .padding(.vertical, 12) } } .padding(16) } + .background(AssetColors.Surface.surface.swiftUIColor) .onAppear { store.send(.onAppear) } diff --git a/app-ios/Sources/Theme/Typography.swift b/app-ios/Sources/Theme/Typography.swift index ab7601008..08005d51e 100644 --- a/app-ios/Sources/Theme/Typography.swift +++ b/app-ios/Sources/Theme/Typography.swift @@ -27,20 +27,20 @@ extension TextStyle { public static let labelSmall: TextStyle = TypographyTokens.labelSmall } -public enum TypographyTokens { - public static let displayLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 57), lineHeight: 64, letterSpacing: -0.25) - public static let displayMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 45), lineHeight: 52) - public static let displaySmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 36), lineHeight: 44) - public static let headlineLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 32), lineHeight: 40) - public static let headlineMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 28), lineHeight: 36 - 28) - public static let headlineSmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 24), lineHeight: 32) - public static let titleLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 22), lineHeight: 28) - public static let titleMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 16), lineHeight: 24, letterSpacing: 0.15) - public static let titleSmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 14), lineHeight: 20, letterSpacing: 0.1) - public static let labelLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 14), lineHeight: 20, letterSpacing: 0.1) - public static let labelMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 12), lineHeight: 16, letterSpacing: 0.5) - public static let labelSmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 11), lineHeight: 16, letterSpacing: 0.5) - public static let bodyLarge = TextStyle(font: FontAssets.Roboto.regular.font(size: 16), lineHeight: 24, letterSpacing: 0.5) - public static let bodyMedium = TextStyle(font: FontAssets.Roboto.regular.font(size: 14), lineHeight: 20, letterSpacing: 0.25) - public static let bodySmall = TextStyle(font: FontAssets.Roboto.regular.font(size: 12), lineHeight: 16, letterSpacing: 0.4) +enum TypographyTokens { + static let displayLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 57), lineHeight: 64, letterSpacing: -0.25) + static let displayMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 45), lineHeight: 52) + static let displaySmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 36), lineHeight: 44) + static let headlineLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 32), lineHeight: 40) + static let headlineMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 28), lineHeight: 36 - 28) + static let headlineSmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 24), lineHeight: 32) + static let titleLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 22), lineHeight: 28) + static let titleMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 16), lineHeight: 24, letterSpacing: 0.15) + static let titleSmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 14), lineHeight: 20, letterSpacing: 0.1) + static let labelLarge = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 14), lineHeight: 20, letterSpacing: 0.1) + static let labelMedium = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 12), lineHeight: 16, letterSpacing: 0.5) + static let labelSmall = TextStyle(font: FontAssets.DotGothic16.regular.font(size: 11), lineHeight: 16, letterSpacing: 0.5) + static let bodyLarge = TextStyle(font: FontAssets.Roboto.regular.font(size: 16), lineHeight: 24, letterSpacing: 0.5) + static let bodyMedium = TextStyle(font: FontAssets.Roboto.regular.font(size: 14), lineHeight: 20, letterSpacing: 0.25) + static let bodySmall = TextStyle(font: FontAssets.Roboto.regular.font(size: 12), lineHeight: 16, letterSpacing: 0.4) } From 3218a8ebc051d85ad3fc04bcf40b2ca26a4805ae Mon Sep 17 00:00:00 2001 From: MrSmart00 Date: Sat, 29 Jun 2024 23:29:18 +0900 Subject: [PATCH 9/9] Add localized string --- .../Sources/StaffFeature/Localizable.xcstrings | 16 ++++++++++++++++ app-ios/Sources/StaffFeature/StaffView.swift | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 app-ios/Sources/StaffFeature/Localizable.xcstrings diff --git a/app-ios/Sources/StaffFeature/Localizable.xcstrings b/app-ios/Sources/StaffFeature/Localizable.xcstrings new file mode 100644 index 000000000..13bbd663f --- /dev/null +++ b/app-ios/Sources/StaffFeature/Localizable.xcstrings @@ -0,0 +1,16 @@ +{ + "sourceLanguage" : "en", + "strings" : { + "Staff" : { + "localizations" : { + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "スタッフ" + } + } + } + } + }, + "version" : "1.0" +} \ No newline at end of file diff --git a/app-ios/Sources/StaffFeature/StaffView.swift b/app-ios/Sources/StaffFeature/StaffView.swift index 625ab8803..0f8d62b82 100644 --- a/app-ios/Sources/StaffFeature/StaffView.swift +++ b/app-ios/Sources/StaffFeature/StaffView.swift @@ -28,7 +28,7 @@ public struct StaffView: View { store.send(.onAppear) } .navigationBarTitleDisplayMode(.large) - .navigationTitle("Staff") + .navigationTitle(String(localized: "Staff", bundle: .module)) } }