Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
84c53d0
Feat: 스크롤 뒤에 첨부된 사진이 보일 수 있게
ksiomng Dec 31, 2024
3c97782
Fix: 필요없는 VStack 지우기
ksiomng Dec 31, 2024
a567547
Feat: 사진 폴라이드 형태로 만들기 (아직 디자인 수정해야함)
ksiomng Dec 31, 2024
c4cf293
Fix: 편지지 위에서만 미니툴바 보이기
ksiomng Dec 31, 2024
b219141
Fix: 스크롤을 해도 인식이 안되는 문제 해결
ksiomng Dec 31, 2024
6016c73
Refactor: 코드정리
ksiomng Dec 31, 2024
90b1797
Fix: 편지가 비어있는데 여러장 있다는 이유로 폰트를 바꿀 수 없음 -> 편지가 다 비어있으면 수정가능
ksiomng Dec 31, 2024
5aba873
Fix: 페이지 보여주는 부분 수정
ksiomng Dec 31, 2024
778264e
Refactor: 노란색 경고가 떠서 최신껄로 수정
ksiomng Dec 31, 2024
5c6ac15
Design: 폴라로이드 사진 형태로 디자인 수정
ksiomng Jan 3, 2025
8518a58
Design: 페이지를 나타내는 부분 디자인 변경
ksiomng Jan 3, 2025
fd0892e
Design: 사이즈 피그마대로 조정
ksiomng Jan 6, 2025
5a13625
Design: 사진은 가운데에 있을 수 있게
ksiomng Jan 6, 2025
1b26ca0
Feat: X 버튼 추가
ksiomng Jan 6, 2025
0d92eb8
Refactor: 하나의 파일에 너무 많은게 들어있어서 분리해줬습니다 . .
ksiomng Jan 6, 2025
28eca63
Fix: 선택된 포토피커 아이템도 삭제
ksiomng Jan 6, 2025
88748f8
Refactor: 필요없는 파일들 삭제
ksiomng Jan 6, 2025
ee3506d
Refactor: 새로운 그룹으로 파일 이동
ksiomng Jan 6, 2025
bca9c68
Refactor: 보기쉽게 파일을 분리함
ksiomng Jan 6, 2025
233ff02
Fix: SwiftUI, Kingfisher 추가
ksiomng Jan 6, 2025
a1b8b7b
Fix: 뷰모델로 보내도되는 변수들 이동
ksiomng Jan 6, 2025
c7c5ec8
Merge pull request #285 from APP-iOS5th/Feat/ImportPhoto
ksiomng Jan 7, 2025
5cd023e
Fix: 필요없는 reset 코드 삭제
ksiomng Jan 7, 2025
5d5f98f
Update README.md
YuleGlycerine Jan 12, 2025
1523fce
Merge pull request #287 from APP-iOS5th/develop-Readme
the-hye Jan 15, 2025
d005f48
Refactor: `DataSource` 열거형 케이스 이름을 수정
ksiomng Jan 20, 2025
8f32fa5
Fix: 폰트 선택하는 부분이 안올라와서 이상한 부분들 수정
ksiomng Jan 21, 2025
ce4e613
Feat: 키보드 감지 + 키보드 닫기 버튼 (위치랑 디자인 수정해야함)
ksiomng Jan 21, 2025
78a3ac2
Feat: 키보드가 켜져있을때에만 버튼이 보이게
ksiomng Jan 21, 2025
e1fa339
Design: 버튼 디자인, 위치 변경
ksiomng Jan 21, 2025
64907ac
Chore: 필요없는 프린트문 삭제
ksiomng Jan 21, 2025
13afc37
Merge pull request #290 from APP-iOS5th/Feat/KeyBoardButton
ksiomng Jan 22, 2025
4110013
Feat: Notification Extension 추가, ToastViewModel 추가
the-hye Feb 3, 2025
03ffdc3
Feat: ToastView 수정(ToastViewModel 도입)
the-hye Feb 3, 2025
d4ef11c
Feat: 편지 성공 실패 별 toast 설정
the-hye Feb 3, 2025
6b2ce8e
Fix: 편지 작성하기 토스트 문구 수정
the-hye Feb 3, 2025
0d8265a
Fix: 오타 수정
the-hye Feb 3, 2025
1ed931e
Feat: SE bottom 패딩 조정
the-hye Feb 5, 2025
c1c4695
Update main.yml
jinwoong16 Feb 5, 2025
7f62e1d
Merge pull request #292 from APP-iOS5th/Feature/0403LetterSendToast
the-hye Feb 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Send Discord notification
uses: stegzilla/discord-notify@v2
with:
webhook_url: https://discord.com/api/webhooks/1279764424533610537/ebmxzQxzmoekP7d3UIo6q9e8RuwQKIZMm497Txy12oVvtEdehMedh4jcdH7uZmVbyqtw
webhook_url: https://discord.com/api/webhooks/1336664047818506280/witcWkjuUYR7BrBcc_WE3u0dZjKZfqZDRkfqsL1WwHdcBgj91fcB0vfAeuYwBLgpxFMs
title: New PR opened
message: "**${{ github.event.pull_request.title }}**\n**Creator:** ${{ github.event.pull_request.user.login }}\n${{ github.event.pull_request.html_url }}"
include_image: true
Expand Down
66 changes: 55 additions & 11 deletions Kabinett.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ struct ImportDialog: View {
Button("촬영하기") {
viewModel.hideOptions()
viewModel.showCamera = true
envelopeStampSelectionViewModel.reset()
}
Button("앨범에서 가져오기") {
viewModel.hideOptions()
viewModel.showPhotoLibrary = true
envelopeStampSelectionViewModel.reset()
}
Button("취소", role: .cancel) {
viewModel.showImportDialog = false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// Extension+NotificationName.swift
// Kabinett
//
// Created by JIHYE SEOK on 2/3/25.
//

import Foundation

extension Notification.Name {
static let showToast = Notification.Name("showToast")
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ struct ImagePreview: View {
}
.padding(.horizontal, UIScreen.main.bounds.width * 0.06)
}
.padding(.bottom, LayoutHelper.shared.getSize(forSE: 0.03, forOthers: 0.0))
}
.navigationTitle("")
.navigationBarTitleDisplayMode(.inline)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,17 @@ struct LetterCompletionView: View {
customTabViewModel.navigateToLetterBox()
dismiss()
customTabViewModel.selectedTab = 0
envelopeStampSelectionViewModel.reset()

Task {
if viewModel.postScript == nil {
viewModel.postScript = letterContent.postScript
}

let success = await viewModel.saveImportingImage()
if !success {
print("Failed to save letter")
}
NotificationCenter.default.post(
name: .showToast,
object: nil,
userInfo: success ? ["message": "편지가 성공적으로 보관되었어요.", "color": Color.primary900] : ["message": "앗..!! 편지 보관을 실패했어요..", "color": Color.alert])
}
}) {
Text("편지 보관하기")
Expand All @@ -157,6 +157,7 @@ struct LetterCompletionView: View {
.cornerRadius(16)
}
.padding(.horizontal, UIScreen.main.bounds.width * 0.06)
.padding(.bottom, LayoutHelper.shared.getSize(forSE: 0.03, forOthers: 0.0))
.disabled(viewModel.isLoading)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ struct LetterWritingView: View {
letterContent.toUserName = viewModel.toUserName
letterContent.date = viewModel.date
letterContent.photoContents = viewModel.photoContents
letterContent.dataSource = .fromImagePicker
letterContent.dataSource = .importLetter
}
}

