-
Notifications
You must be signed in to change notification settings - Fork 1
[Feat-T3-201] 제보 히스토리 화면 구현 (1차) #69
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // | ||
| // ReportProgress.swift | ||
| // Domain | ||
| // | ||
| // Created by 이동현 on 11/15/25. | ||
| // | ||
|
|
||
| public enum ReportProgress: CaseIterable { | ||
| case entire | ||
| case received | ||
| case inProgress | ||
| case completed | ||
|
|
||
| public var description: String { | ||
| switch self { | ||
| case .entire: | ||
| "전체" | ||
| case .received: | ||
| "제보 완료" | ||
| case .inProgress: | ||
| "처리 중" | ||
| case .completed: | ||
| "처리 완료" | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| // | ||
| // ReportHistoryItem.swift | ||
| // Presentation | ||
| // | ||
| // Created by 이동현 on 11/19/25. | ||
| // | ||
|
|
||
| import Domain | ||
|
|
||
| struct ReportHistoryItem: Hashable { | ||
| let id: Int | ||
| let title: String | ||
| let thumbnailUrl: String | ||
| let date: String | ||
| let type: ReportType | ||
| let progress: ReportProgress | ||
| let location: String | ||
| } | ||
|
|
||
| extension ReportHistoryItem { | ||
| static var dummyData: [ReportHistoryItem] { | ||
| let types = ReportType.allCases | ||
| let progresses = ReportProgress.allCases.filter { $0 != .entire } | ||
|
|
||
| func makeItem( | ||
| id: Int, | ||
| title: String, | ||
| date: String, | ||
| location: String, | ||
| typeIndex: Int, | ||
| progressIndex: Int | ||
| ) -> ReportHistoryItem { | ||
| let type = types[typeIndex % types.count] | ||
| let progress = progresses[progressIndex % progresses.count] | ||
|
|
||
| return ReportHistoryItem( | ||
| id: id, | ||
| title: title, | ||
| thumbnailUrl: "https://picsum.photos/200", | ||
| date: date, | ||
| type: type, | ||
| progress: progress, | ||
| location: location | ||
| ) | ||
| } | ||
|
|
||
| return [ | ||
| makeItem( | ||
| id: 1, | ||
| title: "횡단보도 앞 가로등 불이 꺼져 있어요", | ||
| date: "2025-11-19월", | ||
| location: "서울시 강남구 삼성동", | ||
| typeIndex: 0, | ||
| progressIndex: 0 | ||
| ), | ||
| makeItem( | ||
| id: 2, | ||
| title: "지하철 역사 계단 난간이 파손되었어요", | ||
| date: "2025-11-19월", | ||
| location: "서울시 송파구 잠실동", | ||
| typeIndex: 1, | ||
| progressIndex: 1 | ||
| ), | ||
|
|
||
| // 다른 날짜 | ||
| makeItem( | ||
| id: 3, | ||
| title: "공원 놀이터 바닥이 파여 있어 위험해요", | ||
| date: "2025-11-18월", | ||
| location: "서울시 마포구 상암동", | ||
| typeIndex: 2, | ||
| progressIndex: 2 | ||
| ), | ||
| makeItem( | ||
| id: 4, | ||
| title: "버스 정류장 안내판 조명이 나갔습니다", | ||
| date: "2025-11-18월", | ||
| location: "서울시 서초구 서초동", | ||
| typeIndex: 3, | ||
| progressIndex: 0 | ||
| ), | ||
|
|
||
| makeItem( | ||
| id: 5, | ||
| title: "자전거 도로에 불법 주차된 차량이 있어요", | ||
| date: "2025-11-17월", | ||
| location: "서울시 노원구 공릉동", | ||
| typeIndex: 1, | ||
| progressIndex: 1 | ||
| ), | ||
| makeItem( | ||
| id: 6, | ||
| title: "보도블럭이 들떠서 걸려 넘어질 위험이 있어요", | ||
| date: "2025-11-16월", | ||
| location: "서울시 종로구 종로1가", | ||
| typeIndex: 0, | ||
| progressIndex: 2 | ||
| ), | ||
|
|
||
| makeItem( | ||
| id: 7, | ||
| title: "교차로 신호등이 고장난 것 같습니다", | ||
| date: "2025-11-16월", | ||
| location: "서울시 동작구 사당동", | ||
| typeIndex: 2, | ||
| progressIndex: 0 | ||
| ), | ||
| makeItem( | ||
| id: 8, | ||
| title: "지하차도에 물이 고여 있어요", | ||
| date: "2025-11-15월", | ||
| location: "서울시 영등포구 영등포동", | ||
| typeIndex: 3, | ||
| progressIndex: 1 | ||
| ) | ||
| ] | ||
| } | ||
|
Comment on lines
+21
to
+117
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 더미 데이터의 날짜 형식을 확인해주세요. 더미 데이터의 모든 날짜가 "월"(월요일) 요일 접미사를 가지고 있습니다. 예를 들어 2025-11-19, 2025-11-18, 2025-11-17 등 서로 다른 날짜임에도 모두 "월"로 표시되어 있어 실제 요일과 일치하지 않을 수 있습니다. UI 검증을 위해 다양한 요일 표현(월, 화, 수 등)을 사용하는 것이 좋겠습니다. 참고: PR 설명에 언급된 대로, UI 완성 시 이 더미 데이터는 제거 예정입니다. 날짜별로 올바른 요일을 계산하는 헬퍼 함수를 생성하는 것이 도움이 될까요? 🤖 Prompt for AI Agents |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| // | ||
| // ReportProgressItem.swift | ||
| // Presentation | ||
| // | ||
| // Created by 이동현 on 11/17/25. | ||
| // | ||
|
|
||
| import Domain | ||
| import Foundation | ||
|
|
||
| struct ReportProgressItem: Hashable { | ||
| let uuid: UUID | ||
| let progress: ReportProgress | ||
| let count: Int | ||
| var isSelected: Bool | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| // | ||
| // ReportHistoryTableHeaderView.swift | ||
| // Presentation | ||
| // | ||
| // Created by 이동현 on 11/15/25. | ||
| // | ||
|
|
||
| import SnapKit | ||
| import UIKit | ||
|
|
||
| final class ReportHistoryTableHeaderView: UITableViewHeaderFooterView { | ||
| private enum Layout { | ||
| static let labelHeight: CGFloat = 20 | ||
| static let weekLabelLeadingSpacing: CGFloat = 2 | ||
| } | ||
|
|
||
| private let dateLabel = UILabel() | ||
| private let weekLabel = UILabel() | ||
|
|
||
| override init(reuseIdentifier: String?) { | ||
| super.init(reuseIdentifier: reuseIdentifier) | ||
|
|
||
| configureAttribute() | ||
| configureLayout() | ||
| } | ||
|
|
||
| required init?(coder: NSCoder) { | ||
| fatalError("init(coder:) has not been implemented") | ||
| } | ||
|
|
||
| private func configureAttribute() { | ||
| backgroundColor = .clear | ||
|
|
||
| dateLabel.textColor = BitnagilColor.gray10 | ||
| dateLabel.font = BitnagilFont.init(style: .body2, weight: .semiBold).font | ||
|
|
||
| weekLabel.textColor = BitnagilColor.gray40 | ||
| weekLabel.font = BitnagilFont.init(style: .body2, weight: .medium).font | ||
| } | ||
|
|
||
| private func configureLayout() { | ||
| contentView.addSubview(dateLabel) | ||
| contentView.addSubview(weekLabel) | ||
|
|
||
| dateLabel.snp.makeConstraints { make in | ||
| make.leading.equalToSuperview() | ||
| make.top.equalToSuperview() | ||
| make.height.equalTo(Layout.labelHeight) | ||
| } | ||
|
|
||
| weekLabel.snp.makeConstraints { make in | ||
| make.top.equalToSuperview() | ||
|
|
||
| make.leading | ||
| .equalTo(dateLabel.snp.trailing) | ||
| .offset(Layout.weekLabelLeadingSpacing) | ||
|
|
||
| make.height.equalTo(Layout.labelHeight) | ||
| } | ||
| } | ||
|
|
||
| func configure(with dateString: String) { | ||
| guard let weekCharacter = dateString.last else { | ||
| dateLabel.text = dateString | ||
| weekLabel.text = nil | ||
| return | ||
| } | ||
|
|
||
| let datePart = String(dateString.dropLast()) | ||
| dateLabel.text = datePart | ||
| weekLabel.text = String(weekCharacter) | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.