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] 다크모드 전부 적용 및 학과 공지 UI 버그 및 다크모드 색상 적용을 위한 UI 수정 #158

Merged
merged 11 commits into from
Mar 24, 2024
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "7f5095b25e2d0a629176f0ebc41ee16d8e7d8c6c0e326ede18f4df4abbe75d63",
"originHash" : "a70bf5bcda18b73a91398005590ea6f3e124d517cc68deffb3c56506da7c3f07",
"pins" : [
{
"identity" : "abseil-cpp-binary",
Expand Down
5 changes: 5 additions & 0 deletions package-kuring/Sources/Labs/ExperimentList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the 'License.txt' file for licensing information.
//

import ColorSet
import ComposableArchitecture

@Reducer
Expand Down Expand Up @@ -39,6 +40,7 @@ public struct ExperimentList: View {
}
.padding(.vertical, 9)
.listRowSeparator(.hidden)
.listRowBackground(ColorSet.bg)

NavigationLink(
state: LabAppFeature.Path.State.appIcon(
Expand All @@ -49,8 +51,11 @@ public struct ExperimentList: View {
}
.padding(.vertical, 9)
.listRowSeparator(.hidden)
.listRowBackground(ColorSet.bg)
}
.listStyle(.plain)
.background(ColorSet.bg)

}

public init(store: StoreOf<ExperimentListFeature>) {
Expand Down
3 changes: 2 additions & 1 deletion package-kuring/Sources/Labs/Experiments/AppIconDetail.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the 'License.txt' file for licensing information.
//

import ColorSet
import ComposableArchitecture

@Reducer
Expand Down Expand Up @@ -61,7 +62,7 @@ public struct AppIconDetailView: View {
Text(store.description)

Toggle("기능 활성화", isOn: $store.isEnabled)
.tint(Color.accentColor)
.tint(ColorSet.primary)
}
}
.navigationTitle(store.title)
Expand Down
3 changes: 2 additions & 1 deletion package-kuring/Sources/Labs/Experiments/BetaADetail.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the 'License.txt' file for licensing information.
//

import ColorSet
import ComposableArchitecture

@Reducer
Expand Down Expand Up @@ -60,7 +61,7 @@ public struct BetaADetailView: View {
Text(store.description)

Toggle("기능 활성화", isOn: $store.isEnabled)
.tint(Color.accentColor)
.tint(ColorSet.primary)
}
}
.navigationTitle(store.title)
Expand Down
21 changes: 14 additions & 7 deletions package-kuring/Sources/UIKit/BookmarkUI/BookmarkList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ public struct BookmarkList: View {
topBlurButton(
"삭제하기",
fontColor: store.selectedIDs.isEmpty
? Color.accentColor.opacity(0.4)
: .white,
? ColorSet.primary.opacity(0.4)
: .white,
backgroundColor: store.selectedIDs.isEmpty
? Color.accentColor.opacity(0.15)
: Color.accentColor
? ColorSet.primary.opacity(0.15)
: ColorSet.primary
)
}
.padding(.horizontal, 20)
Expand Down Expand Up @@ -122,7 +122,7 @@ public struct BookmarkList: View {
)
}
.disabled(store.bookmarkedNotices.isEmpty)
.foregroundStyle(Color.accentColor)
.foregroundStyle(ColorSet.primary)
}
}
}
Expand All @@ -143,8 +143,15 @@ public struct BookmarkList: View {
.background(backgroundColor)
.cornerRadius(100)
.background {
LinearGradient(gradient: Gradient(colors: [.white.opacity(0.1), .white]), startPoint: .top, endPoint: .bottom)
.offset(x: 0, y: -32)
LinearGradient(
gradient: Gradient(colors: [
ColorSet.bg.opacity(0.1),
ColorSet.bg.opacity(0.1),
ColorSet.primary.opacity(0.1)
]),
startPoint: .top, endPoint: .bottom
)
.offset(x: 0, y: -32)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public struct DepartmentEditor: View {
.focused($focus, equals: .search)
.autocorrectionDisabled()
.bind($store.focus, to: self.$focus)
.background(ColorSet.gray300)

if !store.searchText.isEmpty {
Image(systemName: "xmark")
Expand All @@ -45,7 +44,7 @@ public struct DepartmentEditor: View {
}
.padding(.horizontal, 16)
.padding(.vertical, 7)
.background(Color(red: 0.95, green: 0.95, blue: 0.96))
.background(ColorSet.gray100)
.cornerRadius(20)
.padding(.bottom, 16)

Expand Down Expand Up @@ -94,7 +93,7 @@ public struct DepartmentEditor: View {
Button("전체 삭제") {
store.send(.deleteAllMyDepartmentButtonTapped)
}
.tint(.accentColor)
.tint(ColorSet.primary)
.disabled(store.myDepartments.isEmpty)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public struct DepartmentRow: View {
case .delete:
Button(action: action) {
Text("삭제")
.foregroundStyle(Color.caption1.opacity(0.6))
.foregroundStyle(ColorSet.caption1)
}
case let .radio(isSelected):
Button(action: action) {
Expand Down
25 changes: 16 additions & 9 deletions package-kuring/Sources/UIKit/DepartmentUI/DepartmentSelector.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 @@ -16,7 +17,7 @@ public struct DepartmentSelector: View {
HStack(alignment: .center, spacing: 10) {
Text("대표 학과 선택")
.font(.system(size: 18, weight: .bold))
.foregroundStyle(Color.black)
.foregroundStyle(ColorSet.title)
}
.padding(.horizontal, 20)
.padding(.top, 24)
Expand All @@ -28,7 +29,7 @@ public struct DepartmentSelector: View {
HStack {
Text(department.korName)
.font(.system(size: 16, weight: .medium))
.foregroundStyle(.black)
.foregroundStyle(ColorSet.body)

Spacer()

Expand All @@ -39,14 +40,13 @@ public struct DepartmentSelector: View {
)
.foregroundStyle(
department == store.currentDepartment
? Color.accentColor
: Color.black.opacity(0.1)
? ColorSet.primary
: ColorSet.gray200
)
.frame(width: 20, height: 20)
}
.padding(.horizontal, 20)
.padding(.vertical, 12)
.background(.white)
.onTapGesture {
store.send(.selectDepartment(id: department.id))
}
Expand All @@ -58,8 +58,8 @@ public struct DepartmentSelector: View {
} label: {
topBlurButton(
"내 학과 편집하기",
fontColor: Color.accentColor,
backgroundColor: Color.accentColor.opacity(0.15)
fontColor: ColorSet.body,
backgroundColor: ColorSet.primary
)
}
.padding(.horizontal, 20)
Expand All @@ -82,8 +82,15 @@ public struct DepartmentSelector: View {
.background(backgroundColor)
.cornerRadius(100)
.background {
LinearGradient(gradient: Gradient(colors: [.white.opacity(0.1), .white]), startPoint: .top, endPoint: .bottom)
.offset(x: 0, y: -32)
LinearGradient(
gradient: Gradient(colors: [
ColorSet.bg.opacity(0.1),
ColorSet.bg.opacity(0.1),
ColorSet.primary.opacity(0.1)
]),
startPoint: .top, endPoint: .bottom
)
.offset(x: 0, y: -32)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import Models
import SwiftUI
import ColorSet

struct DepartmentSelectorLink: View {
let department: NoticeProvider
Expand All @@ -15,7 +16,7 @@ struct DepartmentSelectorLink: View {
HStack {
Text(department.korName)
.font(.system(size: 18, weight: .semibold))
.foregroundStyle(Color.black.opacity(0.8))
.foregroundStyle(ColorSet.title)

Spacer()

Expand Down
38 changes: 19 additions & 19 deletions package-kuring/Sources/UIKit/NoticeUI/NoticeList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,26 @@
//

import SwiftUI
import ColorSet
import DepartmentUI
import NoticeFeatures
import ComposableArchitecture

struct NoticeList: View {
@Bindable var store: StoreOf<NoticeListFeature>

var body: some View {
ScrollView {
LazyVStack(spacing: 0) {
VStack(spacing: 0) {
if self.store.provider.category == .학과 {
DepartmentSelectorLink(
department: self.store.provider,
isLoading: $store.isLoading.sending(\.loadingChanged)
) {
self.store.send(.changeDepartmentButtonTapped)
}
}

ForEach(self.store.currentNotices, id: \.id) { notice in
ZStack {
NavigationLink(
Expand All @@ -29,7 +39,7 @@ struct NoticeList: View {
.opacity(0)

Section {
LazyVStack(spacing: 0) {
VStack(spacing: 0) {
NoticeRow(
notice: notice,
bookmarked: self.store.bookmarkIDs.contains(notice.id)
Expand All @@ -48,29 +58,19 @@ struct NoticeList: View {
Button {
self.store.send(.bookmarkTapped(notice))
} label: {
Image(systemName: self.store.bookmarkIDs.contains(notice.id)
? "bookmark.slash"
: "bookmark"
)
Image(
systemName: self.store.bookmarkIDs.contains(notice.id)
? "bookmark.slash"
: "bookmark"
)
}
.tint(Color.accentColor)
.tint(ColorSet.primary)
}

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()
}
}
.navigationTitle("")

Expand Down
6 changes: 1 addition & 5 deletions package-kuring/Sources/UIKit/NoticeUI/NoticeRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ public struct NoticeRow: View {
}
}

@ViewBuilder
private var importantTagView: some View {
Text("중요")
.font(.system(size: 12, weight: .semibold))
Expand All @@ -126,27 +125,24 @@ public struct NoticeRow: View {
)
}

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

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

@ViewBuilder
private var bookmarkView: some View {
ZStack {
RoundedRectangle(cornerRadius: 2)
.compositingGroup()
.foregroundStyle(Color.accentColor)
.foregroundStyle(ColorSet.primary)
.frame(width: 16, height: 21)

RoundedRectangle(cornerRadius: 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//

import SwiftUI
import ColorSet

// TODO: 디자인 시스템으로 이동
struct KuringButtonStyle: ButtonStyle {
Expand All @@ -18,7 +19,7 @@ struct KuringButtonStyle: ButtonStyle {
.foregroundStyle(
onEnabled
? .white
: Color.accentColor.opacity(0.4)
: ColorSet.primary.opacity(0.4)
)

Spacer()
Expand All @@ -28,8 +29,8 @@ struct KuringButtonStyle: ButtonStyle {
.frame(height: 50, alignment: .center)
.background(
onEnabled
? Color.accentColor
: Color.accentColor.opacity(0.15)
? ColorSet.primary
: ColorSet.primary.opacity(0.15)
)
.cornerRadius(100)
}
Expand Down
Loading