feat: userrname
This commit is contained in:
parent
44de40cf83
commit
599ea6eae7
Binary file not shown.
@ -7,7 +7,7 @@
|
||||
<key>wake.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>3</integer>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
<key>UIAppFonts</key>
|
||||
<array>
|
||||
<string>Inter.ttf</string>
|
||||
<string>Quicksand X.ttf</string>
|
||||
<string>Quicksand x.ttf</string>
|
||||
<string>Quicksand-Regular.ttf</string>
|
||||
<string>Quicksand-Bold.ttf</string>
|
||||
<string>Quicksand-SemiBold.ttf</string>
|
||||
|
||||
@ -5,9 +5,11 @@ public struct AvatarPicker: View {
|
||||
@State private var showMediaPicker = false
|
||||
@State private var isUploading = false
|
||||
@Binding var selectedImage: UIImage?
|
||||
@Binding var showUsername: Bool
|
||||
|
||||
public init(selectedImage: Binding<UIImage?>) {
|
||||
public init(selectedImage: Binding<UIImage?>, showUsername: Binding<Bool>) {
|
||||
self._selectedImage = selectedImage
|
||||
self._showUsername = showUsername
|
||||
}
|
||||
|
||||
public var body: some View {
|
||||
@ -37,7 +39,7 @@ public struct AvatarPicker: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !showUsername {
|
||||
// Upload button
|
||||
Button(action: {
|
||||
showMediaPicker = true
|
||||
@ -53,7 +55,9 @@ public struct AvatarPicker: View {
|
||||
.fill(Color.themePrimaryLight)
|
||||
)
|
||||
}
|
||||
.frame(width: .infinity)
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
|
||||
}
|
||||
.sheet(isPresented: $showMediaPicker) {
|
||||
MediaPicker(
|
||||
|
||||
@ -4,12 +4,13 @@ struct UserInfo: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
// Sample user data - replace with your actual data model
|
||||
@State private var userName = "MeMo"
|
||||
@State private var userName = ""
|
||||
@State private var userEmail = "memo@example.com"
|
||||
@State private var notificationsEnabled = true
|
||||
@State private var darkModeEnabled = false
|
||||
@State private var showLogoutAlert = false
|
||||
@State private var avatarImage: UIImage? // Add this line
|
||||
@State private var avatarImage: UIImage?
|
||||
@State private var showUsername: Bool = false
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 0) {
|
||||
@ -46,16 +47,20 @@ struct UserInfo: View {
|
||||
Spacer()
|
||||
VStack(spacing: 20) {
|
||||
// Title
|
||||
Text("Add Your Avatar")
|
||||
Text(showUsername ? "Add Your Avatar" : "What‘s Your Name?")
|
||||
.font(Typography.font(for: .body, family: .quicksandBold))
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
|
||||
// Avatar
|
||||
ZStack {
|
||||
AvatarPicker(selectedImage: $avatarImage)
|
||||
AvatarPicker(
|
||||
selectedImage: $avatarImage,
|
||||
showUsername: $showUsername
|
||||
)
|
||||
}
|
||||
.padding(.top, 20)
|
||||
|
||||
if !showUsername {
|
||||
Button(action: {
|
||||
// Action for second button
|
||||
}) {
|
||||
@ -71,12 +76,26 @@ struct UserInfo: View {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if showUsername {
|
||||
TextField("Username", text: $userName)
|
||||
.font(Typography.font(for: .subtitle, family: .inter))
|
||||
.multilineTextAlignment(.center)
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding()
|
||||
.foregroundColor(.black)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 16)
|
||||
.fill(Color.themePrimaryLight)
|
||||
)
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.background(Color(.white))
|
||||
.cornerRadius(20)
|
||||
Spacer()
|
||||
Button(action: {
|
||||
// Action for next button
|
||||
showUsername = true
|
||||
}) {
|
||||
Text("Continue")
|
||||
.font(Typography.font(for: .body))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user