diff --git a/SodaLive/Resources/Assets.xcassets/ic_logo2.imageset/Contents.json b/SodaLive/Resources/Assets.xcassets/ic_logo2.imageset/Contents.json new file mode 100644 index 0000000..30b2b0d --- /dev/null +++ b/SodaLive/Resources/Assets.xcassets/ic_logo2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_logo2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SodaLive/Resources/Assets.xcassets/ic_logo2.imageset/ic_logo2.png b/SodaLive/Resources/Assets.xcassets/ic_logo2.imageset/ic_logo2.png new file mode 100644 index 0000000..c13cfe6 Binary files /dev/null and b/SodaLive/Resources/Assets.xcassets/ic_logo2.imageset/ic_logo2.png differ diff --git a/SodaLive/Sources/App/AppStep.swift b/SodaLive/Sources/App/AppStep.swift index 8438f71..72b2a98 100644 --- a/SodaLive/Sources/App/AppStep.swift +++ b/SodaLive/Sources/App/AppStep.swift @@ -113,4 +113,6 @@ enum AppStep { case contentRankingAll case creatorCommunityAll(creatorId: Int) + + case creatorCommunityWrite } diff --git a/SodaLive/Sources/Content/Create/ContentCreateView.swift b/SodaLive/Sources/Content/Create/ContentCreateView.swift index a7d46fb..037d869 100644 --- a/SodaLive/Sources/Content/Create/ContentCreateView.swift +++ b/SodaLive/Sources/Content/Create/ContentCreateView.swift @@ -522,11 +522,11 @@ struct SelectButtonView: View { Text(title) .font(.custom(Font.bold.rawValue, size: 14.7)) - .foregroundColor(isChecked ? .white : Color(hex: "9970ff")) + .foregroundColor(isChecked ? .white : Color(hex: "80D8FF")) } .frame(height: 48.7) .frame(maxWidth: .infinity) - .background(isChecked ? Color(hex: "9970ff") : Color(hex: "1f1734")) + .background(isChecked ? Color(hex: "3BB9F1") : Color(hex: "13181B")) .cornerRadius(6.7) .onTapGesture { hideKeyboard() diff --git a/SodaLive/Sources/ContentView.swift b/SodaLive/Sources/ContentView.swift index 811ff24..1bfb065 100644 --- a/SodaLive/Sources/ContentView.swift +++ b/SodaLive/Sources/ContentView.swift @@ -166,6 +166,9 @@ struct ContentView: View { case .creatorCommunityAll(let creatorId): CreatorCommunityAllView(creatorId: creatorId) + case .creatorCommunityWrite: + CreatorCommunityWriteView() + default: EmptyView() .frame(width: 0, height: 0, alignment: .topLeading) diff --git a/SodaLive/Sources/Explorer/Profile/CreatorCommunity/Write/CreatorCommunityWriteView.swift b/SodaLive/Sources/Explorer/Profile/CreatorCommunity/Write/CreatorCommunityWriteView.swift new file mode 100644 index 0000000..e7a1621 --- /dev/null +++ b/SodaLive/Sources/Explorer/Profile/CreatorCommunity/Write/CreatorCommunityWriteView.swift @@ -0,0 +1,178 @@ +// +// CreatorCommunityWriteView.swift +// SodaLive +// +// Created by klaus on 2023/12/15. +// + +import SwiftUI + +struct CreatorCommunityWriteView: View { + + @StateObject var keyboardHandler = KeyboardHandler() + + var body: some View { + BaseView { + GeometryReader { proxy in + ZStack { + VStack(spacing: 0) { + DetailNavigationBar(title: "게시글 등록") + + ScrollView(.vertical, showsIndicators: false) { + VStack(spacing: 0) { + VStack(spacing: 0) { + Text("이미지") + .font(.custom(Font.bold.rawValue, size: 16.7)) + .foregroundColor(Color(hex: "eeeeee")) + .frame(maxWidth: .infinity, alignment: .leading) + + ZStack { + Image("ic_logo2") + .resizable() + .scaledToFit() + .padding(13.3) + .frame(width: 107, height: 107) + .background(Color(hex: "13181B")) + .cornerRadius(8) + + Image("ic_camera") + .padding(10) + .background(Color(hex: "3BB9F1")) + .cornerRadius(30) + .offset(x: 50, y: 36) + } + .frame(alignment: .bottomTrailing) + + HStack(alignment: .top, spacing: 0) { + Text("※ ") + .font(.custom(Font.medium.rawValue, size: 13.3)) + .foregroundColor(Color(hex: "777777")) + + Text("등록할 이미지가 없으면 이미지 없이 게시글만 등록 하셔도 됩니다.") + .font(.custom(Font.medium.rawValue, size: 13.3)) + .foregroundColor(Color(hex: "777777")) + } + .frame(maxWidth: .infinity, alignment: .leading) + .padding(.top, 24) + + HStack(spacing: 0) { + Text("내용") + .font(.custom(Font.bold.rawValue, size: 16.7)) + .foregroundColor(Color(hex: "eeeeee")) + + Spacer() + + Text("0자") + .font(.custom(Font.medium.rawValue, size: 13.3)) + .foregroundColor(Color(hex: "ff5c49")) + + Text(" / 최대 500자") + .font(.custom(Font.medium.rawValue, size: 13.3)) + .foregroundColor(Color(hex: "777777")) + } + .padding(.top, 26.7) + + TextViewWrapper( + text: .constant(""), + placeholder: "내용을 입력하세요", + textColorHex: "eeeeee", + backgroundColorHex: "222222" + ) + .frame(height: 184) + .cornerRadius(6.7) + .padding(.top, 13.3) + + VStack(spacing: 13.3) { + Text("댓글 가능 여부") + .font(.custom(Font.bold.rawValue, size: 16.7)) + .foregroundColor(Color(hex: "eeeeee")) + .frame(maxWidth: .infinity, alignment: .leading) + + HStack(spacing: 13.3) { + SelectButtonView(title: "댓글 가능", isChecked: true) { + } + + SelectButtonView(title: "댓글 불가", isChecked: false) { + } + } + } + .padding(.top, 26.7) + + VStack(spacing: 13.3) { + Text("연령 제한") + .font(.custom(Font.bold.rawValue, size: 16.7)) + .foregroundColor(Color(hex: "eeeeee")) + .frame(maxWidth: .infinity, alignment: .leading) + + HStack(spacing: 13.3) { + SelectButtonView(title: "전체 연령", isChecked: true) { + } + + SelectButtonView(title: "19세 이상", isChecked: false) { + } + } + } + .padding(.top, 26.7) + } + .padding(13.3) + + VStack(spacing: 0) { + HStack(spacing: 13.3) { + Text("닫기") + .font(.custom(Font.bold.rawValue, size: 18.3)) + .foregroundColor(Color(hex: "3BB9F1")) + .frame(maxWidth: .infinity) + .frame(height: 50) + .background(Color(hex: "13181B")) + .cornerRadius(10) + .overlay( + RoundedRectangle(cornerRadius: 8) + .stroke(Color(hex: "3BB9F1"), lineWidth: 1) + ) + .onTapGesture { + hideKeyboard() + } + + Text("등록") + .font(.custom(Font.bold.rawValue, size: 18.3)) + .foregroundColor(Color.white) + .frame(maxWidth: .infinity) + .frame(height: 50) + .background(Color(hex: "3BB9F1")) + .cornerRadius(10) + .onTapGesture { + hideKeyboard() + } + } + .padding(13.3) + .frame(maxWidth: .infinity) + .background(Color(hex: "222222")) + .cornerRadius(16.7, corners: [.topLeft, .topRight]) + + Rectangle() + .foregroundColor(Color(hex: "222222")) + .frame(height: keyboardHandler.keyboardHeight) + .frame(maxWidth: .infinity) + + if proxy.safeAreaInsets.bottom > 0 { + Rectangle() + .foregroundColor(Color(hex: "222222")) + .frame(height: 15.3) + .frame(maxWidth: .infinity) + } + } + .padding(.top, 100) + } + } + } + } + .edgesIgnoringSafeArea(.bottom) + } + } + } +} + +struct CreatorCommunityWriteView_Previews: PreviewProvider { + static var previews: some View { + CreatorCommunityWriteView() + } +} diff --git a/SodaLive/Sources/Explorer/Profile/UserProfileView.swift b/SodaLive/Sources/Explorer/Profile/UserProfileView.swift index 3b6acf1..4a26e06 100644 --- a/SodaLive/Sources/Explorer/Profile/UserProfileView.swift +++ b/SodaLive/Sources/Explorer/Profile/UserProfileView.swift @@ -63,6 +63,9 @@ struct UserProfileView: View { LazyHStack(spacing: 13.3) { if UserDefaults.int(forKey: .userId) == creatorProfile.creator.creatorId { CreatorCommunityWriteItemView() + .onTapGesture { + AppState.shared.setAppStep(step: .creatorCommunityWrite) + } } CreatorCommunityItemView()