From 89eb7b2c0acaa43a3e9f5975d1bb80766c85311f Mon Sep 17 00:00:00 2001 From: baegteun Date: Fri, 23 Sep 2022 11:47:20 +0900 Subject: [PATCH 01/10] feat :: TextField without Color --- Projects/App/Sources/Application/DMSApp.swift | 8 +- .../TextField/DMSFloatingTextField.swift | 81 +++++++++++++++++++ 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift diff --git a/Projects/App/Sources/Application/DMSApp.swift b/Projects/App/Sources/Application/DMSApp.swift index 6360e2e5..259a7ebf 100644 --- a/Projects/App/Sources/Application/DMSApp.swift +++ b/Projects/App/Sources/Application/DMSApp.swift @@ -1,10 +1,16 @@ import SwiftUI +import DesignSystem @main struct DMSApp: App { + @State var test = "" + @State var isError = false var body: some Scene { WindowGroup { - Text("WOW") + DMSFloatingTextField("아이디", text: $test, isError: isError, errorMessage: "Error") { + isError.toggle() + } + .padding() } } } diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift new file mode 100644 index 00000000..020af5c9 --- /dev/null +++ b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift @@ -0,0 +1,81 @@ +import SwiftUI + +public struct DMSFloatingTextField: View { + var label: String + var text: Binding + var helpMessage: String + var isError: Bool + var errorMessage: String + var onCommit: () -> Void + @FocusState var isFocused: Bool + private var isFloaintg: Bool { + isFocused || !text.wrappedValue.isEmpty + } + private var isErrorOccurred: Bool { + isError || !helpMessage.isEmpty + } + + public init( + _ label: String = "", + text: Binding, + helpText: String = "", + isError: Bool = false, + errorMessage: String = "", + onCommit: @escaping () -> Void = {} + ) { + self.label = label + self.text = text + self.helpMessage = helpText + self.isError = isError + self.errorMessage = errorMessage + self.onCommit = onCommit + } + + public var body: some View { + ZStack(alignment: .leading) { + Text(label) + .dmsFont(.text(isFloaintg ? .medium : .extraLarge)) + .foregroundColor( + isFocused ? + .blue : + isErrorOccurred ? + .red : + .gray + ) // TODO: 디자인 시스템 - 색상 완료시 색 적용 + .offset(y: isFloaintg ? -40 : isErrorOccurred ? -10 : 0) + + VStack(alignment: .leading, spacing: 10) { + TextField("", text: text) + .dmsFont(.text(.medium), color: .black) // TODO: 디자인 시스템 - 색상 완료시 색 적용 + .overlay(alignment: .bottom) { + Rectangle() + .foregroundColor( + isFocused ? + .blue : + isErrorOccurred ? + .red : + .gray + ) // TODO: 디자인 시스템 - 색상 완료시 색 적용 + .frame(height: 1) + .offset(y: 7) + } + .focused($isFocused) + .onSubmit(onCommit) + + if isErrorOccurred { + Text(isError ? errorMessage : helpMessage) + .dmsFont(.text(.extraSmall), color: isError ? .red : .gray) // TODO: 디자인 시스템 - 색상 완료시 색 적용 + } + } + } + .animation(.default, value: isFloaintg) + .animation(.default, value: isFocused) + .animation(.default, value: isErrorOccurred) + } +} + +struct DMSFloatingTextField_Previews: PreviewProvider { + static var previews: some View { + DMSFloatingTextField("Test", text: .constant("")) + } +} From b5a4bf00707610af40352b0721e12f3936fa1e92 Mon Sep 17 00:00:00 2001 From: baegteun Date: Fri, 23 Sep 2022 11:55:58 +0900 Subject: [PATCH 02/10] =?UTF-8?q?feat=20::=20errorMessage=20=EC=82=AC?= =?UTF-8?q?=EC=86=8C=ED=95=9C=20=EB=94=94=ED=85=8C=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/Sources/TextField/DMSFloatingTextField.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift index 020af5c9..3f6bd7aa 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift @@ -65,12 +65,13 @@ public struct DMSFloatingTextField: View { if isErrorOccurred { Text(isError ? errorMessage : helpMessage) .dmsFont(.text(.extraSmall), color: isError ? .red : .gray) // TODO: 디자인 시스템 - 색상 완료시 색 적용 + .offset(x: 5) } } } + .animation(.default, value: isErrorOccurred) .animation(.default, value: isFloaintg) .animation(.default, value: isFocused) - .animation(.default, value: isErrorOccurred) } } From f5fe20e99ebb2173a4eb8808f152b88f21149137 Mon Sep 17 00:00:00 2001 From: baegteun Date: Sat, 24 Sep 2022 07:27:39 +0900 Subject: [PATCH 03/10] rename :: helpText -> helpMessage --- .../DesignSystem/Sources/TextField/DMSFloatingTextField.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift index 3f6bd7aa..6cfd3d26 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift @@ -18,14 +18,14 @@ public struct DMSFloatingTextField: View { public init( _ label: String = "", text: Binding, - helpText: String = "", + helpMessage: String = "", isError: Bool = false, errorMessage: String = "", onCommit: @escaping () -> Void = {} ) { self.label = label self.text = text - self.helpMessage = helpText + self.helpMessage = helpMessage self.isError = isError self.errorMessage = errorMessage self.onCommit = onCommit From 0f40ae5925c21e1b438dadae78f8182eb5624803 Mon Sep 17 00:00:00 2001 From: baegteun Date: Sun, 25 Sep 2022 13:50:24 +0900 Subject: [PATCH 04/10] =?UTF-8?q?feat=20::=20dependency=EC=97=90=20?= =?UTF-8?q?=EC=9E=90=EB=8F=99=EC=9C=BC=EB=A1=9C=20feature=20=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/generate_new_feature.py | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/Scripts/generate_new_feature.py b/Scripts/generate_new_feature.py index 0583000e..90377a3d 100644 --- a/Scripts/generate_new_feature.py +++ b/Scripts/generate_new_feature.py @@ -30,8 +30,7 @@ def make_dirs(paths): def make_project_file(feature_name, file_path, has_demo=False, dependencies=[]): project_path = file_path + '/Project.swift' file_name = file_path.split('/')[-1] - file_content = f""" -import ProjectDescription + file_content = f"""import ProjectDescription import ProjectDescriptionHelpers let project = Project.makeModule( @@ -131,7 +130,33 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ''' write_code_in_file(app_delegate_path, app_delegate) +def write_created_feature_on_dependency_project(feature_name): + file_path = f'{root_path}/Plugin/UtilityPlugin/ProjectDescriptionHelpers/Dependency+Project.swift' + read_file = read_file_at(file_path) + updated_file = update_file_at(read_file, feature_name) + write_file_at(file_path, updated_file) +def read_file_at(file_path): + with open(file_path, 'r') as file: + return file.readlines() + +def update_file_at(dependency_file, feature_name): + dependency_file_len = len(dependency_file) + for index, elem in enumerate(dependency_file): + if "public extension TargetDependency.Project.Features" in elem: + insert_line = index + 1 + break + + append_code = f' static let {feature_name}Feature = TargetDependency.feature(name: "{feature_name}Feature")\n' + + if dependency_file_len > int(insert_line): + dependency_file.insert(insert_line, append_code) + + return dependency_file + +def write_file_at(file_path, update_file): + with open(file_path, 'w') as file: + file.writelines(update_file) print('Input new feature name ', end=': ', flush=True) @@ -149,3 +174,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { os.chdir(root_path + '/Projects/Features') make_new_feature(feature_name, has_demo) +write_created_feature_on_dependency_project(feature_name) + +print(f'Created {feature_name}Feature Module') From 8e3587c36b90b07f26d5f9d7f73218faf0a3c70d Mon Sep 17 00:00:00 2001 From: baegteun Date: Sun, 25 Sep 2022 13:51:00 +0900 Subject: [PATCH 05/10] feat :: Makefile script --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index b9c9ca83..0e2ce85a 100644 --- a/Makefile +++ b/Makefile @@ -10,3 +10,8 @@ reset: tuist clean rm -rf **/*.xcodeproj rm -rf *.xcworkspace + +feature: + python3 Scripts/generate_new_feature.py + + From 17bdb6c0d17b579129b741ff9ef15e159107e633 Mon Sep 17 00:00:00 2001 From: baegteun Date: Tue, 27 Sep 2022 21:10:22 +0900 Subject: [PATCH 06/10] feat :: DMSFloatingTextField --- Projects/App/Sources/Application/DMSApp.swift | 2 +- .../TextField/DMSFloatingTextField.swift | 49 +++++----- .../SecureDMSFloatingTextField.swift | 95 +++++++++++++++++++ 3 files changed, 118 insertions(+), 28 deletions(-) create mode 100644 Projects/UsertInterfaces/DesignSystem/Sources/TextField/SecureDMSFloatingTextField.swift diff --git a/Projects/App/Sources/Application/DMSApp.swift b/Projects/App/Sources/Application/DMSApp.swift index 259a7ebf..3413e943 100644 --- a/Projects/App/Sources/Application/DMSApp.swift +++ b/Projects/App/Sources/Application/DMSApp.swift @@ -7,7 +7,7 @@ struct DMSApp: App { @State var isError = false var body: some Scene { WindowGroup { - DMSFloatingTextField("아이디", text: $test, isError: isError, errorMessage: "Error") { + DMSFloatingTextField("아이디", text: $test, helpMessage: "asd", isError: isError, errorMessage: "Error") { isError.toggle() } .padding() diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift index 6cfd3d26..c60b882a 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift @@ -2,18 +2,25 @@ import SwiftUI public struct DMSFloatingTextField: View { var label: String - var text: Binding + @Binding var text: String var helpMessage: String var isError: Bool var errorMessage: String var onCommit: () -> Void @FocusState var isFocused: Bool private var isFloaintg: Bool { - isFocused || !text.wrappedValue.isEmpty + isFocused || !text.isEmpty } - private var isErrorOccurred: Bool { + private var isErrorOrHelpNotEmpty: Bool { isError || !helpMessage.isEmpty } + private var dmsForegroundColor: Color { + isFocused ? + .PrimaryVariant.darken2 : + isError ? + .System.error : + .GrayScale.gray5 + } public init( _ label: String = "", @@ -24,7 +31,7 @@ public struct DMSFloatingTextField: View { onCommit: @escaping () -> Void = {} ) { self.label = label - self.text = text + _text = text self.helpMessage = helpMessage self.isError = isError self.errorMessage = errorMessage @@ -34,44 +41,32 @@ public struct DMSFloatingTextField: View { public var body: some View { ZStack(alignment: .leading) { Text(label) - .dmsFont(.text(isFloaintg ? .medium : .extraLarge)) - .foregroundColor( - isFocused ? - .blue : - isErrorOccurred ? - .red : - .gray - ) // TODO: 디자인 시스템 - 색상 완료시 색 적용 - .offset(y: isFloaintg ? -40 : isErrorOccurred ? -10 : 0) + .dmsFont(.text(isFloaintg ? .medium : .extraLarge), color: dmsForegroundColor) + .offset(y: isFloaintg ? -40 : isErrorOrHelpNotEmpty ? -10 : 0) VStack(alignment: .leading, spacing: 10) { - TextField("", text: text) - .dmsFont(.text(.medium), color: .black) // TODO: 디자인 시스템 - 색상 완료시 색 적용 + TextField("", text: $text) + .dmsFont(.text(.medium), color: .GrayScale.gray9) + .foregroundColor(dmsForegroundColor) .overlay(alignment: .bottom) { Rectangle() - .foregroundColor( - isFocused ? - .blue : - isErrorOccurred ? - .red : - .gray - ) // TODO: 디자인 시스템 - 색상 완료시 색 적용 + .foregroundColor(dmsForegroundColor) .frame(height: 1) .offset(y: 7) } .focused($isFocused) .onSubmit(onCommit) - if isErrorOccurred { + if isErrorOrHelpNotEmpty { Text(isError ? errorMessage : helpMessage) - .dmsFont(.text(.extraSmall), color: isError ? .red : .gray) // TODO: 디자인 시스템 - 색상 완료시 색 적용 + .dmsFont(.text(.extraSmall), color: isError ? .System.error : .GrayScale.gray5) .offset(x: 5) } } } - .animation(.default, value: isErrorOccurred) - .animation(.default, value: isFloaintg) - .animation(.default, value: isFocused) + .animation(.easeIn(duration: 0.3), value: isErrorOrHelpNotEmpty) + .animation(.easeIn(duration: 0.3), value: isFloaintg) + .animation(.easeIn(duration: 0.3), value: isFocused) } } diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/SecureDMSFloatingTextField.swift b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/SecureDMSFloatingTextField.swift new file mode 100644 index 00000000..fc083b9d --- /dev/null +++ b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/SecureDMSFloatingTextField.swift @@ -0,0 +1,95 @@ +import SwiftUI + +public struct SecureDMSFloatingTextField: View { + var label: String + @Binding var text: String + var helpMessage: String + var isError: Bool + var errorMessage: String + var onCommit: () -> Void + @State var isSecure = true + @FocusState var isFocused: Bool + private var isFloaintg: Bool { + isFocused || !text.isEmpty + } + private var isErrorOrHelpNotEmpty: Bool { + isError || !helpMessage.isEmpty + } + private var dmsForegroundColor: Color { + isFocused ? + .PrimaryVariant.darken2 : + isError ? + .System.error : + .GrayScale.gray5 + } + + public init( + _ label: String = "", + text: Binding, + helpMessage: String = "", + isError: Bool = false, + errorMessage: String = "", + onCommit: @escaping () -> Void = {} + ) { + self.label = label + _text = text + self.helpMessage = helpMessage + self.isError = isError + self.errorMessage = errorMessage + self.onCommit = onCommit + } + + public var body: some View { + ZStack(alignment: .leading) { + HStack { + Text(label) + .dmsFont(.text(isFloaintg ? .medium : .extraLarge), color: dmsForegroundColor) + .offset(y: isFloaintg ? -40 : isErrorOrHelpNotEmpty ? -10 : 0) + .onTapGesture { + isFocused = true + } + + Spacer() + + Button { + isSecure.toggle() + } label: { + Image(systemName: isSecure ? "eye.fill" : "eye.slash.fill") + .foregroundColor(.GrayScale.gray5) + } + .padding() + .offset(y: isErrorOrHelpNotEmpty ? -10 : 0) + } + .zIndex(1) + + VStack(alignment: .leading, spacing: 10) { + Group { + if isSecure { + SecureField("", text: $text) + } else { + TextField("", text: $text) + } + } + .dmsFont(.text(.medium), color: .GrayScale.gray9) + .foregroundColor(dmsForegroundColor) + .overlay(alignment: .bottom) { + Rectangle() + .foregroundColor(dmsForegroundColor) + .frame(height: 1) + .offset(y: 7) + } + .focused($isFocused) + .onSubmit(onCommit) + + if isErrorOrHelpNotEmpty { + Text(isError ? errorMessage : helpMessage) + .dmsFont(.text(.extraSmall), color: isError ? .System.error : .GrayScale.gray5) + .offset(x: 5) + } + } + } + .animation(.easeIn(duration: 0.3), value: isErrorOrHelpNotEmpty) + .animation(.easeIn(duration: 0.3), value: isFloaintg) + .animation(.easeIn(duration: 0.3), value: isFocused) + } +} From 24f954acc12506e4ac115fc2cf046cd42117fde4 Mon Sep 17 00:00:00 2001 From: baegteun Date: Tue, 27 Sep 2022 21:11:38 +0900 Subject: [PATCH 07/10] =?UTF-8?q?foldring=20::=20=ED=98=84=20TextField?= =?UTF-8?q?=EB=93=A4=20Floating/=20=EC=97=90=20=EB=84=A3=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/TextField/{ => Floating}/DMSFloatingTextField.swift | 0 .../TextField/{ => Floating}/SecureDMSFloatingTextField.swift | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Projects/UsertInterfaces/DesignSystem/Sources/TextField/{ => Floating}/DMSFloatingTextField.swift (100%) rename Projects/UsertInterfaces/DesignSystem/Sources/TextField/{ => Floating}/SecureDMSFloatingTextField.swift (100%) diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Floating/DMSFloatingTextField.swift similarity index 100% rename from Projects/UsertInterfaces/DesignSystem/Sources/TextField/DMSFloatingTextField.swift rename to Projects/UsertInterfaces/DesignSystem/Sources/TextField/Floating/DMSFloatingTextField.swift diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/SecureDMSFloatingTextField.swift b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Floating/SecureDMSFloatingTextField.swift similarity index 100% rename from Projects/UsertInterfaces/DesignSystem/Sources/TextField/SecureDMSFloatingTextField.swift rename to Projects/UsertInterfaces/DesignSystem/Sources/TextField/Floating/SecureDMSFloatingTextField.swift From 8f23382e59f154996e7804474d39dcd3951fd45e Mon Sep 17 00:00:00 2001 From: baegteun Date: Tue, 27 Sep 2022 21:29:38 +0900 Subject: [PATCH 08/10] feat :: DMSFormTextField --- Projects/App/Sources/Application/DMSApp.swift | 4 +- .../TextField/Form/DMSFormTextField.swift | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextField.swift diff --git a/Projects/App/Sources/Application/DMSApp.swift b/Projects/App/Sources/Application/DMSApp.swift index 3413e943..ef06c410 100644 --- a/Projects/App/Sources/Application/DMSApp.swift +++ b/Projects/App/Sources/Application/DMSApp.swift @@ -7,9 +7,7 @@ struct DMSApp: App { @State var isError = false var body: some Scene { WindowGroup { - DMSFloatingTextField("아이디", text: $test, helpMessage: "asd", isError: isError, errorMessage: "Error") { - isError.toggle() - } + DMSFormTextField("제목을 입력해주세요", text: $test) .padding() } } diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextField.swift b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextField.swift new file mode 100644 index 00000000..cf50da56 --- /dev/null +++ b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextField.swift @@ -0,0 +1,40 @@ +import SwiftUI + +public struct DMSFormTextField: View { + var placeholder: String + @Binding var text: String + + public init( + _ placeholder: String = "", + text: Binding + ) { + self.placeholder = placeholder + _text = text + } + + public var body: some View { + ZStack(alignment: .leading) { + if text.isEmpty { + Text(placeholder) + .dmsFont(.text(.medium), color: .GrayScale.gray5) + .padding(.horizontal, 16) + .padding(.vertical, 15) + } + + TextField("", text: $text) + .foregroundColor(.GrayScale.gray6) + .padding(.horizontal, 16) + .padding(.vertical, 15) + .overlay { + RoundedRectangle(cornerRadius: 4) + .strokeBorder(Color.GrayScale.gray4) + } + } + } +} + +struct DMSFormTextField_Previews: PreviewProvider { + static var previews: some View { + DMSFormTextField(text: .constant("")) + } +} From a75b721e95f3957c37f31118bb776aea65e73b29 Mon Sep 17 00:00:00 2001 From: baegteun Date: Tue, 27 Sep 2022 22:36:51 +0900 Subject: [PATCH 09/10] feat :: DMSFormTextEditor --- Projects/App/Sources/Application/DMSApp.swift | 4 +- .../TextField/Form/DMSFormTextEditor.swift | 48 +++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextEditor.swift diff --git a/Projects/App/Sources/Application/DMSApp.swift b/Projects/App/Sources/Application/DMSApp.swift index ef06c410..ca763a5b 100644 --- a/Projects/App/Sources/Application/DMSApp.swift +++ b/Projects/App/Sources/Application/DMSApp.swift @@ -7,8 +7,8 @@ struct DMSApp: App { @State var isError = false var body: some Scene { WindowGroup { - DMSFormTextField("제목을 입력해주세요", text: $test) - .padding() + DMSFormTextEditor("제목을 입력해주세요", text: $test) + .padding() } } } diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextEditor.swift b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextEditor.swift new file mode 100644 index 00000000..47f3993e --- /dev/null +++ b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextEditor.swift @@ -0,0 +1,48 @@ +import SwiftUI + +public struct DMSFormTextEditor: View { + var placeholder: String + @Binding var text: String + var minHeight: CGFloat + + public init( + _ placeholder: String = "", + text: Binding, + minHeight: CGFloat = 220 + ) { + self.placeholder = placeholder + _text = text + self.minHeight = minHeight + UITextView.appearance().backgroundColor = .clear + } + + public var body: some View { + VStack { + ScrollView { + ZStack(alignment: .topLeading) { + RoundedRectangle(cornerRadius: 4) + .strokeBorder(Color.GrayScale.gray4) + + TextEditor(text: $text) + .dmsFont(.text(.medium), color: .GrayScale.gray6) + .padding(.horizontal, 16) + .padding(.vertical, 15) + .frame(minHeight: minHeight, alignment: .leading) + .cornerRadius(4) + + Text(placeholder) + .dmsFont(.text(.medium), color: .GrayScale.gray5) + .padding(.horizontal, 21) + .padding(.vertical, 21) + .opacity(text.isEmpty ? 1 : 0) + } + } + } + } +} + +struct DMSFormTextEditor_Previews: PreviewProvider { + static var previews: some View { + DMSFormTextEditor(text: .constant("")) + } +} From 19c0ac44777d865121ccaad2feb8d219cdf23d66 Mon Sep 17 00:00:00 2001 From: baegteun Date: Tue, 27 Sep 2022 22:51:14 +0900 Subject: [PATCH 10/10] =?UTF-8?q?refactor=20::=20=EB=A7=88=EC=9D=B4?= =?UTF-8?q?=EB=84=88=ED=95=9C=20=EB=94=94=EB=B2=84=EA=B7=B8=20View=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/App/Sources/Application/DMSApp.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Projects/App/Sources/Application/DMSApp.swift b/Projects/App/Sources/Application/DMSApp.swift index ca763a5b..b274a629 100644 --- a/Projects/App/Sources/Application/DMSApp.swift +++ b/Projects/App/Sources/Application/DMSApp.swift @@ -3,12 +3,9 @@ import DesignSystem @main struct DMSApp: App { - @State var test = "" - @State var isError = false var body: some Scene { WindowGroup { - DMSFormTextEditor("제목을 입력해주세요", text: $test) - .padding() + Text("WOW") } } }