feat: 去掉盲盒按钮
This commit is contained in:
parent
62327164a2
commit
c221f91412
@ -20,6 +20,8 @@ struct ReturnButton: View {
|
|||||||
.font(Typography.font(for: iconSize))
|
.font(Typography.font(for: iconSize))
|
||||||
.fontWeight(.medium)
|
.fontWeight(.medium)
|
||||||
.foregroundColor(iconColor)
|
.foregroundColor(iconColor)
|
||||||
|
.padding(10) // 增加内边距来扩大点击区域
|
||||||
|
.contentShape(Rectangle()) // 使整个区域可点击
|
||||||
}
|
}
|
||||||
.buttonStyle(PlainButtonStyle())
|
.buttonStyle(PlainButtonStyle())
|
||||||
}
|
}
|
||||||
|
|||||||
@ -645,7 +645,10 @@ struct BlindBoxView: View {
|
|||||||
Button(action: showUserProfile) {
|
Button(action: showUserProfile) {
|
||||||
SVGImage(svgName: "User")
|
SVGImage(svgName: "User")
|
||||||
.frame(width: 24, height: 24)
|
.frame(width: 24, height: 24)
|
||||||
|
.padding(13) // Increases tap area while keeping visual size
|
||||||
|
.contentShape(Rectangle()) // Makes the padded area tappable
|
||||||
}
|
}
|
||||||
|
.buttonStyle(PlainButtonStyle()) // Prevents the button from affecting the layout
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
// // 测试质感页面入口
|
// // 测试质感页面入口
|
||||||
|
|||||||
@ -31,6 +31,7 @@ struct UserProfileModal: View {
|
|||||||
@State private var isLoading = false
|
@State private var isLoading = false
|
||||||
@State private var errorMessage: String?
|
@State private var errorMessage: String?
|
||||||
@State private var isCopied = false
|
@State private var isCopied = false
|
||||||
|
@State private var isContentReady = false
|
||||||
|
|
||||||
init(showModal: Binding<Bool>, showSettings: Binding<Bool>, isMember: Binding<Bool>, memberDate: Binding<String>) {
|
init(showModal: Binding<Bool>, showSettings: Binding<Bool>, isMember: Binding<Bool>, memberDate: Binding<String>) {
|
||||||
self._showModal = showModal
|
self._showModal = showModal
|
||||||
@ -51,8 +52,14 @@ struct UserProfileModal: View {
|
|||||||
Text(error)
|
Text(error)
|
||||||
.foregroundColor(.red)
|
.foregroundColor(.red)
|
||||||
.padding()
|
.padding()
|
||||||
} else if let userProfile = userProfile {
|
} else if isContentReady, let userProfile = userProfile {
|
||||||
userProfileView(userProfile: userProfile)
|
userProfileView(userProfile: userProfile)
|
||||||
|
.opacity(isContentReady ? 1 : 0)
|
||||||
|
.animation(.easeInOut(duration: 0.3), value: isContentReady)
|
||||||
|
} else {
|
||||||
|
// Empty view with same dimensions to prevent layout shifts
|
||||||
|
Color.clear
|
||||||
|
.frame(height: UIScreen.main.bounds.height * 0.7)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(width: UIScreen.main.bounds.width * 0.8)
|
.frame(width: UIScreen.main.bounds.width * 0.8)
|
||||||
@ -60,6 +67,12 @@ struct UserProfileModal: View {
|
|||||||
.edgesIgnoringSafeArea(.all)
|
.edgesIgnoringSafeArea(.all)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
fetchUserInfo()
|
fetchUserInfo()
|
||||||
|
// Delay content appearance to sync with modal animation
|
||||||
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
||||||
|
withAnimation {
|
||||||
|
isContentReady = true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,26 +197,26 @@ struct UserProfileModal: View {
|
|||||||
.buttonStyle(PlainButtonStyle())
|
.buttonStyle(PlainButtonStyle())
|
||||||
|
|
||||||
// Box
|
// Box
|
||||||
Button(action: {
|
// Button(action: {
|
||||||
Router.shared.navigate(to: .mediaUpload)
|
// Router.shared.navigate(to: .mediaUpload)
|
||||||
}) {
|
// }) {
|
||||||
HStack(spacing: 16) {
|
// HStack(spacing: 16) {
|
||||||
SVGImage(svgName: "Box")
|
// SVGImage(svgName: "Box")
|
||||||
.foregroundColor(.orange)
|
// .foregroundColor(.orange)
|
||||||
.frame(width: 20, height: 20)
|
// .frame(width: 20, height: 20)
|
||||||
|
|
||||||
Text("My Blind Box")
|
// Text("My Blind Box")
|
||||||
.font(Typography.font(for: .body))
|
// .font(Typography.font(for: .body))
|
||||||
.fontWeight(.bold)
|
// .fontWeight(.bold)
|
||||||
.foregroundColor(.themeTextMessageMain)
|
// .foregroundColor(.themeTextMessageMain)
|
||||||
|
|
||||||
Spacer()
|
// Spacer()
|
||||||
}
|
// }
|
||||||
.padding()
|
// .padding()
|
||||||
.cornerRadius(10)
|
// .cornerRadius(10)
|
||||||
.contentShape(Rectangle())
|
// .contentShape(Rectangle())
|
||||||
}
|
// }
|
||||||
.buttonStyle(PlainButtonStyle())
|
// .buttonStyle(PlainButtonStyle())
|
||||||
|
|
||||||
// setting
|
// setting
|
||||||
Button(action: {
|
Button(action: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user