Skip to content

Commit

Permalink
[2.0.0] 공지 디테일 네비게이션 타이틀에서 카테고리 정보 보여주도록 수정 (#198)
Browse files Browse the repository at this point in the history
* [추가] 공지 디테일 네비 타이틀에서 카테고리 정보 보여주도록 수정
- 단, 학과의 경우 어느 학과인지 보여주지 못하고 "학과" 로 명시 (기술부채)
* [수정] 테스트용 공지 데이터 값 수정
  • Loading branch information
x-0o0 authored Apr 5, 2024
1 parent cb89aa4 commit bd8491e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
10 changes: 5 additions & 5 deletions package-kuring/Sources/Models/Notice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ extension Notice.DecodingError: LocalizedError {
extension Notice {
public static var random: Notice {
Notice(
articleId: "5b4924e",
postedDate: "20211109",
subject: "교내 출입문 3곳(상허문, 일감문, 건국문) 차량 통제 안내 - 2022학년도 수시모집 논술고사일 - ",
url: "https://www.konkuk.ac.kr/do/MessageBoard/ArticleRead.do?id=5b4924e",
category: "normal",
articleId: "5389",
postedDate: "2024-02-21",
subject: "2024학년도 신입생 입학식 개최 안내",
url: "https://www.konkuk.ac.kr/bbs/konkuk/234/5389/artclView.do",
category: "bachelor",
important: false
)
}
Expand Down
1 change: 0 additions & 1 deletion package-kuring/Sources/UIKit/NoticeUI/NoticeApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public struct NoticeApp: View {
case .detail:
if let store = store.scope(state: \.detail, action: \.detail) {
NoticeDetailView(store: store)
.navigationBarTitleDisplayMode(.inline)
}
case .search:
if let store = store.scope(state: \.search, action: \.search) {
Expand Down
10 changes: 7 additions & 3 deletions package-kuring/Sources/UIKit/NoticeUI/NoticeDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ import ComposableArchitecture
public struct NoticeDetailView: View {
@Bindable var store: StoreOf<NoticeDetailFeature>

var noticeProvider: NoticeProvider? {
NoticeProvider.univNoticeTypes.first { $0.name == store.notice.category }
?? NoticeProvider.departments.first { $0.name == store.notice.category }
}

public var body: some View {
WebView(urlString: store.notice.url)
.background(Color.Kuring.bg)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .principal) {
Text(store.notice.subject)
.font(.system(size: 12))
Text(noticeProvider?.korName ?? "")
}

ToolbarItemGroup(placement: .topBarTrailing) {
Expand Down Expand Up @@ -56,6 +61,5 @@ public struct NoticeDetailView: View {
reducer: { NoticeDetailFeature() }
)
)
.navigationTitle("Notice Detail View")
}
}

0 comments on commit bd8491e

Please sign in to comment.