File tree Expand file tree Collapse file tree 3 files changed +37
-6
lines changed
Core/DesignSystem/Sources/Components/TextFields Expand file tree Collapse file tree 3 files changed +37
-6
lines changed Original file line number Diff line number Diff line change 1+ //
2+ // MarkTextField.swift
3+ // DesignSystem
4+ //
5+ // Created by 이정동 on 6/9/25.
6+ //
7+
8+ import SwiftUI
9+
10+ #if os(macOS)
11+ public struct MarkTextField : View {
12+
13+ @Binding var text : String
14+ let placeholder : String
15+
16+ public init (
17+ text: Binding < String > ,
18+ placeholder: String = " "
19+ ) {
20+ self . _text = text
21+ self . placeholder = placeholder
22+ }
23+
24+ public var body : some View {
25+ TextField ( " " , text: $text, prompt: Text ( placeholder) )
26+ . textFieldStyle ( . roundedBorder)
27+ }
28+ }
29+
30+ #Preview {
31+ @Previewable @State var text = " "
32+ MarkTextField ( text: $text, placeholder: " 입력 " )
33+ }
34+ #endif
Original file line number Diff line number Diff line change @@ -29,8 +29,7 @@ struct AddFolderView: View {
2929 Text ( " 폴더를 추가: " )
3030 . frame ( maxWidth: . infinity, alignment: . leading)
3131
32- TextField ( " " , text: $title, prompt: Text ( " 제목 " ) )
33- . textFieldStyle ( . roundedBorder)
32+ MarkTextField ( text: $title, placeholder: " 제목 " )
3433 . padding ( . top, 14 )
3534 . disabled ( isSaving)
3635
Original file line number Diff line number Diff line change @@ -56,11 +56,9 @@ struct AddLinkView: View {
5656 . pickerStyle ( . menu)
5757 . labelsHidden ( )
5858
59- TextField ( " " , text: $url, prompt: Text ( " 주소 " ) )
60- . textFieldStyle ( . roundedBorder)
59+ MarkTextField ( text: $url, placeholder: " 주소 " )
6160
62- TextField ( " " , text: $title, prompt: Text ( " 제목(선택) " ) )
63- . textFieldStyle ( . roundedBorder)
61+ MarkTextField ( text: $title, placeholder: " 제목(선택) " )
6462 }
6563 . padding ( . top, 14 )
6664 . disabled ( isSaving)
You can’t perform that action at this time.
0 commit comments