diff --git a/package-kuring/Sources/Features/NoticeFeatures/NoticeList.swift b/package-kuring/Sources/Features/NoticeFeatures/NoticeList.swift index f57267b7..47789ab3 100644 --- a/package-kuring/Sources/Features/NoticeFeatures/NoticeList.swift +++ b/package-kuring/Sources/Features/NoticeFeatures/NoticeList.swift @@ -156,7 +156,7 @@ public struct NoticeListFeature { return .send(.fetchNotices) case .fetchNotices: - if state.provider == .emptyDepartment { + if state.provider == .emptyDepartment || state.provider.hostPrefix == "ccd" { return .none } state.isLoading = true diff --git a/package-kuring/Sources/Networks/Depdencies/KuringLink.Dependency.swift b/package-kuring/Sources/Networks/Depdencies/KuringLink.Dependency.swift index 22d7780d..10cfc316 100644 --- a/package-kuring/Sources/Networks/Depdencies/KuringLink.Dependency.swift +++ b/package-kuring/Sources/Networks/Depdencies/KuringLink.Dependency.swift @@ -203,6 +203,14 @@ extension KuringLink: DependencyKey { category: .학과 ) } + NoticeProvider.departments.append( + NoticeProvider( + name: "communication_design", + hostPrefix: "ccd", + korName: "커뮤니케이션디자인학과", + category: .학과 + ) + ) return NoticeProvider.departments }, registerAuthorization: { diff --git a/package-kuring/Sources/UIKit/DepartmentUI/DepartmentEditor.swift b/package-kuring/Sources/UIKit/DepartmentUI/DepartmentEditor.swift index c877e8e9..4a16dc5c 100644 --- a/package-kuring/Sources/UIKit/DepartmentUI/DepartmentEditor.swift +++ b/package-kuring/Sources/UIKit/DepartmentUI/DepartmentEditor.swift @@ -61,28 +61,32 @@ public struct DepartmentEditor: View { // 내학과 ScrollView { ForEach(store.myDepartments) { myDepartment in - DepartmentRow( - department: myDepartment, - style: .delete - ) { + Button(action: { store.send(.deleteMyDepartmentButtonTapped(id: myDepartment.id)) - } + }, label: { + DepartmentRow( + department: myDepartment, + style: .delete + ) + }) } } } else { // 검색결과 ScrollView { ForEach(store.searchResults) { result in - DepartmentRow( - department: result, - style: .radio(store.myDepartments.contains(result)) - ) { + Button(action: { if store.myDepartments.contains(result) { store.send(.cancelAdditionButtonTapped(id: result.id)) } else { store.send(.addDepartmentButtonTapped(id: result.id)) } - } + }, label: { + DepartmentRow( + department: result, + style: .radio(store.myDepartments.contains(result)) + ) + }) } } } diff --git a/package-kuring/Sources/UIKit/DepartmentUI/DepartmentRow.swift b/package-kuring/Sources/UIKit/DepartmentUI/DepartmentRow.swift index 323d7ed9..fe0f92af 100644 --- a/package-kuring/Sources/UIKit/DepartmentUI/DepartmentRow.swift +++ b/package-kuring/Sources/UIKit/DepartmentUI/DepartmentRow.swift @@ -12,7 +12,6 @@ import DepartmentFeatures public struct DepartmentRow: View { public let department: NoticeProvider public let style: ButtonStyle - public let action: () -> Void public enum ButtonStyle { case delete @@ -33,33 +32,28 @@ public struct DepartmentRow: View { switch style { case .delete: - Button(action: action) { - Text("삭제") - .foregroundStyle(Color.Kuring.caption1) - } + Text("삭제") + .foregroundStyle(Color.Kuring.caption1) case let .radio(isSelected): - Button(action: action) { - Image( - systemName: isSelected - ? "checkmark.circle.fill" - : "plus.circle" - ) - .foregroundStyle( - isSelected - ? Color.Kuring.primary - : Color.Kuring.gray200 - ) - } + Image( + systemName: isSelected + ? "checkmark.circle.fill" + : "plus.circle" + ) + .foregroundStyle( + isSelected + ? Color.Kuring.primary + : Color.Kuring.gray200 + ) } } .padding(.horizontal, 4) .padding(.vertical, 10) } - public init(department: NoticeProvider, style: ButtonStyle, action: @escaping () -> Void) { + public init(department: NoticeProvider, style: ButtonStyle) { self.department = department self.style = style - self.action = action } /// 대표 학과 여부를 나타내는 칩 @@ -76,10 +70,10 @@ public struct DepartmentRow: View { #Preview { Group { - DepartmentRow(department: .국제, style: .delete) { } + DepartmentRow(department: .국제, style: .delete) - DepartmentRow(department: .국제, style: .radio(true)) { } + DepartmentRow(department: .국제, style: .radio(true)) - DepartmentRow(department: .국제, style: .radio(false)) { } + DepartmentRow(department: .국제, style: .radio(false)) } } diff --git a/package-kuring/Sources/UIKit/NoticeUI/NoticeApp.swift b/package-kuring/Sources/UIKit/NoticeUI/NoticeApp.swift index 35112e9d..a7e0af97 100644 --- a/package-kuring/Sources/UIKit/NoticeUI/NoticeApp.swift +++ b/package-kuring/Sources/UIKit/NoticeUI/NoticeApp.swift @@ -38,7 +38,7 @@ public struct NoticeApp: View { SearchFeature.State() ) ) { - Image(systemName: "magnifyingglass") + Image("magnifyingglass", bundle: Bundle.notices) .foregroundStyle(Color.Kuring.gray400) } } @@ -49,7 +49,7 @@ public struct NoticeApp: View { Button { store.send(.changeSubscriptionButtonTapped) } label: { - Image(systemName: "bell") + Image("bell", bundle: Bundle.notices) .foregroundStyle(Color.Kuring.gray400) } } diff --git a/package-kuring/Sources/UIKit/NoticeUI/NoticeContentView.NoDepartment.swift b/package-kuring/Sources/UIKit/NoticeUI/NoticeContentView.NoDepartment.swift index 7bda463a..0788bfea 100644 --- a/package-kuring/Sources/UIKit/NoticeUI/NoticeContentView.NoDepartment.swift +++ b/package-kuring/Sources/UIKit/NoticeUI/NoticeContentView.NoDepartment.swift @@ -33,6 +33,20 @@ extension NoticeContentView { Spacer() } } + + @ViewBuilder + func CannotFetchDepartmentView() -> some View { + VStack(spacing: 32) { + Spacer() + + Text("홈페이지 사정 상,\n공지를 불러올 수 없는 학과예요.") + .font(.system(size: 15, weight: .medium)) + .multilineTextAlignment(.center) + .foregroundStyle(Color.Kuring.caption2) + + Spacer() + } + } // TODO: 디자인 시스템 분리 /// 상단에 블러가 존재하는 버튼 diff --git a/package-kuring/Sources/UIKit/NoticeUI/NoticeContentView.swift b/package-kuring/Sources/UIKit/NoticeUI/NoticeContentView.swift index fd728f40..0eaab0bc 100644 --- a/package-kuring/Sources/UIKit/NoticeUI/NoticeContentView.swift +++ b/package-kuring/Sources/UIKit/NoticeUI/NoticeContentView.swift @@ -25,6 +25,24 @@ struct NoticeContentView: View { if self.store.provider == .emptyDepartment { NoDepartmentView() + } + // MARK: 커뮤니케이션디자인학과의 경우에만 예외로 다른 화면을 넣어줘야 함 + else if self.store.provider.hostPrefix == "ccd" { + Section { + CannotFetchDepartmentView() + } header: { + VStack(spacing: 0) { + DepartmentSelectorLink( + department: self.store.provider, + isLoading: $store.isLoading.sending(\.loadingChanged) + ) { + self.store.send(.changeDepartmentButtonTapped) + } + + Divider() + .frame(height: 0.25) + } + } } else { NoticeList(store: self.store) } diff --git a/package-kuring/Sources/UIKit/NoticeUI/NoticeDetailView.swift b/package-kuring/Sources/UIKit/NoticeUI/NoticeDetailView.swift index 5c7028e1..083284ea 100644 --- a/package-kuring/Sources/UIKit/NoticeUI/NoticeDetailView.swift +++ b/package-kuring/Sources/UIKit/NoticeUI/NoticeDetailView.swift @@ -32,17 +32,16 @@ public struct NoticeDetailView: View { Button { self.store.send(.bookmarkButtonTapped) } label: { - Image( - systemName: self.store.isBookmarked - ? "bookmark.fill" - : "bookmark" + Image(self.store.isBookmarked + ? "bookmark-fill" + : "bookmark", bundle: Bundle.notices ) } ShareLink( item: store.notice.url ) { - Image(systemName: "square.and.arrow.up") + Image("share", bundle: Bundle.notices) } } } diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/Contents.json b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/Contents.json b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bell.imageset/Contents.json b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bell.imageset/Contents.json new file mode 100644 index 00000000..c2ca9dbd --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bell.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "bell.svg", + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "bell-dark.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bell.imageset/bell-dark.svg b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bell.imageset/bell-dark.svg new file mode 100644 index 00000000..bf2c786a --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bell.imageset/bell-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bell.imageset/bell.svg b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bell.imageset/bell.svg new file mode 100644 index 00000000..3d2be962 --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bell.imageset/bell.svg @@ -0,0 +1,3 @@ + + + diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark-fill.imageset/Contents.json b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark-fill.imageset/Contents.json new file mode 100644 index 00000000..765df388 --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark-fill.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "bookmark-fill.svg", + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "bookmark-fill-dark.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark-fill.imageset/bookmark-fill-dark.svg b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark-fill.imageset/bookmark-fill-dark.svg new file mode 100644 index 00000000..c067fbe8 --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark-fill.imageset/bookmark-fill-dark.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark-fill.imageset/bookmark-fill.svg b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark-fill.imageset/bookmark-fill.svg new file mode 100644 index 00000000..796b2029 --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark-fill.imageset/bookmark-fill.svg @@ -0,0 +1,3 @@ + + + diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark.imageset/Contents.json b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark.imageset/Contents.json new file mode 100644 index 00000000..5983469c --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "bookmark.svg", + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "bookmark-dark.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark.imageset/bookmark-dark.svg b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark.imageset/bookmark-dark.svg new file mode 100644 index 00000000..3123b51d --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark.imageset/bookmark-dark.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark.imageset/bookmark.svg b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark.imageset/bookmark.svg new file mode 100644 index 00000000..23a29375 --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/bookmark.imageset/bookmark.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/magnifyingglass.imageset/Contents.json b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/magnifyingglass.imageset/Contents.json new file mode 100644 index 00000000..981dc20d --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/magnifyingglass.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "mag.svg", + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "mag-dark.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/magnifyingglass.imageset/mag-dark.svg b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/magnifyingglass.imageset/mag-dark.svg new file mode 100644 index 00000000..c4804706 --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/magnifyingglass.imageset/mag-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/magnifyingglass.imageset/mag.svg b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/magnifyingglass.imageset/mag.svg new file mode 100644 index 00000000..78703d49 --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/magnifyingglass.imageset/mag.svg @@ -0,0 +1,3 @@ + + + diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/share.imageset/Contents.json b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/share.imageset/Contents.json new file mode 100644 index 00000000..3c2dc710 --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/share.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "share.svg", + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "share-dark.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/share.imageset/share-dark.svg b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/share.imageset/share-dark.svg new file mode 100644 index 00000000..1af71529 --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/share.imageset/share-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/share.imageset/share.svg b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/share.imageset/share.svg new file mode 100644 index 00000000..fb460d1c --- /dev/null +++ b/package-kuring/Sources/UIKit/NoticeUI/Resources/Symbols.xcassets/navigation/share.imageset/share.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/package-kuring/Sources/UIKit/OnboardingUI/MyDepartmentSelector/DepartmentSelector.swift b/package-kuring/Sources/UIKit/OnboardingUI/MyDepartmentSelector/DepartmentSelector.swift index dc5ce51d..46fcf106 100644 --- a/package-kuring/Sources/UIKit/OnboardingUI/MyDepartmentSelector/DepartmentSelector.swift +++ b/package-kuring/Sources/UIKit/OnboardingUI/MyDepartmentSelector/DepartmentSelector.swift @@ -94,12 +94,14 @@ struct DepartmentSelector: View { ScrollView { ForEach(finder.results) { result in - DepartmentRow( - department: result, - style: .radio(false) - ) { + Button(action: { selectedDepartment = result - } + }, label: { + DepartmentRow( + department: result, + style: .radio(false) + ) + }) } }