Expand Down
16 changes: 5 additions & 11 deletions Kabinett/Presentation/View/LetterBox/Components/ToastView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,20 @@
import SwiftUI

struct ToastView: View {
let message: String
@Binding var showToast: Bool

@ObservedObject var toastViewModel: ToastViewModel
@State private var actualCurrentOffset: CGSize = CGSize(width: 0, height: UIScreen.main.bounds.height)

var body: some View {
if showToast {
if toastViewModel.showToast {
ZStack {
Rectangle()
.fill(.clear)
.background(.primary900)
.background(toastViewModel.backgroundColor)
.frame(height: 50)
.cornerRadius(28)
.padding(.horizontal, 50)

Text(message)
Text(toastViewModel.message)
.font(.system(size: 16, weight: .heavy))
.foregroundStyle(.white)
}
Expand All @@ -34,15 +32,11 @@ struct ToastView: View {
} completion: {
withAnimation(Animation.easeInOut(duration: 1.5).delay(1.2)) {
actualCurrentOffset = CGSize(width: 0, height: UIScreen.main.bounds.height)
showToast = false
toastViewModel.showToast = false
}
}
}
.padding(.bottom, LayoutHelper.shared.getSize(forSE: 0.01, forOthers: 0.01))
}
}
}

#Preview {
ToastView(message: "카비넷 팀이 보낸 편지가 도착했어요.", showToast: .constant(true))
}
3 changes: 2 additions & 1 deletion Kabinett/Presentation/View/LetterBox/LetterBoxView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct LetterBoxView: View {

@StateObject private var calendarViewModel = CalendarViewModel()
@StateObject private var searchBarViewModel = SearchBarViewModel()
@StateObject private var toastViewModel = ToastViewModel()

@ObservedObject var customTabViewModel: CustomTabViewModel

Expand Down Expand Up @@ -57,7 +58,7 @@ struct LetterBoxView: View {

VStack {
Spacer()
ToastView(message: "카비넷 팀의 편지가 도착했어요.", showToast: $letterBoxViewModel.showToast)
ToastView(toastViewModel: toastViewModel)
}
}
.onAppear() {
Expand Down
68 changes: 68 additions & 0 deletions Kabinett/Presentation/View/WriteLetter/Cells/EnvelopeCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//
// EnvelopeCell.swift
// Kabinett
//
// Created by Song Kim on 1/6/25.
//

import SwiftUI
import Kingfisher

struct EnvelopeCell: View {
@Binding var letterContent: LetterWriteModel
@Binding var envelopeImageUrl: String
@ObservedObject var viewModel: EnvelopeStampSelectionViewModel

var body: some View {
ZStack {
Color(.background).ignoresSafeArea()

VStack {
List {
ForEach(0..<viewModel.envelopeNumberOfRows, id: \.self) { rowIndex in
HStack {
ForEach(0..<2, id: \.self) { columnIndex in
let index = viewModel.envelopeIndex(row: rowIndex, column: columnIndex)

if index < viewModel.envelopes.count {
ZStack(alignment: .topTrailing) {
KFImage(URL(string: viewModel.envelopes[index]))
.placeholder {
ProgressView()
}
.resizable()
.aspectRatio(9/4, contentMode: .fit)
.padding(10)
.shadow(color: Color(.primary300), radius: 5, x: 3, y: 3)
.onTapGesture {
viewModel.envelopeSelectStationery(coordinates: (rowIndex, columnIndex))
envelopeImageUrl = viewModel.envelopes[index]
letterContent.envelopeImageUrlString = viewModel.envelopes[index]
}

if viewModel.isEnvelopeSelected(coordinates: (rowIndex, columnIndex)) {
Image("checked")
.resizable()
.frame(width: 27, height: 27)
.padding([.top, .trailing], 20)
.onAppear {
letterContent.envelopeImageUrlString = viewModel.envelopes[viewModel.envelopeIndex(row: rowIndex, column: columnIndex)]
}
}
}
}
}
}
.listRowBackground(Color.clear)
.listRowSeparator(.hidden)
.listRowInsets(EdgeInsets())
.padding(.top, 10)
}
}
.listStyle(.plain)
.padding(.leading, -10)
.padding(.trailing, -5)
}
}
}
}
68 changes: 68 additions & 0 deletions Kabinett/Presentation/View/WriteLetter/Cells/StampCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//
// StampCell.swift
// Kabinett
//
// Created by Song Kim on 1/6/25.
//

import SwiftUI
import Kingfisher

struct StampCell: View {
@Binding var letterContent: LetterWriteModel
@Binding var stampImageUrl: String
@ObservedObject var viewModel: EnvelopeStampSelectionViewModel

var body: some View {
ZStack {
Color(.background).ignoresSafeArea()

VStack {
List {
ForEach(0..<viewModel.stampNumberOfRows, id: \.self) { rowIndex in
HStack {
ForEach(0..<3, id: \.self) { columnIndex in
let index = viewModel.stampIndex(row: rowIndex, column: columnIndex)

if index < viewModel.stamps.count {
ZStack(alignment: .topTrailing) {
KFImage(URL(string: viewModel.stamps[index]))
.placeholder {
ProgressView()
}
.resizable()
.aspectRatio(9/9.7, contentMode: .fit)
.padding(10)
.shadow(color: Color(.primary300), radius: 5, x: 3, y: 3)
.onTapGesture {
viewModel.stampSelectStationery(coordinates: (rowIndex, columnIndex))
stampImageUrl = viewModel.stamps[index]
letterContent.stampImageUrlString = viewModel.stamps[index]
}

if viewModel.isStampSelected(coordinates: (rowIndex, columnIndex)) {
Image("checked")
.resizable()
.frame(width: 27, height: 27)
.padding([.top, .trailing], 20)
.onAppear {
letterContent.stampImageUrlString = viewModel.stamps[viewModel.stampIndex(row: rowIndex, column: columnIndex)]
}
}
}
}
}
}
.listRowBackground(Color.clear)
.listRowSeparator(.hidden)
.listRowInsets(EdgeInsets())
.padding(.top, 10)
}
}
.listStyle(.plain)
.padding(.leading, -10)
.padding(.trailing, -5)
}
}
}
}
48 changes: 48 additions & 0 deletions Kabinett/Presentation/View/WriteLetter/Cells/StationeryCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
// StationeryCell.swift
// Kabinett
//
// Created by Song Kim on 1/6/25.
//

import SwiftUI
import Kingfisher

struct StationeryCell: View {
let index: Int
let rowIndex: Int
let columnIndex: Int
@Binding var letterContent: LetterWriteModel
@ObservedObject var stationerySelectionViewModel: StationerySelectionViewModel

var body: some View {
ZStack(alignment: .topTrailing) {
if stationerySelectionViewModel.stationerys.indices.contains(index) {
KFImage(URL(string: stationerySelectionViewModel.stationerys[index]))
.placeholder {
ProgressView()
}
.resizable()
.aspectRatio(9/13, contentMode: .fit)
.padding(10)
.shadow(color: Color(.primary300), radius: 5, x: 3, y: 3)
.onTapGesture {
stationerySelectionViewModel.selectStationery(coordinates: (rowIndex, columnIndex))
letterContent.stationeryImageUrlString = stationerySelectionViewModel.stationerys[index]
}
} else {
EmptyView()
}

if stationerySelectionViewModel.isSelected(coordinates: (rowIndex, columnIndex)) {
Image("checked")
.resizable()
.frame(width: 32, height: 32)
.padding([.top, .trailing], 20)
.onAppear {
letterContent.stationeryImageUrlString = stationerySelectionViewModel.stationerys[index]
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ struct WriteLetterEnvelopeCell: View {
)
}
}

}
Loading