Skip to content

Commit

Permalink
[fix] #157 빈 문자시 지우기 버튼 비활성화
Browse files Browse the repository at this point in the history
  • Loading branch information
ShapeKim98 committed Dec 2, 2024
1 parent 75f54da commit e235db4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Projects/DSKit/Sources/Components/PokitTextInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ public struct PokitTextInput<Value: Hashable>: View {
HStack(spacing: 8) {
if case let .iconL(icon, action) = type {
iconButton(icon: icon, action: action)
.pokitBlurReplaceTransition(.pokitDissolve)
}

textField

if case let .iconR(icon, action) = type {
iconButton(icon: icon, action: action)
.pokitBlurReplaceTransition(.pokitDissolve)
}
}
.padding(.vertical, vPadding)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private extension PokitCategorySettingView {

PokitTextInput(
text: $store.categoryName,
type: .iconR(
type: store.categoryName.isEmpty ? .text : .iconR(
icon: .icon(.x),
action: { send(.포킷명지우기_버튼_눌렀을때) }
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private extension ContentSettingView {
PokitTextInput(
text: $store.urlText,
label: "링크",
type: .iconR(
type: store.urlText.isEmpty ? .text : .iconR(
icon: .icon(.x),
action: { send(.링크지우기_버튼_눌렀을때) }
),
Expand All @@ -126,7 +126,7 @@ private extension ContentSettingView {
PokitTextInput(
text: $store.title,
label: "제목",
type: .iconR(
type: store.title.isEmpty ? .text : .iconR(
icon: .icon(.x),
action: { send(.제목지우기_버튼_눌렀을때) }
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public extension NickNameSettingView {
} else {
PokitTextInput(
text: $store.text,
type: .iconR(
type: store.text.isEmpty ? .text : .iconR(
icon: .icon(.x),
action: { send(.닉네임지우기_버튼_눌렀을때) }
),
Expand Down

0 comments on commit e235db4

Please sign in to comment.