Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Application/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let project = Project(
sources: ["Sources/**/*.swift"],
resources: [
"Sources/Resource/Assets.xcassets",
"../Presentation/PresentationShared/Resources/Assets.xcassets",
"../Shared/Resources/ColorPalette.xcassets",
"Sources/Resource/GoogleService-Info.plist",
"../Presentation/PresentationShared/Resources/Localizable.xcstrings",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct LoginButton: View {
Group {
if showsProgressView {
ProgressView()
.tint(Color(asset: .accentColor))
.tint(Color.accent)
} else {
Text(text)
.foregroundStyle(.primary)
Expand All @@ -44,8 +44,8 @@ struct LoginButton: View {
.frame(width: 300, height: height + 24)
.background {
RoundedRectangle(cornerRadius: 12)
.stroke(Color(asset: .border), lineWidth: 3)
.fill(Color(asset: .surface))
.stroke(Color.border, lineWidth: 3)
.fill(Color.surface)
}
.overlay(alignment: .leading) {
if let logo, !showsProgressView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct LoginView: View {
.multilineTextAlignment(.center)
Text(String(localized: "login_intro_description", bundle: PresentationResources.bundle))
.padding(.horizontal)
.foregroundStyle(Color(asset: .textTertiary))
.foregroundStyle(Color.textTertiary)
.multilineTextAlignment(.center)
}
Spacer()
Expand Down
2 changes: 1 addition & 1 deletion Application/Presentation/Entry/Sources/Root/RootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public struct RootView: View {

public var body: some View {
ZStack {
Color(asset: .appBackground).ignoresSafeArea()
Color.appBackground.ignoresSafeArea()
if let signIn = store.signIn {
if signIn {
MainView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3428,6 +3428,23 @@
}
}
},
"todo_tag_duplicate_hint" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Each tag can only be added once."
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
"value" : "같은 태그는 한 번만 추가할 수 있어요."
}
}
}
},
"todo_tags" : {
"extractionState" : "manual",
"localizations" : {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public struct Tag: View {
public var body: some View {
HStack(spacing: 4) {
Text(name)
.foregroundStyle(.blue)
.foregroundStyle(Color.accent)
.bold()
.lineLimit(1)
.fixedSize()
Expand Down Expand Up @@ -74,7 +74,7 @@ public struct Tag: View {
.frame(width: height, height: height)
.symbolRenderingMode(.palette)
.foregroundStyle(
.blue,
Color.accent,
.black.opacity(colorScheme == .light ? 0 : 0.4)
)

Expand All @@ -84,7 +84,7 @@ public struct Tag: View {
}
.background {
Capsule()
.fill(.blue.opacity(0.2))
.fill(Color.accent.opacity(0.2))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// Color+Assets.swift
// PresentationShared
//
// Created by opfic on 9/11/26.
//

import SwiftUI

public extension Color {
static let accent = Color("AccentColor", bundle: PresentationResources.bundle)
static let appBackground = Color("AppBackground", bundle: PresentationResources.bundle)
static let border = Color("Border", bundle: PresentationResources.bundle)
static let danger = Color("Danger", bundle: PresentationResources.bundle)
static let dangerContainer = Color("DangerContainer", bundle: PresentationResources.bundle)
static let info = Color("Info", bundle: PresentationResources.bundle)
static let infoContainer = Color("InfoContainer", bundle: PresentationResources.bundle)
static let onPrimaryContainer = Color("OnPrimaryContainer", bundle: PresentationResources.bundle)
static let primaryContainer = Color("PrimaryContainer", bundle: PresentationResources.bundle)
static let success = Color("Success", bundle: PresentationResources.bundle)
static let successContainer = Color("SuccessContainer", bundle: PresentationResources.bundle)
static let surface = Color("Surface", bundle: PresentationResources.bundle)
static let surfaceSecondary = Color("SurfaceSecondary", bundle: PresentationResources.bundle)
static let textSecondary = Color("TextSecondary", bundle: PresentationResources.bundle)
static let textTertiary = Color("TextTertiary", bundle: PresentationResources.bundle)
static let warning = Color("Warning", bundle: PresentationResources.bundle)
static let warningContainer = Color("WarningContainer", bundle: PresentationResources.bundle)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,33 @@ public struct TodoEditorFeature {
@ObservableState
public struct State: Equatable {
@Presents public var alert: AlertState<Never>?
@Presents public var sheet: SheetState?
public var isInspectorPresented = false
public var inspectorContent = InspectorContent.options
public var isCompleted: Bool = false
public var completedAt: Date?
public var isPinned: Bool = false
public var title: String = ""
public var content: String = ""
public var referenceItems: [Int: TodoReferenceItem] = [:]
public var dueDate: Date?
public var selectedDueDate: Date {
get { dueDate ?? Date() }
set { dueDate = newValue }
}
public var loading = LoadingFeature.State()
public var tags: OrderedSet<String> = []
public var tagText: String = ""
public var tabViewTag: EditorTab = .editor
public var editorHeaderHeight = CGFloat.zero
public var categories: [TodoCategoryItem] = []
public var category = TodoCategoryItem(from: .system(.etc))
public var selectedCategoryID: String {
get { category.id }
set {
guard let category = categories.first(where: { $0.id == newValue }) else { return }
self.category = category
}
}
public var saveResult: SaveResult?
let id: String
let isChecked: Bool
Expand Down Expand Up @@ -96,10 +109,8 @@ public struct TodoEditorFeature {
}
}

@ObservableState
@CasePathable
public enum SheetState: Equatable {
case info
public enum InspectorContent: Equatable {
case options
case todo(TodoIdItem)
}

Expand All @@ -115,24 +126,19 @@ public struct TodoEditorFeature {

public enum Action: BindableAction, Equatable {
case alert(PresentationAction<Never>)
case sheet(PresentationAction<Sheet>)
case binding(BindingAction<State>)
case delegate(Delegate)
case onAppear
case addTag(String)
case removeTag(String)
case setCompleted(Bool)
case setSheet(SheetState?)
case showInspector(InspectorContent)
case upsertTodo
case createSucceeded
case saveFailed
case updateSucceeded(Todo)
case loading(LoadingFeature.Action)

public enum Sheet: Equatable {
case tapCloseButton
}

public enum Delegate: Equatable {
case created
case updated(Todo)
Expand All @@ -155,21 +161,21 @@ public struct TodoEditorFeature {
LoadingFeature()
}
BindingReducer()
.onChange(of: \.isCompleted) { _, isCompleted in
Reduce { state, _ in
state.completedAt = isCompleted ? now : nil
return .none
}
}
Reduce { state, action in
switch action {
case .alert:
break
case .sheet(.dismiss):
state.sheet = nil
case .sheet(.presented(.tapCloseButton)):
state.sheet = nil
case .sheet:
break
case .binding(\.content):
if state.tabViewTag == .preview {
return resolveMarkdownEffect(content: state.content)
}
case .binding(\.dueDate):
case .binding(\.dueDate), .binding(\.selectedDueDate):
if let tomorrowDate = Calendar.current.date(byAdding: .day, value: 1, to: now),
let dueDate = state.dueDate {
state.dueDate = max(dueDate, tomorrowDate)
Expand Down Expand Up @@ -197,8 +203,13 @@ public struct TodoEditorFeature {
state.completedAt = isCompleted ? now : nil
}
state.isCompleted = isCompleted
case .setSheet(let sheet):
state.sheet = sheet
case .showInspector(let content):
if content == .options && state.inspectorContent == .options {
state.isInspectorPresented.toggle()
} else {
state.isInspectorPresented = true
}
state.inspectorContent = content
case .upsertTodo:
state.saveResult = nil
if state.originalDraft == nil {
Expand All @@ -219,18 +230,6 @@ public struct TodoEditorFeature {
return .none
}
.ifLet(\.$alert, action: \.alert)
.ifLet(\.$sheet, action: \.sheet) {
TodoEditorSheetFeature()
}
}
}

private struct TodoEditorSheetFeature: Reducer {
typealias State = TodoEditorFeature.SheetState
typealias Action = TodoEditorFeature.Action.Sheet

var body: some ReducerOf<Self> {
EmptyReducer()
}
}

Expand Down
Loading