Skip to content

Commit

Permalink
✨ :: [#70] ProgramView Publishing 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Xixn2 committed Dec 22, 2024
1 parent f62e898 commit b8cbb48
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import SwiftUI

struct ExpoCreateView: View {
@Environment(\.dismiss) var dismiss
@State private var titleTextField: String = ""
@State private var descriptionTextField: String = ""
@State private var locationTextField: String = ""
Expand All @@ -24,21 +23,8 @@ struct ExpoCreateView: View {
@StateObject var viewModel: ExpoCreateViewModel

var body: some View {
ZStack {
HStack(spacing: 0) {
Button {
dismiss()
} label: {
ExpoIOSAsset.Assets.leftBackButton.swiftUIImage
.padding(.leading, 4)
}
Text("박람회 생성하기")

Spacer()
}

Text("박람회 생성하기")
.expoFont(.body1R)
}

ScrollView {
VStack(alignment: .leading, spacing: 0) {
Expand Down Expand Up @@ -322,19 +308,19 @@ struct ExpoCreateView: View {
Spacer()
}
.sheet(isPresented: $isImagePickerPresented) {
ImagePicker(selectedImage: $selectedImage)
ImagePicker(selectedImage: $selectedImage)
}
}
.navigationBarBackButtonHidden()
}

private var isFormValid: Bool {
return !titleTextField.isEmpty &&
!descriptionTextField.isEmpty &&
!locationTextField.isEmpty &&
!locationDetailTextField.isEmpty &&
date.allSatisfy { $0.count == 10 } &&
selectedImage != nil
!descriptionTextField.isEmpty &&
!locationTextField.isEmpty &&
!locationDetailTextField.isEmpty &&
date.allSatisfy { $0.count == 10 } &&
selectedImage != nil
}

func convertImageToBase64String(image: UIImage) -> String? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,82 @@ struct ProgramView: View {
VStack(spacing: 0) {
nameTime()

ForEach(1..<6, id: \.self) { index in
ForEach(1..<8, id: \.self) { index in
ExpoProgram(programNum: index, programName: "테스트", startTime: "2024-09-12 T 08:30")
}
Spacer()

Rectangle()
.expoColor(ExpoColor.gray600)
.frame(height: 0.7)
.padding(.bottom, 37)

ExpoButton(
text: "프로그램 더보기",
horizontalPadding: 12,
verticalPadding: 8,
backColor: ExpoColor.main300.swiftUIColor,
actionColor: ExpoColor.main500.swiftUIColor
)

HStack(spacing: 10) {
ExpoIOSAsset.Assets.warning.swiftUIImage
Text("옆으로 넘겨서 확인해보세요")
.expoFont(.caption2R)
.expoColor(ExpoColor.gray300)
}
.padding(.top, 17)
.padding(.bottom, 35)
}
.padding(.top, 24)
.tag(false)

Text("dd")
.tag(true)
VStack(spacing: 0) {
nameTime()

ForEach(1..<5, id: \.self) { index in
ExpoProgram(programNum: index, programName: "테스트", startTime: "2024-09-12 T 08:30")
}

Spacer()

Rectangle()
.expoColor(ExpoColor.gray600)
.frame(height: 0.7)
.padding(.bottom, 37)

ExpoButton(
text: "프로그램 더보기",
horizontalPadding: 12,
verticalPadding: 8,
backColor: ExpoColor.main300.swiftUIColor,
actionColor: ExpoColor.main500.swiftUIColor
)

HStack(spacing: 10) {
ExpoIOSAsset.Assets.warning.swiftUIImage
Text("옆으로 넘겨서 확인해보세요")
.expoFont(.caption2R)
.expoColor(ExpoColor.gray300)
}
.padding(.top, 17)
.padding(.bottom, 35)
}
.padding(.top, 24)
.tag(true)
}
.tabViewStyle(.page(indexDisplayMode: .never))

Spacer()
}


}
}

@ViewBuilder
func nameTime() -> some View {
VStack(spacing: 10) {
VStack(spacing: 16) {
Rectangle()
.expoColor(ExpoColor.gray600)
.frame(height: 0.7)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,35 @@ import SwiftUI

struct TabBarView: View {
@State private var selectedTab = 1

// 뷰 모델을 @StateObject로 선언
@StateObject private var expoCreateViewModel = ExpoCreateViewModel()

var body: some View {
TabView(selection: $selectedTab) {
// 홈 탭
MainView()
.tabItem {
Image(selectedTab == 1 ? "onHome" : "offHome")
Text("")
}
.tag(1)

// 박람회 명단 탭
MainView()
.tabItem {
Image(selectedTab == 2 ? "onCheck" : "offCheck")
Text("박람회 명단")
}
.tag(2)

// 박람회 생성 탭
ExpoCreateView(viewModel: ExpoCreateViewModel())
ExpoCreateView(viewModel: expoCreateViewModel)
.tabItem {
Image(selectedTab == 3 ? "onExpo" : "offExpo")
Image(selectedTab == 2 ? "onExpo" : "offExpo")
Text("박람회 생성")
}
.tag(3)
.tag(2)

// 프로필 탭
MainView()
.tabItem {
Image(selectedTab == 4 ? "onUser" : "offUser")
Image(selectedTab == 3 ? "onUser" : "offUser")
Text("프로필")
}
.tag(4)
.tag(3)
}
.accentColor(ExpoIOSAsset.Color.main.swiftUIColor)
}
}


#Preview {
TabBarView()
}

0 comments on commit b8cbb48

Please sign in to comment.