diff --git a/Application/App/Project.swift b/Application/App/Project.swift index bdca564b..c75bcec4 100644 --- a/Application/App/Project.swift +++ b/Application/App/Project.swift @@ -20,6 +20,7 @@ let project = Project( sources: ["Sources/**/*.swift"], resources: [ "Sources/Resource/Assets.xcassets", + "../Presentation/PresentationShared/Resources/Assets.xcassets", "Sources/Resource/GoogleService-Info.plist", "Sources/Resource/Localizable.xcstrings", ], diff --git a/Application/App/Sources/Resource/Localizable.xcstrings b/Application/App/Sources/Resource/Localizable.xcstrings index bab80bd9..99ce4437 100644 --- a/Application/App/Sources/Resource/Localizable.xcstrings +++ b/Application/App/Sources/Resource/Localizable.xcstrings @@ -641,6 +641,40 @@ } } }, + "login_intro_description" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "needs_review", + "value" : "Set goals and manage implementation records and todos in one place." + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "목표를 세우고 구현 기록과 Todo를 한곳에서 관리하세요." + } + } + } + }, + "login_intro_title" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Document Your Development Journey" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "개발 과정을 기록하세요" + } + } + } + }, "login_terms_notice" : { "extractionState" : "manual", "localizations" : { @@ -1644,104 +1678,104 @@ } } }, - "search_instruction" : { + "search_hash_guide_message" : { "extractionState" : "manual", "localizations" : { "en" : { "stringUnit" : { "state" : "translated", - "value" : "Enter a search term to find your saved content." + "value" : "Type like #123 to find that Todo directly." } }, "ko" : { "stringUnit" : { "state" : "translated", - "value" : "검색어를 입력해 저장한 앱 컨텐츠를 찾아보세요." + "value" : "#123처럼 입력하면 해당 Todo를 바로 찾을 수 있습니다." } } } }, - "search_prompt" : { + "search_hash_guide_title" : { "extractionState" : "manual", "localizations" : { "en" : { "stringUnit" : { "state" : "translated", - "value" : "Search (e.g. #123)" + "value" : "Enter a Todo number" } }, "ko" : { "stringUnit" : { "state" : "translated", - "value" : "검색 (예: #123)" + "value" : "Todo 번호를 입력해주세요" } } } }, - "search_recent" : { + "search_instruction" : { "extractionState" : "manual", "localizations" : { "en" : { "stringUnit" : { "state" : "translated", - "value" : "Recent Searches" + "value" : "Enter a search term to find your saved content." } }, "ko" : { "stringUnit" : { "state" : "translated", - "value" : "최근 검색" + "value" : "검색어를 입력해 저장한 앱 컨텐츠를 찾아보세요." } } } }, - "search_show_more" : { + "search_prompt" : { "extractionState" : "manual", "localizations" : { "en" : { "stringUnit" : { "state" : "translated", - "value" : "Show More" + "value" : "Search (e.g. #123)" } }, "ko" : { "stringUnit" : { "state" : "translated", - "value" : "더보기" + "value" : "검색 (예: #123)" } } } }, - "search_hash_guide_message" : { + "search_recent" : { "extractionState" : "manual", "localizations" : { "en" : { "stringUnit" : { "state" : "translated", - "value" : "Type like #123 to find that Todo directly." + "value" : "Recent Searches" } }, "ko" : { "stringUnit" : { "state" : "translated", - "value" : "#123처럼 입력하면 해당 Todo를 바로 찾을 수 있습니다." + "value" : "최근 검색" } } } }, - "search_hash_guide_title" : { + "search_show_more" : { "extractionState" : "manual", "localizations" : { "en" : { "stringUnit" : { "state" : "translated", - "value" : "Enter a Todo number" + "value" : "Show More" } }, "ko" : { "stringUnit" : { "state" : "translated", - "value" : "Todo 번호를 입력해주세요" + "value" : "더보기" } } } @@ -3619,4 +3653,4 @@ } }, "version" : "1.0" -} +} \ No newline at end of file diff --git a/Application/Presentation/Entry/Sources/Common/Component/LoginButton.swift b/Application/Presentation/Entry/Sources/Common/Component/LoginButton.swift index d393b60f..2f54e825 100644 --- a/Application/Presentation/Entry/Sources/Common/Component/LoginButton.swift +++ b/Application/Presentation/Entry/Sources/Common/Component/LoginButton.swift @@ -8,9 +8,9 @@ import SwiftUI struct LoginButton: View { - @State private var logo: Image? - @State private var text = "" @ScaledMetric(relativeTo: .body) private var height = CGFloat(22) + private var logo: Image? + private var text = "" private let showsProgressView: Bool private let action: () -> Void @@ -20,8 +20,8 @@ struct LoginButton: View { showsProgressView: Bool = false, action: @escaping () -> Void = {} ) { - self._logo = State(initialValue: logo) - self._text = State(initialValue: text) + self.logo = logo + self.text = text self.showsProgressView = showsProgressView self.action = action } @@ -30,28 +30,30 @@ struct LoginButton: View { Button { action() } label: { - ZStack { - Text(text) - .opacity(showsProgressView ? 0 : 1) + Group { if showsProgressView { ProgressView() + .tint(Color(asset: .accentColor)) + } else { + Text(text) + .foregroundStyle(Color(asset: .textPrimary)) } } - .foregroundStyle(Color.primary) .font(.system(.body)) - .contentShape(.capsule) - .frame(width: 300, height: height + 16) - .overlay { - ZStack(alignment: .leading) { - Capsule() - .stroke(Color.gray, lineWidth: 1) - if let logo, !showsProgressView { - logo - .resizable() - .scaledToFit() - .frame(width: height, height: height) - .padding(.leading) - } + .contentShape(.rect(cornerRadius: 12)) + .frame(width: 300, height: height + 24) + .background { + RoundedRectangle(cornerRadius: 12) + .stroke(Color(asset: .border), lineWidth: 3) + .fill(Color(asset: .surface)) + } + .overlay(alignment: .leading) { + if let logo, !showsProgressView { + logo + .resizable() + .scaledToFit() + .frame(width: height, height: height) + .padding(.leading) } } } diff --git a/Application/Presentation/Entry/Sources/Login/LoginView.swift b/Application/Presentation/Entry/Sources/Login/LoginView.swift index 49a0e46a..b4309041 100644 --- a/Application/Presentation/Entry/Sources/Login/LoginView.swift +++ b/Application/Presentation/Entry/Sources/Login/LoginView.swift @@ -26,27 +26,41 @@ struct LoginView: View { var body: some View { VStack { Spacer() - Image("Primary") + Spacer() + Image("Primary", bundle: PresentationResources.bundle) .resizable() .scaledToFit() - .frame(width: sceneWidth / 5) + .frame(width: sceneWidth / 4) Spacer() + + VStack(spacing: 24) { + Text(String(localized: "login_intro_title")) + .font(.title) + .fontWeight(.heavy) + .multilineTextAlignment(.center) + Text(String(localized: "login_intro_description")) + .padding(.horizontal) + .foregroundStyle(Color(asset: .textTertiary)) + .multilineTextAlignment(.center) + } + Spacer() + VStack(spacing: 20) { signInButton( provider: .google, - logo: Image("Google"), + logo: Image("Google", bundle: PresentationResources.bundle), text: String(localized: "login_google_sign_in") ) signInButton( provider: .github, - logo: Image("Github"), + logo: Image("Github", bundle: PresentationResources.bundle), text: String(localized: "login_github_sign_in") ) signInButton( provider: .apple, - logo: Image("Apple"), + logo: Image("Apple", bundle: PresentationResources.bundle), text: String(localized: "login_apple_sign_in") ) } diff --git a/Application/Presentation/Entry/Sources/Root/RootView.swift b/Application/Presentation/Entry/Sources/Root/RootView.swift index b162c51f..16e3d3ae 100644 --- a/Application/Presentation/Entry/Sources/Root/RootView.swift +++ b/Application/Presentation/Entry/Sources/Root/RootView.swift @@ -33,7 +33,7 @@ public struct RootView: View { public var body: some View { ZStack { - Color(UIColor.systemGroupedBackground).ignoresSafeArea() + Color(asset: .appBackground).ignoresSafeArea() if let signIn = store.signIn { if signIn { MainView( diff --git a/Application/Presentation/PresentationShared/Resources/Assets.xcassets/AccentColor.colorset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..23b9cc2b --- /dev/null +++ b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0xA8", + "green": "0xA5", + "red": "0x1B" + } + }, + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0xA6", + "green": "0xA0", + "red": "0x1E" + } + }, + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Application/Presentation/PresentationShared/Resources/Assets.xcassets/AppBackground.colorset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/AppBackground.colorset/Contents.json new file mode 100644 index 00000000..0347f24f --- /dev/null +++ b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/AppBackground.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0xFA", + "green": "0xF9", + "red": "0xF6" + } + }, + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x16", + "green": "0x14", + "red": "0x0F" + } + }, + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Application/App/Sources/Resource/Assets.xcassets/Apple.imageset/Apple_black.png b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Apple.imageset/Apple_black.png similarity index 100% rename from Application/App/Sources/Resource/Assets.xcassets/Apple.imageset/Apple_black.png rename to Application/Presentation/PresentationShared/Resources/Assets.xcassets/Apple.imageset/Apple_black.png diff --git a/Application/App/Sources/Resource/Assets.xcassets/Apple.imageset/Apple_white.png b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Apple.imageset/Apple_white.png similarity index 100% rename from Application/App/Sources/Resource/Assets.xcassets/Apple.imageset/Apple_white.png rename to Application/Presentation/PresentationShared/Resources/Assets.xcassets/Apple.imageset/Apple_white.png diff --git a/Application/App/Sources/Resource/Assets.xcassets/Apple.imageset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Apple.imageset/Contents.json similarity index 100% rename from Application/App/Sources/Resource/Assets.xcassets/Apple.imageset/Contents.json rename to Application/Presentation/PresentationShared/Resources/Assets.xcassets/Apple.imageset/Contents.json diff --git a/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Border.colorset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Border.colorset/Contents.json new file mode 100644 index 00000000..c166657c --- /dev/null +++ b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Border.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0xF0", + "green": "0xE8", + "red": "0xE2" + } + }, + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x30", + "green": "0x2C", + "red": "0x24" + } + }, + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Application/App/Sources/Resource/Assets.xcassets/AccentColor.colorset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Contents.json similarity index 51% rename from Application/App/Sources/Resource/Assets.xcassets/AccentColor.colorset/Contents.json rename to Application/Presentation/PresentationShared/Resources/Assets.xcassets/Contents.json index eb878970..73c00596 100644 --- a/Application/App/Sources/Resource/Assets.xcassets/AccentColor.colorset/Contents.json +++ b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Contents.json @@ -1,9 +1,4 @@ { - "colors" : [ - { - "idiom" : "universal" - } - ], "info" : { "author" : "xcode", "version" : 1 diff --git a/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Danger.colorset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Danger.colorset/Contents.json new file mode 100644 index 00000000..be5c95a4 --- /dev/null +++ b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Danger.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x1C", + "green": "0x1C", + "red": "0xB9" + } + }, + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x71", + "green": "0x71", + "red": "0xF8" + } + }, + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Application/App/Sources/Resource/Assets.xcassets/Github.imageset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Github.imageset/Contents.json similarity index 100% rename from Application/App/Sources/Resource/Assets.xcassets/Github.imageset/Contents.json rename to Application/Presentation/PresentationShared/Resources/Assets.xcassets/Github.imageset/Contents.json diff --git a/Application/App/Sources/Resource/Assets.xcassets/Github.imageset/Github_black.png b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Github.imageset/Github_black.png similarity index 100% rename from Application/App/Sources/Resource/Assets.xcassets/Github.imageset/Github_black.png rename to Application/Presentation/PresentationShared/Resources/Assets.xcassets/Github.imageset/Github_black.png diff --git a/Application/App/Sources/Resource/Assets.xcassets/Github.imageset/Github_white.png b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Github.imageset/Github_white.png similarity index 100% rename from Application/App/Sources/Resource/Assets.xcassets/Github.imageset/Github_white.png rename to Application/Presentation/PresentationShared/Resources/Assets.xcassets/Github.imageset/Github_white.png diff --git a/Application/App/Sources/Resource/Assets.xcassets/Google.imageset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Google.imageset/Contents.json similarity index 100% rename from Application/App/Sources/Resource/Assets.xcassets/Google.imageset/Contents.json rename to Application/Presentation/PresentationShared/Resources/Assets.xcassets/Google.imageset/Contents.json diff --git a/Application/App/Sources/Resource/Assets.xcassets/Google.imageset/Google.png b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Google.imageset/Google.png similarity index 100% rename from Application/App/Sources/Resource/Assets.xcassets/Google.imageset/Google.png rename to Application/Presentation/PresentationShared/Resources/Assets.xcassets/Google.imageset/Google.png diff --git a/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Info.colorset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Info.colorset/Contents.json new file mode 100644 index 00000000..38418323 --- /dev/null +++ b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Info.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0xD8", + "green": "0x4E", + "red": "0x1D" + } + }, + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0xF8", + "green": "0xBD", + "red": "0x38" + } + }, + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Application/Presentation/PresentationShared/Resources/Assets.xcassets/OnPrimaryContainer.colorset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/OnPrimaryContainer.colorset/Contents.json new file mode 100644 index 00000000..c0ceeb36 --- /dev/null +++ b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/OnPrimaryContainer.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x59", + "green": "0x5E", + "red": "0x11" + } + }, + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0xDD", + "green": "0xD7", + "red": "0x67" + } + }, + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Application/App/Sources/Resource/Assets.xcassets/Primary.imageset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Primary.imageset/Contents.json similarity index 100% rename from Application/App/Sources/Resource/Assets.xcassets/Primary.imageset/Contents.json rename to Application/Presentation/PresentationShared/Resources/Assets.xcassets/Primary.imageset/Contents.json diff --git a/Application/App/Sources/Resource/Assets.xcassets/Primary.imageset/Primary_dark.png b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Primary.imageset/Primary_dark.png similarity index 100% rename from Application/App/Sources/Resource/Assets.xcassets/Primary.imageset/Primary_dark.png rename to Application/Presentation/PresentationShared/Resources/Assets.xcassets/Primary.imageset/Primary_dark.png diff --git a/Application/Presentation/PresentationShared/Resources/Assets.xcassets/PrimaryContainer.colorset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/PrimaryContainer.colorset/Contents.json new file mode 100644 index 00000000..be688072 --- /dev/null +++ b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/PrimaryContainer.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0xF8", + "green": "0xF7", + "red": "0xE6" + } + }, + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x39", + "green": "0x37", + "red": "0x00" + } + }, + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Success.colorset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Success.colorset/Contents.json new file mode 100644 index 00000000..a8a0142f --- /dev/null +++ b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Success.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x3D", + "green": "0x80", + "red": "0x15" + } + }, + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x99", + "green": "0xD3", + "red": "0x34" + } + }, + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Surface.colorset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Surface.colorset/Contents.json new file mode 100644 index 00000000..94815123 --- /dev/null +++ b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Surface.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0xFF", + "green": "0xFF", + "red": "0xFF" + } + }, + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x1E", + "green": "0x1C", + "red": "0x17" + } + }, + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Application/Presentation/PresentationShared/Resources/Assets.xcassets/SurfaceSecondary.colorset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/SurfaceSecondary.colorset/Contents.json new file mode 100644 index 00000000..9e86ecdd --- /dev/null +++ b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/SurfaceSecondary.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0xF9", + "green": "0xF5", + "red": "0xF1" + } + }, + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x22", + "green": "0x20", + "red": "0x1B" + } + }, + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Application/Presentation/PresentationShared/Resources/Assets.xcassets/TextPrimary.colorset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/TextPrimary.colorset/Contents.json new file mode 100644 index 00000000..2d37ab02 --- /dev/null +++ b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/TextPrimary.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x2A", + "green": "0x17", + "red": "0x0F" + } + }, + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0xE6", + "green": "0xE3", + "red": "0xDF" + } + }, + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Application/Presentation/PresentationShared/Resources/Assets.xcassets/TextSecondary.colorset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/TextSecondary.colorset/Contents.json new file mode 100644 index 00000000..5ce8eb03 --- /dev/null +++ b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/TextSecondary.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x69", + "green": "0x55", + "red": "0x47" + } + }, + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0xC9", + "green": "0xC9", + "red": "0xBC" + } + }, + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Application/Presentation/PresentationShared/Resources/Assets.xcassets/TextTertiary.colorset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/TextTertiary.colorset/Contents.json new file mode 100644 index 00000000..12d817e1 --- /dev/null +++ b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/TextTertiary.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x8B", + "green": "0x74", + "red": "0x64" + } + }, + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x94", + "green": "0x93", + "red": "0x87" + } + }, + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Warning.colorset/Contents.json b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Warning.colorset/Contents.json new file mode 100644 index 00000000..cf1f2c2c --- /dev/null +++ b/Application/Presentation/PresentationShared/Resources/Assets.xcassets/Warning.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x09", + "green": "0x53", + "red": "0xB4" + } + }, + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "color": { + "color-space": "srgb", + "components": { + "alpha": "1.000", + "blue": "0x24", + "green": "0xBF", + "red": "0xFB" + } + }, + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/Application/Presentation/PresentationShared/Sources/Common/ColorAsset.swift b/Application/Presentation/PresentationShared/Sources/Common/ColorAsset.swift new file mode 100644 index 00000000..ae96b3cb --- /dev/null +++ b/Application/Presentation/PresentationShared/Sources/Common/ColorAsset.swift @@ -0,0 +1,36 @@ +// +// ColorAsset.swift +// PresentationShared +// +// Created by opfic on 9/9/26. +// + +import SwiftUI + +public enum ColorAsset { + case accentColor + case appBackground + case border + case danger + case info + case onPrimaryContainer + case primaryContainer + case success + case surface + case surfaceSecondary + case textPrimary + case textSecondary + case textTertiary + case warning + + fileprivate var name: String { + let name = String(describing: self) + return name.prefix(1).uppercased() + name.dropFirst() + } +} + +public extension Color { + init(asset: ColorAsset) { + self.init(asset.name, bundle: PresentationResources.bundle) + } +} diff --git a/Application/Presentation/PresentationShared/Sources/Common/PresentationResources.swift b/Application/Presentation/PresentationShared/Sources/Common/PresentationResources.swift new file mode 100644 index 00000000..2221cd20 --- /dev/null +++ b/Application/Presentation/PresentationShared/Sources/Common/PresentationResources.swift @@ -0,0 +1,14 @@ +// +// PresentationResources.swift +// PresentationShared +// +// Created by opfic on 9/9/26. +// + +import Foundation + +public enum PresentationResources { + public static let bundle = Bundle(for: PresentationResourceBundleToken.self) +} + +private final class PresentationResourceBundleToken {} diff --git a/Application/Presentation/PresentationShared/Sources/Todo/Editor/TodoEditorView.swift b/Application/Presentation/PresentationShared/Sources/Todo/Editor/TodoEditorView.swift index 5bbbf173..68ecace5 100644 --- a/Application/Presentation/PresentationShared/Sources/Todo/Editor/TodoEditorView.swift +++ b/Application/Presentation/PresentationShared/Sources/Todo/Editor/TodoEditorView.swift @@ -34,13 +34,7 @@ public struct TodoEditorView: View { public var body: some View { NavigationStack { - Group { - if store.tabViewTag == .editor { - editorContent - } else { - previewContent - } - } + selectedContent .onTapGesture { field = .content } @@ -54,35 +48,47 @@ public struct TodoEditorView: View { .sheet(item: $store.scope(state: \.sheet, action: \.sheet)) { store in sheetContent(store) } - .toolbar { - if !isiOSAppOnMac { - ToolbarLeadingButton { close() } - } - ToolbarItem(placement: .topBarTrailing) { - Button { - store.send(.setSheet(.info)) - } label: { - Image(systemName: "info.circle") - } - } - if store.isLoading { - if #available(iOS 26.0, *) { - ToolbarSpacer(.fixed, placement: .topBarTrailing) - } - ToolbarItem(placement: .topBarTrailing) { - ProgressView() - } - } else { - ToolbarTrailingButton { - submit() - } - .disabled(!store.isReadyToSubmit) - } - } + .toolbar { toolbarContent } .prominentAlert(store, state: \.alert, action: \.alert) } } + @ViewBuilder + private var selectedContent: some View { + if store.tabViewTag == .editor { + editorContent + } else { + previewContent + } + } + + @ToolbarContentBuilder + private var toolbarContent: some ToolbarContent { + if !isiOSAppOnMac { + ToolbarLeadingButton { close() } + } + ToolbarItem(placement: .topBarTrailing) { + Button { + store.send(.setSheet(.info)) + } label: { + Image(systemName: "info.circle") + } + } + if store.isLoading { + if #available(iOS 26.0, *) { + ToolbarSpacer(.fixed, placement: .topBarTrailing) + } + ToolbarItem(placement: .topBarTrailing) { + ProgressView() + } + } else { + ToolbarTrailingButton { + submit() + } + .disabled(!store.isReadyToSubmit) + } + } + private var editorContent: some View { ScrollView { LazyVStack(spacing: 10) { diff --git a/Application/Presentation/Project.swift b/Application/Presentation/Project.swift index 55af3554..3025ed98 100644 --- a/Application/Presentation/Project.swift +++ b/Application/Presentation/Project.swift @@ -34,6 +34,7 @@ let project = Project( bundleId: "com.opfic.DevLog.PresentationShared", infoPlist: .file(path: frameworkInfoPlistPath), sources: ["PresentationShared/Sources/**/*.swift"], + resources: ["PresentationShared/Resources/Assets.xcassets"], scripts: [ DevLogScripts.swiftLint( sourcePath: "PresentationShared/Sources",