From ef7acf522338b4c959a305fee2948e55b4eb9cce Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Wed, 28 Aug 2024 01:38:39 +0900 Subject: [PATCH] :lipstick: :: Designsystem / add SelectRow --- .../DesignSystem/Sources/Sources.swift | 1 - .../Sources/View/Row/SelectRow.swift | 27 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) delete mode 100644 Projects/UserInterface/DesignSystem/Sources/Sources.swift create mode 100644 Projects/UserInterface/DesignSystem/Sources/View/Row/SelectRow.swift diff --git a/Projects/UserInterface/DesignSystem/Sources/Sources.swift b/Projects/UserInterface/DesignSystem/Sources/Sources.swift deleted file mode 100644 index 9f44cbf..0000000 --- a/Projects/UserInterface/DesignSystem/Sources/Sources.swift +++ /dev/null @@ -1 +0,0 @@ -// This is For Tuist diff --git a/Projects/UserInterface/DesignSystem/Sources/View/Row/SelectRow.swift b/Projects/UserInterface/DesignSystem/Sources/View/Row/SelectRow.swift new file mode 100644 index 0000000..e73bbe8 --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Sources/View/Row/SelectRow.swift @@ -0,0 +1,27 @@ +import SwiftUI + +struct SelectRow: View { + let text: String + @Binding var isSelected: Bool + + var body: some View { + Button { + isSelected.toggle() + } label: { + HStack { + Text(text) + + Spacer() + + if isSelected { + Image(systemName: "checkmark.circle.fill") + } else { + EmptyView() + } + } + .foregroundColor(isSelected == true ? Color.ondosee(.system(.primary)) : + Color.ondosee(.system(.background)) + ) + } + } +}