Skip to content

Commit

Permalink
Merge pull request #53 from School-of-Company/52-MessageSend-Popup
Browse files Browse the repository at this point in the history
🔀 :: [#52] 메세지 전송 팝업제작
  • Loading branch information
Xixn2 authored Nov 12, 2024
2 parents bdf9ae5 + b2bb51a commit ebf3143
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 14 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "스크린샷 2024-11-11 오후 4.14.24.png",
"filename" : "ButtonX.svg",
"idiom" : "universal",
"scale" : "1x"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "imageTest.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
8 changes: 7 additions & 1 deletion Projects/App/Sources/DesignSystem/Button/ExpoButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public struct ExpoButton: View {
var text: String
var horizontalPadding: CGFloat
var verticalPadding: CGFloat
var backColor: Color
var actionColor: Color
var action: () -> Void

@State private var isPressed = false
Expand All @@ -20,11 +22,15 @@ public struct ExpoButton: View {
text: String,
horizontalPadding: CGFloat = 16,
verticalPadding: CGFloat = 8,
backColor: Color,
actionColor: Color,
action: @escaping () -> Void = {}
) {
self.text = text
self.horizontalPadding = horizontalPadding
self.verticalPadding = verticalPadding
self.backColor = backColor
self.actionColor = actionColor
self.action = action
}

Expand All @@ -39,7 +45,7 @@ public struct ExpoButton: View {
.padding(.vertical, verticalPadding)
.background(
RoundedRectangle(cornerRadius: 6)
.fill(isPressed ? ExpoColor.main300.swiftUIColor : ExpoColor.main.swiftUIColor)
.fill(isPressed ? actionColor : backColor)
)
.scaleEffect(isPressed ? 0.9 : 1.0)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct PostDetailView: View {
@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 location = Location(
locationX: 126.800771954215,
locationY: 35.1427689679488,
Expand Down Expand Up @@ -49,7 +50,7 @@ struct PostDetailView: View {
.resizable()
.tag(false)

ExpoIOSAsset.Assets.testimage.swiftUIImage
ExpoIOSAsset.Assets.imageTest.swiftUIImage
.resizable()
.tag(true)
}
Expand Down Expand Up @@ -131,23 +132,29 @@ struct PostDetailView: View {
.frame(height: 178)
.cornerRadius(6)
.overlay(
RoundedRectangle(cornerRadius: 6)
.stroke(Color.gray, lineWidth: 0.3)
)
RoundedRectangle(cornerRadius: 6)
.stroke(Color.gray, lineWidth: 0.3)
)
.padding(.horizontal, 16)
.padding(.top, 8)

HStack(spacing: 0) {
ExpoButton(
text: "문자 보내기",
horizontalPadding: 50,
verticalPadding: 14
)
verticalPadding: 14,
backColor: ExpoColor.main.swiftUIColor,
actionColor: ExpoColor.main300.swiftUIColor
) {
showMessageSheet.toggle()
}
Spacer()
ExpoButton(
text: "QR 생성하기",
horizontalPadding: 47,
verticalPadding: 14
verticalPadding: 14,
backColor: ExpoColor.main.swiftUIColor,
actionColor: ExpoColor.main300.swiftUIColor
)
}
.padding(.horizontal, 16)
Expand Down Expand Up @@ -177,16 +184,74 @@ struct PostDetailView: View {
)
.padding(.top, 2)



Spacer()
}
}
.navigationBarBackButtonHidden(true)
.overlay(
Group {
if showMessageSheet {
popup(showMessageSheet: $showMessageSheet)
}
}
)
}
}
}

@ViewBuilder
func popup(showMessageSheet: Binding<Bool>) -> some View {
Color.black.opacity(0.4)
.edgesIgnoringSafeArea(.all)
.overlay(
RoundedRectangle(cornerRadius: 6)
.frame(height: 150)
.foregroundColor(.white)
.overlay(
VStack {
HStack(spacing: 0) {
Text("누구에게 문자를 전송하시겠습니까?")
.expoFont(.body2B)
Spacer()

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

Spacer()

HStack(spacing: 20) {
ExpoButton(
text: "참가자",
horizontalPadding: 47,
verticalPadding: 14,
backColor: ExpoColor.main500.swiftUIColor,
actionColor: ExpoColor.main200.swiftUIColor
)

ExpoButton(
text: "연수자",
horizontalPadding: 47,
verticalPadding: 14,
backColor: ExpoColor.main300.swiftUIColor,
actionColor: ExpoColor.main100.swiftUIColor
)
}
.padding(.top, 16)
}
.padding(.vertical, 16)
)
.padding(.horizontal, 32)
)

}



#Preview {
PostDetailView()
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ struct SigninView: View {
ExpoButton(
text: "로그인",
horizontalPadding: 160,
verticalPadding: 14
verticalPadding: 14,
backColor: ExpoColor.main.swiftUIColor,
actionColor: ExpoColor.main300.swiftUIColor
){
viewModel.setupEmail(email: emailTextField)
viewModel.setupPassword(password: passwordTextField)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ struct SignupView: View {
ExpoButton(
text: "확인",
horizontalPadding: 22,
verticalPadding: 12
verticalPadding: 12,
backColor: ExpoColor.main.swiftUIColor,
actionColor: ExpoColor.main300.swiftUIColor
){
viewModel.setupCode(code: codeTextField)
viewModel.setupPhoneNumber(phoneNumber: userNumberTextField)
Expand Down Expand Up @@ -179,7 +181,9 @@ struct SignupView: View {
ExpoButton(
text: "회원가입 완료",
horizontalPadding: 142,
verticalPadding: 14
verticalPadding: 14,
backColor: ExpoColor.main.swiftUIColor,
actionColor: ExpoColor.main300.swiftUIColor
){
viewModel.setupName(name: nameTextField)
viewModel.setupEmail(email: emailTextField)
Expand Down

0 comments on commit ebf3143

Please sign in to comment.