diff --git "a/Icon\r" "b/Icon\r"
new file mode 100644
index 0000000..e69de29
diff --git a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/AddPhotoIcon.imageset/Contents.json b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/AddPhotoIcon.imageset/Contents.json
new file mode 100644
index 0000000..006a8fa
--- /dev/null
+++ b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/AddPhotoIcon.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "사진 추가 아이콘.svg",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git "a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/AddPhotoIcon.imageset/\354\202\254\354\247\204 \354\266\224\352\260\200 \354\225\204\354\235\264\354\275\230.svg" "b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/AddPhotoIcon.imageset/\354\202\254\354\247\204 \354\266\224\352\260\200 \354\225\204\354\235\264\354\275\230.svg"
new file mode 100644
index 0000000..06d5eac
--- /dev/null
+++ "b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/AddPhotoIcon.imageset/\354\202\254\354\247\204 \354\266\224\352\260\200 \354\225\204\354\235\264\354\275\230.svg"
@@ -0,0 +1,3 @@
+
diff --git a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/DislikeIcon.imageset/Contents.json b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/DislikeIcon.imageset/Contents.json
new file mode 100644
index 0000000..e2a131f
--- /dev/null
+++ b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/DislikeIcon.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "싫어요 아이콘.svg",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git "a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/DislikeIcon.imageset/\354\213\253\354\226\264\354\232\224 \354\225\204\354\235\264\354\275\230.svg" "b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/DislikeIcon.imageset/\354\213\253\354\226\264\354\232\224 \354\225\204\354\235\264\354\275\230.svg"
new file mode 100644
index 0000000..0d13354
--- /dev/null
+++ "b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/DislikeIcon.imageset/\354\213\253\354\226\264\354\232\224 \354\225\204\354\235\264\354\275\230.svg"
@@ -0,0 +1,3 @@
+
diff --git a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/LikeIcon.imageset/Contents.json b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/LikeIcon.imageset/Contents.json
new file mode 100644
index 0000000..3087ec8
--- /dev/null
+++ b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/LikeIcon.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "좋아요 아이콘.svg",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git "a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/LikeIcon.imageset/\354\242\213\354\225\204\354\232\224 \354\225\204\354\235\264\354\275\230.svg" "b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/LikeIcon.imageset/\354\242\213\354\225\204\354\232\224 \354\225\204\354\235\264\354\275\230.svg"
new file mode 100644
index 0000000..9f0c39d
--- /dev/null
+++ "b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/LikeIcon.imageset/\354\242\213\354\225\204\354\232\224 \354\225\204\354\235\264\354\275\230.svg"
@@ -0,0 +1,3 @@
+
diff --git a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/LinkIcon.imageset/Contents.json b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/LinkIcon.imageset/Contents.json
new file mode 100644
index 0000000..159376f
--- /dev/null
+++ b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/LinkIcon.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "음악 링크 연결 아이콘.svg",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git "a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/LinkIcon.imageset/\354\235\214\354\225\205 \353\247\201\355\201\254 \354\227\260\352\262\260 \354\225\204\354\235\264\354\275\230.svg" "b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/LinkIcon.imageset/\354\235\214\354\225\205 \353\247\201\355\201\254 \354\227\260\352\262\260 \354\225\204\354\235\264\354\275\230.svg"
new file mode 100644
index 0000000..ba62c96
--- /dev/null
+++ "b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/LinkIcon.imageset/\354\235\214\354\225\205 \353\247\201\355\201\254 \354\227\260\352\262\260 \354\225\204\354\235\264\354\275\230.svg"
@@ -0,0 +1,3 @@
+
diff --git a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/PlayListIcon.imageset/Contents.json b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/PlayListIcon.imageset/Contents.json
new file mode 100644
index 0000000..c741989
--- /dev/null
+++ b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/PlayListIcon.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "플레이 리스트 아이콘.svg",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git "a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/PlayListIcon.imageset/\355\224\214\353\240\210\354\235\264 \353\246\254\354\212\244\355\212\270 \354\225\204\354\235\264\354\275\230.svg" "b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/PlayListIcon.imageset/\355\224\214\353\240\210\354\235\264 \353\246\254\354\212\244\355\212\270 \354\225\204\354\235\264\354\275\230.svg"
new file mode 100644
index 0000000..57865a6
--- /dev/null
+++ "b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/PlayListIcon.imageset/\355\224\214\353\240\210\354\235\264 \353\246\254\354\212\244\355\212\270 \354\225\204\354\235\264\354\275\230.svg"
@@ -0,0 +1,3 @@
+
diff --git a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/image 2.imageset/Contents.json b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/image 2.imageset/Contents.json
new file mode 100644
index 0000000..b4fba87
--- /dev/null
+++ b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/image 2.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "image 2.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/image 2.imageset/image 2.png b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/image 2.imageset/image 2.png
new file mode 100644
index 0000000..2be813b
Binary files /dev/null and b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/image 2.imageset/image 2.png differ
diff --git a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/image 3.imageset/Contents.json b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/image 3.imageset/Contents.json
new file mode 100644
index 0000000..974c6fe
--- /dev/null
+++ b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/image 3.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "image 3.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/image 3.imageset/image 3.png b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/image 3.imageset/image 3.png
new file mode 100644
index 0000000..73109c8
Binary files /dev/null and b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/image 3.imageset/image 3.png differ
diff --git a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/preButton.imageset/Contents.json b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/preButton.imageset/Contents.json
new file mode 100644
index 0000000..b5167b3
--- /dev/null
+++ b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/preButton.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "뒤로 가기 아이콘.svg",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git "a/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/preButton.imageset/\353\222\244\353\241\234 \352\260\200\352\270\260 \354\225\204\354\235\264\354\275\230.svg" "b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/preButton.imageset/\353\222\244\353\241\234 \352\260\200\352\270\260 \354\225\204\354\235\264\354\275\230.svg"
new file mode 100644
index 0000000..82d7c2f
--- /dev/null
+++ "b/Targets/Plda/Resources/Preview Content/Preview Assets.xcassets/preButton.imageset/\353\222\244\353\241\234 \352\260\200\352\270\260 \354\225\204\354\235\264\354\275\230.svg"
@@ -0,0 +1,3 @@
+
diff --git a/Targets/Plda/Sources/Shared/DesignSystem/ButtonStyle.swift b/Targets/Plda/Sources/Shared/DesignSystem/ButtonStyle.swift
new file mode 100644
index 0000000..c9c1174
--- /dev/null
+++ b/Targets/Plda/Sources/Shared/DesignSystem/ButtonStyle.swift
@@ -0,0 +1,30 @@
+//
+// ButtonStyle.swift
+// Plda
+//
+// Created by 김채빈 on 2023/08/30.
+// Copyright © 2023 alom.com. All rights reserved.
+//
+
+import SwiftUI
+
+struct roundedRectangleBorder: ButtonStyle {
+ var backgroundColor: Color = .lightGreen
+ var foregroundColor: Color = .white
+
+ func makeBody(configuration: Configuration) -> some View {
+ configuration.label
+ .frame(width: 350, height: 38)
+ .background(backgroundColor)
+ .cornerRadius(12)
+ .font(.bold16)
+ .foregroundColor(foregroundColor)
+ }
+}
+
+struct roundedRectangleBorder_Previews: PreviewProvider {
+ static var previews: some View {
+ Button("Hello"){}
+ .buttonStyle(roundedRectangleBorder())
+ }
+}
diff --git a/Targets/Plda/Sources/Shared/Managers/FontManager.swift b/Targets/Plda/Sources/Shared/Managers/FontManager.swift
index 17b4771..39e0c53 100644
--- a/Targets/Plda/Sources/Shared/Managers/FontManager.swift
+++ b/Targets/Plda/Sources/Shared/Managers/FontManager.swift
@@ -11,17 +11,17 @@ import SwiftUI
extension Font {
// ExtraBold
- static let extraBold: Font = .custom("Pretendard-ExtraBold", size: 36)
+ static let extraBold: Font = PldaFontFamily.Pretendard.extraBold.swiftUIFont(size: 36)
// Bold
- static let bold24: Font = .custom("Pretendard-Bold", size: 24)
- static let bold16: Font = .custom("Pretendard-Bold", size: 16)
+ static let bold24: Font = PldaFontFamily.Pretendard.bold.swiftUIFont(size: 24)
+ static let bold16: Font = PldaFontFamily.Pretendard.bold.swiftUIFont(size: 16)
// SemiBold
- static let semiBold: Font = .custom("Pretendard-SemiBold", size: 20)
+ static let semiBold: Font = PldaFontFamily.Pretendard.semiBold.swiftUIFont(size: 20)
// Medium
- static let medium16: Font = .custom("Pretendard-Medium", size: 16)
- static let medium12: Font = .custom("Pretendard-Medium", size: 12)
+ static let medium16: Font = PldaFontFamily.Pretendard.medium.swiftUIFont(size: 16)
+ static let medium12: Font = PldaFontFamily.Pretendard.medium.swiftUIFont(size: 12)
}
diff --git a/Targets/Plda/Sources/Views/DiaryDetailView.swift b/Targets/Plda/Sources/Views/DiaryDetailView.swift
new file mode 100644
index 0000000..6631bff
--- /dev/null
+++ b/Targets/Plda/Sources/Views/DiaryDetailView.swift
@@ -0,0 +1,144 @@
+//
+// SwiftUIView.swift
+// Plda
+//
+// Created by 김채빈 on 2023/08/17.
+// Copyright © 2023 alom.com. All rights reserved.
+//
+
+import SwiftUI
+
+struct RecommendSheetView: View {
+ @Binding var albumCover: String
+ @Binding var albumTitle: String
+ @Binding var albumSubTitle: String
+
+ var body: some View {
+ ZStack{
+ RoundedRectangle(cornerRadius: 40)
+ .fill(Color.darkGreen)
+ .ignoresSafeArea()
+ .offset(y:56)
+
+ RoundedRectangle(cornerRadius: 40)
+ .fill(.white)
+ .ignoresSafeArea()
+ .offset(y:110)
+
+ VStack {
+ Image(albumCover)
+ .frame(width:208, height:208)
+ .cornerRadius(4)
+ .padding(.bottom, 10)
+ HStack {
+ Button(action: {
+
+ }, label: {
+ PldaAsset.PreviewAssets.likeIcon.swiftUIImage
+ })
+
+ VStack {
+ Text(albumTitle)
+ .font(.semiBold)
+ Text(albumSubTitle)
+ .font(.medium12)
+ }
+ .padding(.horizontal, 21)
+
+ Button(action: {
+
+ }, label: {
+ PldaAsset.PreviewAssets.dislikeIcon.swiftUIImage
+ })
+ }
+
+ Button(action: {
+
+ }, label: {
+ PldaAsset.PreviewAssets.linkIcon.swiftUIImage
+ })
+ .padding(.top, 19)
+
+ Button("playlist 확인하러 가기") {}
+ .padding(.top, 19)
+ .buttonStyle(roundedRectangleBorder())
+ }
+ .offset(y:-22)
+ }
+ }
+}
+
+struct DiaryDetailView: View {
+ @State var title : String = ""
+ @State var tag : String = ""
+ @State var content : String = ""
+ @State var diaryimage: UIImage? = nil
+ @State var showsheet : Bool = true
+ @State var albumCover: String
+ @State var albumTitle: String
+ @State var albumSubTitle: String
+
+ var body: some View {
+ VStack() {
+ WritingNavgionBar()
+
+ HStack{
+ Text(title)
+ .padding(.horizontal, 32)
+ .font(.bold24)
+ Spacer()
+ }
+ HStack{
+ Text(tag)
+ .padding(.leading, 30)
+ .font(.medium12)
+ Spacer()
+ Text("20230727")
+ .font(.medium12)
+ .padding(.trailing, 30)
+ }
+ .font(.medium12)
+ .opacity(0.8)
+ Divider()
+ .frame(height: 1)
+ .background(.black)
+ .padding(.horizontal, 20)
+ if let image = diaryimage {
+ Image(uiImage: image)
+ .resizable()
+ .frame(minWidth: 0, maxWidth: 326)
+ .frame(width: 326.0, height: 342.0)
+ .cornerRadius(5)
+ }
+ Text(content)
+ .padding(.horizontal, 30)
+ .scrollContentBackground(.hidden)
+ .font(.medium12)
+ Spacer()
+ Button("일기 수정하기"){}
+ .buttonStyle(roundedRectangleBorder())
+ .padding(.bottom, 13)
+ Button("노래 추천 다시 받기"){}
+ .buttonStyle(roundedRectangleBorder())
+ .padding(.bottom, 100)
+ }
+ .background(PldaAsset.PreviewAssets.background.swiftUIImage
+ .frame(width: .infinity, height: .infinity)
+ .ignoresSafeArea()
+ )
+
+
+
+ .sheet(isPresented: $showsheet) {
+ RecommendSheetView(albumCover: $albumCover, albumTitle: $albumTitle, albumSubTitle: $albumSubTitle)
+ .presentationDetents([.medium])
+ .presentationBackground(.clear)
+ }
+ }
+}
+
+struct DiaryDetailView_Previews: PreviewProvider {
+ static var previews: some View {
+ DiaryDetailView(title: "쌀국수", tag: "#dkjflsf", content: "동네에 쌀국수 맛집을 찾았다. 좀 더 많은 메뉴가 있었으면 더 좋았을 거 같다. 그래도 너무너무 맛있어서 행복했다. 양도 많고 재료도 풍부하고 아주 굿. 다음 번엔 매운 차돌박이 쌀국수를 먹어봐야겠다. 맛있는 하루를 보내 기분이 좋았으나 저녁 때 사건이 발생했다. \n(어쩌고 저쩌고) \n어떻게 해야 좋은 대처였을지 잘 모르겠다. 내일 다시 생각해 봐야겠다.", diaryimage: UIImage(named: PldaAsset.PreviewAssets.image2.name), albumCover: PldaAsset.PreviewAssets.image3.name, albumTitle: "Ice Cream Cake", albumSubTitle: "Red Velvet (레드벨벳)")
+ }
+}
diff --git a/Targets/Plda/Sources/Views/ImagePicker.swift b/Targets/Plda/Sources/Views/ImagePicker.swift
deleted file mode 100644
index 4069ac6..0000000
--- a/Targets/Plda/Sources/Views/ImagePicker.swift
+++ /dev/null
@@ -1,46 +0,0 @@
-import UIKit
-import SwiftUI
-
-struct ImagePicker: UIViewControllerRepresentable {
-
- var sourceType: UIImagePickerController.SourceType = .photoLibrary
-
- @Binding var selectedImage: UIImage
- @Environment(\.presentationMode) private var presentationMode
-
- func makeUIViewController(context: UIViewControllerRepresentableContext) -> UIImagePickerController {
-
- let imagePicker = UIImagePickerController()
- imagePicker.allowsEditing = false
- imagePicker.sourceType = sourceType
- imagePicker.delegate = context.coordinator
-
- return imagePicker
- }
-
- func updateUIViewController(_ uiViewController: UIImagePickerController, context: UIViewControllerRepresentableContext) {
-
- }
-
- func makeCoordinator() -> Coordinator {
- Coordinator(self)
- }
-
- final class Coordinator: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
-
- var parent: ImagePicker
-
- init(_ parent: ImagePicker) {
- self.parent = parent
- }
-
- func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
-
- if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage {
- parent.selectedImage = image
- }
-
- parent.presentationMode.wrappedValue.dismiss()
- }
- }
-}
diff --git a/Targets/Plda/Sources/Views/WritingStore.swift b/Targets/Plda/Sources/Views/WritingStore.swift
new file mode 100644
index 0000000..01b2aca
--- /dev/null
+++ b/Targets/Plda/Sources/Views/WritingStore.swift
@@ -0,0 +1,60 @@
+//
+// WritingStore.swift
+// Plda
+//
+// Created by 김채빈 on 2023/09/04.
+// Copyright © 2023 alom.com. All rights reserved.
+//
+
+import ComposableArchitecture
+import SwiftUI
+
+struct Diary: Equatable, Identifiable {
+ let id: UUID
+ var title: String = ""
+ var tag: String = ""
+ var date: Date = Date()
+ var content: String = ""
+ var imageData: Data? = nil
+ var songTitle: String = ""
+ var singer: String = ""
+ var songCover: Data? = nil
+}
+
+struct WritingStore: Reducer {
+ struct State: Equatable {
+ var diary: Diary
+ }
+
+ enum Action: Equatable {
+ case saveButtonTapped
+ case cancelButtonTapped
+ case setTitle(String)
+ case setTag(String)
+ case setContent(String)
+ }
+ func reduce(into state: inout State, action: Action) -> Effect {
+ switch action {
+ case .saveButtonTapped:
+ return .none
+
+ case .cancelButtonTapped:
+ return .none
+
+ case let .setTitle(title):
+ state.diary.title = title
+ return .none
+
+ case let .setTag(tag):
+ state.diary.tag = tag
+ return .none
+
+ case let .setContent(content):
+ state.diary.content = content
+ return .none
+ }
+ }
+
+
+}
+
diff --git a/Targets/Plda/Sources/Views/WritngView.swift b/Targets/Plda/Sources/Views/WritngView.swift
index 8869bb7..e4810fc 100644
--- a/Targets/Plda/Sources/Views/WritngView.swift
+++ b/Targets/Plda/Sources/Views/WritngView.swift
@@ -6,78 +6,115 @@
//
import SwiftUI
+import PhotosUI
struct WritngView: View {
@State var title : String = ""
@State var tag : String = ""
@State var content : String = ""
- @State var image = UIImage()
- @State private var openPhoto = false
+ @State var isNew: Bool = true
+ @State private var selectedItem: PhotosPickerItem? = nil
+ @State private var selectedImageData: Data? = nil
var body: some View {
- ZStack{
- Image("background")
- .resizable()
- .ignoresSafeArea()
VStack{
WritingNavgionBar()
+
TextField("제목", text: $title)
.padding(.horizontal, 30)
- .font(.system(size: 24))
+ .font(.bold24)
HStack{
TextField("#태그", text: $tag)
.padding(.leading, 30)
- .font(.custom("Pretendard-Medium", size: 12))
+ .font(.medium12)
Spacer()
Text("20230727")
- .font(.custom("Pretendard-Medium", size: 12))
+ .font(.medium12)
.padding(.trailing, 30)
}
- .font(.system(size: 12))
+ .font(.medium12)
.opacity(0.8)
Divider()
.frame(height: 1)
.background(.black)
.padding(.horizontal, 20)
- Image(uiImage: self.image)
+
+ if let selectedImageData,
+ let uiImage = UIImage(data: selectedImageData) {
+ Image(uiImage: uiImage)
.resizable()
.frame(minWidth: 0, maxWidth: 326)
.frame(width: 326.0, height: 342.0)
.cornerRadius(5)
+ }
+
TextEditor(text: $content)
.padding(.horizontal, 30)
.scrollContentBackground(.hidden)
.font(.custom("Pretendard-Medium", size: 12))
+ .font(.medium12)
.toolbar{
ToolbarItem(placement: .keyboard) {
- Button(action: {
- self.openPhoto = true
- }) {
- Image("AddImage")
- }
- .sheet(isPresented: $openPhoto) {
- ImagePicker(sourceType: .photoLibrary, selectedImage: self.$image)
- }
+ PhotosPicker(
+ selection: $selectedItem,
+ matching: .images,
+ photoLibrary: .shared()) {
+ Button(action: {
+
+ }) {
+ Image("AddImage")
+ }
+ }
+ .onChange(of: selectedItem) { newItem in
+ Task {
+ if let data = try? await newItem?.loadTransferable(type: Data.self) {
+ selectedImageData = data
+ }
+ }
+ }
}
}
Spacer()
+ if isNew {
+ Button("노래 들을 준비 완료!"){}
+ .buttonStyle(roundedRectangleBorder())
+ .padding(.bottom, 13)
+ Button("조금 더 작성할래요."){}
+ .buttonStyle(roundedRectangleBorder(backgroundColor: .gray10, foregroundColor: .black))
+ .padding(.bottom, 100)
+ }
+ else {
+ Button("일기 수정하기"){}
+ .buttonStyle(roundedRectangleBorder())
+ .padding(.bottom, 13)
+ Button("노래 추천 다시 받기"){}
+ .buttonStyle(roundedRectangleBorder(backgroundColor: .lightGreen))
+ .padding(.bottom, 100)
+ }
+
}
+ .background(
+ PldaAsset.PreviewAssets.background.swiftUIImage
+ .frame(width: .infinity, height: .infinity)
+ .ignoresSafeArea())
}
- }
+
}
struct WritingNavgionBar: View{
- @State var showingAlert: Bool = false
+ @State var showingExitAlert: Bool = false
+ @State var showingSaveAlert: Bool = false
+ @State var diaryCnt: Int = 1
var body: some View {
HStack{
Button(action: {
- showingAlert = true
+ showingExitAlert = true
}, label: {
- Image("preBtn")
+ PldaAsset.PreviewAssets.preButton.swiftUIImage
})
.padding(.leading, 20)
- .alert(isPresented: $showingAlert) {
+ .alert(isPresented: $showingExitAlert) {
Alert(
title: Text("잠깐! 지금 나가면 일기가 저장되지 않아요."),
message: Text("그래도 나갈까요?"),
@@ -87,11 +124,17 @@ struct WritingNavgionBar: View{
Spacer()
Button(action: {
-
+// showingSaveAlert = true
}, label: {
- Image("PlaylistIcon")
+ PldaAsset.PreviewAssets.playListIcon.swiftUIImage
})
.padding(.trailing, 20)
+// .alert(isPresented: $showingSaveAlert) {
+// Alert(
+// title: Text("노래 추천을 다시 할까요?"),
+// message: Text("노래 추천은 하루 3회 가능해요.(\(diaryCnt)/3)"),
+// primaryButton: .destructive(Text("네, 다시 추천 받을래요.")), secondaryButton: .cancel(Text("아니요, 잘못 눌렀어요.")))
+// }
}
.padding(.bottom, 13)
.padding(.top, 15)