diff --git a/package-kuring/Sources/UIKit/BookmarkUI/BookmarkList.swift b/package-kuring/Sources/UIKit/BookmarkUI/BookmarkList.swift index 307a9841..b281e714 100644 --- a/package-kuring/Sources/UIKit/BookmarkUI/BookmarkList.swift +++ b/package-kuring/Sources/UIKit/BookmarkUI/BookmarkList.swift @@ -4,6 +4,7 @@ // import SwiftUI +import ColorSet import NoticeUI import NoticeFeatures import BookmarkFeatures @@ -13,9 +14,13 @@ public struct BookmarkList: View { @Bindable var store: StoreOf 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 @@ -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 ) } } diff --git a/package-kuring/Sources/UIKit/DepartmentUI/DepartmentEditor.swift b/package-kuring/Sources/UIKit/DepartmentUI/DepartmentEditor.swift index 4ef5ee1a..eafa5a15 100644 --- a/package-kuring/Sources/UIKit/DepartmentUI/DepartmentEditor.swift +++ b/package-kuring/Sources/UIKit/DepartmentUI/DepartmentEditor.swift @@ -5,6 +5,7 @@ import Models import SwiftUI +import ColorSet import DepartmentFeatures import ComposableArchitecture @@ -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 @@ -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) @@ -86,6 +88,7 @@ public struct DepartmentEditor: View { Spacer() } .padding(.horizontal, 20) + .background(ColorSet.bg) .toolbar { ToolbarItem(placement: .topBarTrailing) { Button("전체 삭제") { diff --git a/package-kuring/Sources/UIKit/DepartmentUI/DepartmentRow.swift b/package-kuring/Sources/UIKit/DepartmentUI/DepartmentRow.swift index a8664145..f44b63cf 100644 --- a/package-kuring/Sources/UIKit/DepartmentUI/DepartmentRow.swift +++ b/package-kuring/Sources/UIKit/DepartmentUI/DepartmentRow.swift @@ -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 ) } } diff --git a/package-kuring/Sources/UIKit/NoticeUI/NoticeApp.swift b/package-kuring/Sources/UIKit/NoticeUI/NoticeApp.swift index 6921eece..ded4c294 100644 --- a/package-kuring/Sources/UIKit/NoticeUI/NoticeApp.swift +++ b/package-kuring/Sources/UIKit/NoticeUI/NoticeApp.swift @@ -4,6 +4,7 @@ // import SwiftUI +import ColorSet import SearchUI import DepartmentUI import SubscriptionUI @@ -22,6 +23,7 @@ public struct NoticeApp: View { action: \.noticeList ) ) + .background(ColorSet.bg) .navigationBarTitleDisplayMode(.inline) .toolbar { ToolbarItem(placement: .navigationBarLeading) { @@ -37,7 +39,7 @@ public struct NoticeApp: View { ) ) { Image(systemName: "magnifyingglass") - .foregroundStyle(Color.black) + .foregroundStyle(ColorSet.gray400) } } @@ -48,7 +50,7 @@ public struct NoticeApp: View { store.send(.changeSubscriptionButtonTapped) } label: { Image(systemName: "bell") - .foregroundStyle(.black) + .foregroundStyle(ColorSet.gray400) } } } diff --git a/package-kuring/Sources/UIKit/NoticeUI/NoticeContentView.NoDepartment.swift b/package-kuring/Sources/UIKit/NoticeUI/NoticeContentView.NoDepartment.swift index ed6cb470..3e13913a 100644 --- a/package-kuring/Sources/UIKit/NoticeUI/NoticeContentView.NoDepartment.swift +++ b/package-kuring/Sources/UIKit/NoticeUI/NoticeContentView.NoDepartment.swift @@ -5,6 +5,7 @@ import Models import SwiftUI +import ColorSet import NoticeFeatures import DepartmentFeatures import ComposableArchitecture @@ -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( @@ -46,7 +47,7 @@ extension NoticeContentView { .foregroundStyle(Color.white) .padding(.horizontal, 36) .padding(.vertical, 16) - .background(Color.accentColor) + .background(ColorSet.primary) .cornerRadius(100) } } diff --git a/package-kuring/Sources/UIKit/NoticeUI/NoticeList.swift b/package-kuring/Sources/UIKit/NoticeUI/NoticeList.swift index 2634302f..c226611f 100644 --- a/package-kuring/Sources/UIKit/NoticeUI/NoticeList.swift +++ b/package-kuring/Sources/UIKit/NoticeUI/NoticeList.swift @@ -12,57 +12,72 @@ struct NoticeList: View { @Bindable var store: StoreOf var body: some View { - Section { - List(self.store.currentNotices, id: \.id) { notice in - NavigationLink( - state: NoticeAppFeature.Path.State.detail( - NoticeDetailFeature.State( - notice: notice, - isBookmarked: self.store.bookmarkIDs.contains(notice.id) - ) - ) - ) { - NoticeRow( - notice: notice, - bookmarked: self.store.bookmarkIDs.contains(notice.id) - ) - .listRowInsets(EdgeInsets()) - .onAppear { - let type = self.store.provider - let noticeInfo = self.store.noticeDictionary[type] - - /// 마지막 공지가 보이면 update - if noticeInfo?.notices.last == notice { - self.store.send(.fetchNotices) + ScrollView { + LazyVStack(spacing: 0) { + ForEach(self.store.currentNotices, id: \.id) { notice in + ZStack { + NavigationLink( + state: NoticeAppFeature.Path.State.detail( + NoticeDetailFeature.State( + notice: notice, + isBookmarked: self.store.bookmarkIDs.contains(notice.id) + ) + ) + ) { + EmptyView() } - } - .swipeActions(edge: .leading) { - Button { - self.store.send(.bookmarkTapped(notice)) - } label: { - Image(systemName: self.store.bookmarkIDs.contains(notice.id) - ? "bookmark.slash" - : "bookmark" - ) + .opacity(0) + + Section { + LazyVStack(spacing: 0) { + NoticeRow( + notice: notice, + bookmarked: self.store.bookmarkIDs.contains(notice.id) + ) + .listRowInsets(.init(top: 0, leading: 0, bottom: 0, trailing: 0)) + .onAppear { + let type = self.store.provider + let noticeInfo = self.store.noticeDictionary[type] + + /// 마지막 공지가 보이면 update + if noticeInfo?.notices.last == notice { + self.store.send(.fetchNotices) + } + } + .swipeActions(edge: .leading) { + Button { + self.store.send(.bookmarkTapped(notice)) + } label: { + Image(systemName: self.store.bookmarkIDs.contains(notice.id) + ? "bookmark.slash" + : "bookmark" + ) + } + .tint(Color.accentColor) + } + + Divider() + .frame(height: 1) + } + + } header: { + if self.store.provider.category == .학과 { + DepartmentSelectorLink( + department: self.store.provider, + isLoading: $store.isLoading.sending(\.loadingChanged) + ) { + self.store.send(.changeDepartmentButtonTapped) + } + } else { + EmptyView() + } } - .tint(Color.accentColor) + .navigationTitle("") + } } } - .listStyle(.plain) - } header: { - if self.store.provider.category == .학과 { - DepartmentSelectorLink( - department: self.store.provider, - isLoading: $store.isLoading.sending(\.loadingChanged) - ) { - self.store.send(.changeDepartmentButtonTapped) - } - } else { - EmptyView() - } } - .navigationTitle("") } } diff --git a/package-kuring/Sources/UIKit/NoticeUI/NoticeRow.swift b/package-kuring/Sources/UIKit/NoticeUI/NoticeRow.swift index 181db6c9..55022f00 100644 --- a/package-kuring/Sources/UIKit/NoticeUI/NoticeRow.swift +++ b/package-kuring/Sources/UIKit/NoticeUI/NoticeRow.swift @@ -6,6 +6,7 @@ import Caches import Models import SwiftUI +import ColorSet import ComposableArchitecture public struct NoticeRow: View { @@ -48,7 +49,8 @@ public struct NoticeRow: View { ZStack { switch rowType { case .important, .importantAndBookmark: - Color.accentColor.opacity(0.1) + ColorSet.primary.opacity(0.1) + .ignoresSafeArea() default: Color.clear } @@ -70,10 +72,13 @@ public struct NoticeRow: View { .padding(.horizontal, 20) .padding(.bottom, 12) case .important: - VStack(alignment: .leading, spacing: 4) { - importantTagView - titleView - dateView + HStack(alignment: .top, spacing: 0) { + VStack(alignment: .leading, spacing: 4) { + importantTagView + titleView + dateView + } + Spacer() } .padding(.horizontal, 20) .padding(.vertical, 12) @@ -92,7 +97,7 @@ public struct NoticeRow: View { .padding(.horizontal, 20) .padding(.bottom, 12) case .none: - HStack { + HStack(alignment: .top, spacing: 0) { VStack(alignment: .leading, spacing: 4) { titleView dateView @@ -111,13 +116,13 @@ 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) ) } @@ -125,7 +130,7 @@ public struct NoticeRow: View { private var titleView: some View { Text(notice.subject) .font(.system(size: 15, weight: .medium)) - .foregroundStyle(Color.caption1) + .foregroundStyle(ColorSet.body) } @ViewBuilder @@ -133,12 +138,11 @@ public struct NoticeRow: 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() diff --git a/package-kuring/Sources/UIKit/NoticeUI/NoticeTypeColumn.swift b/package-kuring/Sources/UIKit/NoticeUI/NoticeTypeColumn.swift index c7d26cf9..bdf23187 100644 --- a/package-kuring/Sources/UIKit/NoticeUI/NoticeTypeColumn.swift +++ b/package-kuring/Sources/UIKit/NoticeUI/NoticeTypeColumn.swift @@ -5,6 +5,7 @@ import Models import SwiftUI +import ColorSet import ComposableArchitecture public struct NoticeTypeColumn: View { @@ -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 { @@ -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) } diff --git a/package-kuring/Sources/UIKit/OnboardingUI/MyDepartmentSelector/DepartmentSelector.swift b/package-kuring/Sources/UIKit/OnboardingUI/MyDepartmentSelector/DepartmentSelector.swift index 55bb3888..d1b45e47 100644 --- a/package-kuring/Sources/UIKit/OnboardingUI/MyDepartmentSelector/DepartmentSelector.swift +++ b/package-kuring/Sources/UIKit/OnboardingUI/MyDepartmentSelector/DepartmentSelector.swift @@ -6,6 +6,7 @@ import Models import Combine import SwiftUI +import ColorSet import DepartmentUI @Observable @@ -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) diff --git a/package-kuring/Sources/UIKit/SearchUI/SearchView.swift b/package-kuring/Sources/UIKit/SearchUI/SearchView.swift index f1a7de0c..f0f8f14e 100644 --- a/package-kuring/Sources/UIKit/SearchUI/SearchView.swift +++ b/package-kuring/Sources/UIKit/SearchUI/SearchView.swift @@ -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)