Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0.0] 다크모드 대응 #156

Merged
merged 10 commits into from
Mar 19, 2024
15 changes: 10 additions & 5 deletions package-kuring/Sources/UIKit/BookmarkUI/BookmarkList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//

import SwiftUI
import ColorSet
import NoticeUI
import NoticeFeatures
import BookmarkFeatures
Expand All @@ -13,9 +14,13 @@ public struct BookmarkList: View {
@Bindable var store: StoreOf<BookmarkListFeature>

public var body: some View {
ZStack(alignment: .bottom) {
ZStack(alignment: .center) {
ColorSet.bg.ignoresSafeArea()

if store.bookmarkedNotices.isEmpty {
Text("보관된 공지사항이 없습니다.")
.font(.system(size: 16, weight: .medium))
.foregroundStyle(ColorSet.body)
} else {
List {
ForEach(self.store.bookmarkedNotices, id: \.id) { notice in
Expand Down Expand Up @@ -52,13 +57,13 @@ public struct BookmarkList: View {
} label: {
Image(
systemName: store.selectedIDs.contains(notice.id)
? "checkmark.circle.fill"
: "circle"
? "checkmark.circle.fill"
: "circle"
)
.foregroundStyle(
store.selectedIDs.contains(notice.id)
? Color.accentColor
: Color.caption1.opacity(0.15)
? ColorSet.primary
: ColorSet.body
)
}
}
Expand Down
11 changes: 7 additions & 4 deletions package-kuring/Sources/UIKit/DepartmentUI/DepartmentEditor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import Models
import SwiftUI
import ColorSet
import DepartmentFeatures
import ComposableArchitecture

Expand All @@ -17,24 +18,25 @@ public struct DepartmentEditor: View {
VStack(alignment: .leading) {
Text("학과를 추가하거나\n삭제할 수 있어요")
.font(.system(size: 24, weight: .bold))
.foregroundStyle(Color(red: 0.1, green: 0.12, blue: 0.15))
.foregroundStyle(ColorSet.title)
.padding(.top, 28)
.padding(.bottom, 24)

HStack(alignment: .center, spacing: 12) {
Image(systemName: "magnifyingglass")
.frame(width: 16, height: 16)
.foregroundStyle(Color.caption1.opacity(0.6))
.foregroundStyle(ColorSet.gray400)

TextField("추가할 학과를 검색해 주세요", text: $store.searchText)
.focused($focus, equals: .search)
.autocorrectionDisabled()
.bind($store.focus, to: self.$focus)
.background(ColorSet.gray300)

if !store.searchText.isEmpty {
Image(systemName: "xmark")
.frame(width: 16, height: 16)
.foregroundStyle(Color.caption1.opacity(0.6))
.foregroundStyle(ColorSet.gray400)
.onTapGesture {
store.send(.clearTextFieldButtonTapped)
focus = nil
Expand All @@ -49,7 +51,7 @@ public struct DepartmentEditor: View {

Text(store.searchText.isEmpty ? "내 학과" : "검색 결과")
.font(.system(size: 14))
.foregroundStyle(Color.caption1.opacity(0.6))
.foregroundStyle(ColorSet.caption1)
.padding(.horizontal, 4)
.padding(.vertical, 10)

Expand Down Expand Up @@ -86,6 +88,7 @@ public struct DepartmentEditor: View {
Spacer()
}
.padding(.horizontal, 20)
.background(ColorSet.bg)
.toolbar {
ToolbarItem(placement: .topBarTrailing) {
Button("전체 삭제") {
Expand Down
8 changes: 4 additions & 4 deletions package-kuring/Sources/UIKit/DepartmentUI/DepartmentRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ public struct DepartmentRow: View {
Button(action: action) {
Image(
systemName: isSelected
? "checkmark.circle.fill"
: "plus.circle"
? "checkmark.circle.fill"
: "plus.circle"
)
.foregroundStyle(
isSelected
? Color.accentColor
: Color.black.opacity(0.1)
? ColorSet.primary
: ColorSet.gray400
)
}
}
Expand Down
6 changes: 4 additions & 2 deletions package-kuring/Sources/UIKit/NoticeUI/NoticeApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//

import SwiftUI
import ColorSet
import SearchUI
import DepartmentUI
import SubscriptionUI
Expand All @@ -22,6 +23,7 @@ public struct NoticeApp: View {
action: \.noticeList
)
)
.background(ColorSet.bg)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
Expand All @@ -37,7 +39,7 @@ public struct NoticeApp: View {
)
) {
Image(systemName: "magnifyingglass")
.foregroundStyle(Color.black)
.foregroundStyle(ColorSet.gray400)
}
}

Expand All @@ -48,7 +50,7 @@ public struct NoticeApp: View {
store.send(.changeSubscriptionButtonTapped)
} label: {
Image(systemName: "bell")
.foregroundStyle(.black)
.foregroundStyle(ColorSet.gray400)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import Models
import SwiftUI
import ColorSet
import NoticeFeatures
import DepartmentFeatures
import ComposableArchitecture
Expand All @@ -18,7 +19,7 @@ extension NoticeContentView {
Text("아직 추가된 학과가 없어요.\n관심 학과를 추가하고 공지를 확인해 보세요!")
.font(.system(size: 15, weight: .medium))
.multilineTextAlignment(.center)
.foregroundColor(.black.opacity(0.36))
.foregroundStyle(ColorSet.caption2)

NavigationLink(
state: NoticeAppFeature.Path.State.departmentEditor(
Expand Down Expand Up @@ -46,7 +47,7 @@ extension NoticeContentView {
.foregroundStyle(Color.white)
.padding(.horizontal, 36)
.padding(.vertical, 16)
.background(Color.accentColor)
.background(ColorSet.primary)
.cornerRadius(100)
}
}
14 changes: 7 additions & 7 deletions package-kuring/Sources/UIKit/NoticeUI/NoticeRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import Caches
import Models
import SwiftUI
import ColorSet
import ComposableArchitecture

public struct NoticeRow: View {
Expand Down Expand Up @@ -48,7 +49,7 @@ public struct NoticeRow: View {
ZStack {
switch rowType {
case .important, .importantAndBookmark:
Color.accentColor.opacity(0.1)
ColorSet.primary.opacity(0.1)
.ignoresSafeArea()
default:
Color.clear
Expand Down Expand Up @@ -115,34 +116,33 @@ public struct NoticeRow: View {
.font(.system(size: 12, weight: .semibold))
.padding(.horizontal, 8)
.padding(.vertical, 4)
.foregroundStyle(Color.accentColor)
.background(Color.white)
.foregroundStyle(ColorSet.primary)
.background(ColorSet.bg)
.cornerRadius(16)
.overlay(
RoundedRectangle(cornerRadius: 16)
.inset(by: 0.25)
.stroke(Color.accentColor, lineWidth: 0.5)
.stroke(ColorSet.primary, lineWidth: 0.5)
)
}

@ViewBuilder
private var titleView: some View {
Text(notice.subject)
.font(.system(size: 15, weight: .medium))
.foregroundStyle(Color.caption1)
.foregroundStyle(ColorSet.body)
}

@ViewBuilder
private var dateView: some View {
// TODO: - 정보 재구성
Text(notice.postedDate)
.font(.system(size: 14))
.foregroundStyle(Color.caption1.opacity(0.6))
.foregroundStyle(ColorSet.caption1)
}

@ViewBuilder
private var bookmarkView: some View {
// TODO: 디자인 시스템 분리 - 북마크
ZStack {
RoundedRectangle(cornerRadius: 2)
.compositingGroup()
Expand Down
7 changes: 4 additions & 3 deletions package-kuring/Sources/UIKit/NoticeUI/NoticeTypeColumn.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import Models
import SwiftUI
import ColorSet
import ComposableArchitecture

public struct NoticeTypeColumn: View {
Expand All @@ -17,7 +18,7 @@ public struct NoticeTypeColumn: View {
let lineHeight: CGFloat = 3

Text(title)
.font(.system(size: 16, weight: provider.id == selectedID ? .semibold : .regular))
.font(.system(size: 16, weight: provider.id == selectedID ? .semibold : .medium))
.padding(.vertical, 8)
.frame(width: itemSize.width, height: itemSize.height)
.overlay {
Expand All @@ -31,8 +32,8 @@ public struct NoticeTypeColumn: View {
}
.foregroundStyle(
provider.id == selectedID
? Color.accentColor
: Color.black.opacity(0.3)
? ColorSet.primary
: ColorSet.caption1
)
.id(provider.id)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import Models
import Combine
import SwiftUI
import ColorSet
import DepartmentUI

@Observable
Expand Down Expand Up @@ -69,7 +70,7 @@ struct DepartmentSelector: View {
HStack(alignment: .center, spacing: 12) {
Image(systemName: "magnifyingglass")
.frame(width: 16, height: 16)
.foregroundStyle(Color.caption1.opacity(0.6))
.foregroundStyle(ColorSet.gray400)

TextField("추가할 학과를 검색해 주세요", text: $finder.text)
.focused($focus)
Expand Down
2 changes: 1 addition & 1 deletion package-kuring/Sources/UIKit/SearchUI/SearchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public struct SearchView: View {
/// 검색 아이콘
Image(systemName: "magnifyingglass")
.frame(width: 16, height: 16)
.foregroundStyle(Color.caption1.opacity(0.6))
.foregroundStyle(ColorSet.gray400)

TextField("검색어를 입력해주세요", text: $store.searchInfo.text)
.focused($focus, equals: .search)
Expand Down