Skip to content

Commit

Permalink
✨ :: [#54] Add PostDetailView Qr Popup Feature Make
Browse files Browse the repository at this point in the history
  • Loading branch information
Xixn2 committed Nov 12, 2024
1 parent 3f4fe2f commit 26d94bf
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 35 deletions.
3 changes: 1 addition & 2 deletions Projects/App/Sources/Application/ExpoApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import KakaoMapsSDK
struct ExpoApp: App {
var body: some Scene {
WindowGroup {
//PostDetailView()
QRCodeCallerView()
SigninView(viewModel: AuthViewModel())
.onAppear {
let appKey = Bundle.main.object(forInfoDictionaryKey: "KAKAO_NATIVE_APP_KEY") as? String ?? ""
SDKInitializer.InitSDK(appKey: appKey)
Expand Down
2 changes: 1 addition & 1 deletion Projects/App/Sources/Extension/EXPOQRCode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct QrCodeMakeView: View {
Image(uiImage: qrImage)
.interpolation(.none)
.resizable()
.frame(width: 150, height: 150)
.frame(width: 145, height: 145)
} else {
ExpoIOSAsset.Assets.warningImage.swiftUIImage
.resizable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@

import SwiftUI
import KakaoMapsSDK
import CoreImage.CIFilterBuiltins

struct PostDetailView: View {
@Environment(\.dismiss) var dismiss
@State private var postImageCount: Bool = false
@State private var dateLine: String = "09.10 ~09.20"
@State private var drawMap: Bool = true
@State private var showMessageSheet = false
@State private var showQrcodeSheet = false
@State private var link: String = "https://github.com/School-of-Company/Expo-iOS"
@State private var location = Location(
locationX: 126.800771954215,
locationY: 35.1427689679488,
Expand Down Expand Up @@ -156,7 +157,9 @@ struct PostDetailView: View {
verticalPadding: 14,
backColor: ExpoColor.main.swiftUIColor,
actionColor: ExpoColor.main300.swiftUIColor
)
) {
showQrcodeSheet.toggle()
}
}
.padding(.horizontal, 16)
.padding(.top, 32)
Expand Down Expand Up @@ -192,7 +195,9 @@ struct PostDetailView: View {
.overlay(
Group {
if showMessageSheet {
popup(showMessageSheet: $showMessageSheet)
popupMessage(showMessageSheet: $showMessageSheet)
} else if showQrcodeSheet {
popupQrcode(showQrcodeSheet: $showQrcodeSheet, link: $link)
}
}
)
Expand All @@ -201,7 +206,7 @@ struct PostDetailView: View {
}

@ViewBuilder
func popup(showMessageSheet: Binding<Bool>) -> some View {
func popupMessage(showMessageSheet: Binding<Bool>) -> some View {
Color.black.opacity(0.4)
.edgesIgnoringSafeArea(.all)
.overlay(
Expand Down Expand Up @@ -248,10 +253,42 @@ func popup(showMessageSheet: Binding<Bool>) -> some View {
)
.padding(.horizontal, 32)
)

}

@ViewBuilder
func popupQrcode(showQrcodeSheet: Binding<Bool>, link: Binding<String>) -> some View {
Color.black.opacity(0.4)
.edgesIgnoringSafeArea(.all)
.overlay(
RoundedRectangle(cornerRadius: 6)
.frame(height: 240)
.foregroundColor(.white)
.overlay(
VStack(spacing: 0){
HStack(spacing: 0) {
Text("현장 신청 QR코드")
.expoFont(.title3B)
Spacer()

Button {
showQrcodeSheet.wrappedValue = false
} label: {
ExpoIOSAsset.Assets.buttonX.swiftUIImage
}
}
.padding(.horizontal, 12)

QrCodeMakeView(link: link)
.padding(.top, 24)

Spacer()
}
.padding(.vertical, 16)
)
.padding(.horizontal, 50)
)

}

#Preview {
PostDetailView()
Expand Down

This file was deleted.

0 comments on commit 26d94bf

Please sign in to comment.