Skip to content

Commit 0941fc5

Browse files
authored
[#484] TodoEditorView의 모드 셀렉터를 Picker로 수정한다 (#485)
* ui: Picker 형태로 변경 * ui: 수정 -> 작성 형태로 텍스트 수정
1 parent 046089f commit 0941fc5

2 files changed

Lines changed: 36 additions & 24 deletions

File tree

Application/DevLogApp/Sources/Resource/Localizable.xcstrings

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2689,6 +2689,23 @@
26892689
}
26902690
}
26912691
},
2692+
"todo_write" : {
2693+
"extractionState" : "manual",
2694+
"localizations" : {
2695+
"en" : {
2696+
"stringUnit" : {
2697+
"state" : "translated",
2698+
"value" : "Write"
2699+
}
2700+
},
2701+
"ko" : {
2702+
"stringUnit" : {
2703+
"state" : "translated",
2704+
"value" : "작성"
2705+
}
2706+
}
2707+
}
2708+
},
26922709
"todo_editor_description_optional" : {
26932710
"extractionState" : "manual",
26942711
"localizations" : {

Application/DevLogPresentation/Sources/Home/TodoEditorView.swift

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -106,32 +106,27 @@ struct TodoEditorView: View {
106106
}
107107

108108
private var tabViewSelector: some View {
109-
VStack(spacing: 0) {
110-
HStack(spacing: 0) {
111-
Button(action: {
112-
viewModel.send(.setTabViewTag(.editor))
113-
field = .content
114-
}) {
115-
Text(String(localized: "todo_edit"))
116-
.frame(maxWidth: .infinity)
117-
.foregroundStyle(
118-
viewModel.state.tabViewTag == .editor ? Color.primary : Color.secondary
119-
)
120-
}
121-
Divider()
122-
Button(action: {
123-
transitionToPreview()
124-
}) {
125-
Text(String(localized: "todo_preview"))
126-
.frame(maxWidth: .infinity)
127-
.foregroundStyle(
128-
viewModel.state.tabViewTag == .preview ? Color.primary : Color.gray
129-
)
109+
Picker(
110+
"",
111+
selection: Binding(
112+
get: { viewModel.state.tabViewTag },
113+
set: { tag in
114+
if tag == .editor {
115+
viewModel.send(.setTabViewTag(.editor))
116+
field = .content
117+
} else {
118+
transitionToPreview()
119+
}
130120
}
131-
}
132-
.padding(.vertical, 10)
133-
.background(Color(.systemBackground))
121+
)
122+
) {
123+
Text(String(localized: "todo_write"))
124+
.tag(TodoEditorViewModel.Tag.editor)
125+
Text(String(localized: "todo_preview"))
126+
.tag(TodoEditorViewModel.Tag.preview)
134127
}
128+
.pickerStyle(.segmented)
129+
.padding(.horizontal)
135130
}
136131

137132
private var tabView: some View {

0 commit comments

Comments
 (0)