Update(NewDesign): quasi finit v2

pull/24/head
Louis DUFOUR 10 months ago
parent 29c9f65c9d
commit 34a5392c58

@ -28,20 +28,6 @@ struct EditTextComponent: View {
}
}
extension View {
func placeholder<Content: View>(
when shouldShow: Bool,
alignment: Alignment = .leading,
@ViewBuilder placeholder: () -> Content) -> some View {
ZStack(alignment: alignment) {
placeholder().opacity(shouldShow ? 1 : 0)
self
}
}
}
struct EditTextComponent_Previews: PreviewProvider {
static var previews: some View {
EditTextComponent(explanation: "Nom du Joueur 1", name: .constant("Joueur 1"))

@ -0,0 +1,22 @@
//
// Placeholder.swift
// ArkitDoushiQi
//
// Created by Louis DUFOUR on 14/06/2024.
//
import Foundation
import SwiftUI
extension View {
func placeholder<Content: View>(
when shouldShow: Bool,
alignment: Alignment = .leading,
@ViewBuilder placeholder: () -> Content) -> some View {
ZStack(alignment: alignment) {
placeholder().opacity(shouldShow ? 1 : 0)
self
}
}
}
Loading…
Cancel
Save