From 34a5392c58ea3932efa129d76d033e78e65628aa Mon Sep 17 00:00:00 2001 From: "louis.dufour" Date: Fri, 14 Jun 2024 15:27:40 +0200 Subject: [PATCH] Update(NewDesign): quasi finit v2 --- .../Controls/EditTextComponent.swift | 14 ------------ .../Views/Extension/Placeholder.swift | 22 +++++++++++++++++++ 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditTextComponent.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditTextComponent.swift index c9dba08..e1a4669 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditTextComponent.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/EditTextComponent.swift @@ -28,20 +28,6 @@ struct EditTextComponent: View { } } -extension View { - func placeholder( - 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")) diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Extension/Placeholder.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Extension/Placeholder.swift index e69de29..948fa1b 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Extension/Placeholder.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Extension/Placeholder.swift @@ -0,0 +1,22 @@ +// +// Placeholder.swift +// ArkitDoushiQi +// +// Created by Louis DUFOUR on 14/06/2024. +// + +import Foundation +import SwiftUI + +extension View { + func placeholder( + when shouldShow: Bool, + alignment: Alignment = .leading, + @ViewBuilder placeholder: () -> Content) -> some View { + + ZStack(alignment: alignment) { + placeholder().opacity(shouldShow ? 1 : 0) + self + } + } +}