Skip to content

Commit d65371e

Browse files
committed
[fix] #193 바텀버튼 패딩 수정
1 parent 9490ed7 commit d65371e

File tree

12 files changed

+69
-7
lines changed

12 files changed

+69
-7
lines changed

Projects/DSKit/Sources/Components/PokitBottomButton.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public struct PokitBottomButton: View {
3737
}
3838
.disabled(state == .disable)
3939
.padding(.top, 16)
40-
.padding(.bottom, 36)
40+
// .padding(.bottom, 36)
4141
}
4242

4343
private var label: some View {

Projects/DSKit/Sources/Components/PokitBottomSwitchRadio.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public struct PokitBottomSwitchRadio<Content: View>: View {
2020
}
2121
.padding(.horizontal, 20)
2222
.padding(.top, 16)
23-
.padding(.bottom, 28)
23+
// .padding(.bottom, 28)
2424
.background(.pokit(.bg(.base)))
2525
}
2626
}

Projects/Feature/FeatureCategoryDetail/Sources/Sheet/CategoryFilterSheet.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ private extension CategoryFilterSheet {
113113
)
114114
}
115115
)
116+
.padding(.bottom, 36)
116117
}
117118
.padding(.horizontal, 20)
118119
}

Projects/Feature/FeatureContentSetting/Sources/ContentSetting/ContentSettingFeature.swift

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public struct ContentSettingFeature {
2626
private var contentClient
2727
@Dependency(CategoryClient.self)
2828
private var categoryClient
29+
@Dependency(KeyboardClient.self)
30+
private var keyboardClient
2931
/// - State
3032
@ObservableState
3133
public struct State: Equatable {
@@ -71,6 +73,7 @@ public struct ContentSettingFeature {
7173
var showLinkPreview = false
7274
var isShareExtension: Bool
7375
var pokitAddSheetPresented: Bool = false
76+
var isKeyboardVisible: Bool = false
7477
}
7578

7679
/// - Action
@@ -110,6 +113,7 @@ public struct ContentSettingFeature {
110113
case 선택한_포킷_인메모리_삭제
111114
case 링크팝업_활성화(PokitLinkPopup.PopupType)
112115
case error(Error)
116+
case 키보드_감지_반영(Bool)
113117
}
114118

115119
public enum AsyncAction: Equatable {
@@ -119,6 +123,7 @@ public struct ContentSettingFeature {
119123
case 컨텐츠_수정_API
120124
case 컨텐츠_추가_API
121125
case 클립보드_감지
126+
case 키보드_감지
122127
}
123128

124129
public enum ScopeAction: Equatable { case 없음 }
@@ -188,7 +193,8 @@ private extension ContentSettingFeature {
188193
var mergeEffect: [Effect<Action>] = [
189194
.send(.async(.카테고리_목록_조회_API)),
190195
.send(.inner(.URL_유효성_확인)),
191-
.send(.async(.클립보드_감지))
196+
.send(.async(.클립보드_감지)),
197+
.send(.async(.키보드_감지))
192198
]
193199
if let id = state.domain.contentId {
194200
mergeEffect.append(.send(.async(.컨텐츠_상세_조회_API(id: id))))
@@ -356,6 +362,9 @@ private extension ContentSettingFeature {
356362
.inner(.링크팝업_활성화(.error(title: errorResponse.message))),
357363
animation: .pokitSpring
358364
)
365+
case let .키보드_감지_반영(response):
366+
state.isKeyboardVisible = response
367+
return .none
359368
}
360369
}
361370

@@ -445,6 +454,13 @@ private extension ContentSettingFeature {
445454
await send(.inner(.linkPopup(url)), animation: .pokitSpring)
446455
}
447456
}
457+
458+
case .키보드_감지:
459+
return .run { send in
460+
for await detect in await keyboardClient.isVisible() {
461+
await send(.inner(.키보드_감지_반영(detect)), animation: .pokitSpring)
462+
}
463+
}
448464
}
449465
}
450466

Projects/Feature/FeatureContentSetting/Sources/ContentSetting/ContentSettingView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public extension ContentSettingView {
6767
)
6868
.padding(.horizontal, 20)
6969
.pokitMaxWidth()
70+
.padding(.bottom, store.isKeyboardVisible ? -26 : 0)
71+
.padding(.bottom, 36)
7072
}
7173
.pokitNavigationBar { navigationBar }
7274
.ignoresSafeArea(edges: focusedType == nil ? .bottom : [])

Projects/Feature/FeatureLogin/Sources/AgreeToTerms/AgreeToTermsView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public extension AgreeToTermsView {
4242
state: store.isPersonalAndUsageArgee && store.isServiceAgree ? .filled(.primary) : .disable,
4343
action: { send(.다음_버튼_눌렀을때) }
4444
)
45+
.padding(.bottom, 36)
4546
}
4647
.pokitMaxWidth()
4748
.padding(.horizontal, 20)

Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameFeature.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public struct RegisterNicknameFeature {
1616
@Dependency(\.dismiss) var dismiss
1717
@Dependency(\.mainQueue) var mainQueue
1818
@Dependency(UserClient.self) var userClient
19+
@Dependency(KeyboardClient.self) var keyboardClient
1920
/// - State
2021
@ObservableState
2122
public struct State: Equatable {
@@ -32,6 +33,7 @@ public struct RegisterNicknameFeature {
3233
}
3334
var buttonActive: Bool = false
3435
var textfieldState: PokitInputStyle.State = .default
36+
var isKeyboardVisible: Bool = false
3537
}
3638
/// - Action
3739
public enum Action: FeatureAction, ViewAction {
@@ -47,15 +49,18 @@ public struct RegisterNicknameFeature {
4749
/// - Button Tapped
4850
case 다음_버튼_눌렀을때
4951
case dismiss
52+
case onAppear
5053
}
5154

5255
public enum InnerAction: Equatable {
5356
case 닉네임_텍스트_변경되었을때
5457
case 닉네임_중복_체크_API_반영(Bool)
58+
case 키보드_감지_반영(Bool)
5559
}
5660

5761
public enum AsyncAction: Equatable {
5862
case 닉네임_중복_체크_API
63+
case 키보드_감지
5964
}
6065
public enum ScopeAction: Equatable { case 없음 }
6166
public enum DelegateAction: Equatable {
@@ -110,6 +115,8 @@ private extension RegisterNicknameFeature {
110115
)
111116
case .binding:
112117
return .none
118+
case .onAppear:
119+
return .send(.async(.키보드_감지))
113120
}
114121
}
115122
/// - Inner Effect
@@ -146,6 +153,10 @@ private extension RegisterNicknameFeature {
146153
state.buttonActive = true
147154
}
148155
return .none
156+
157+
case let .키보드_감지_반영(response):
158+
state.isKeyboardVisible = response
159+
return .none
149160
}
150161
}
151162
/// - Async Effect
@@ -156,6 +167,13 @@ private extension RegisterNicknameFeature {
156167
let result = try await userClient.닉네임_중복_체크(nickName)
157168
await send(.inner(.닉네임_중복_체크_API_반영(result.isDuplicate)))
158169
}
170+
171+
case .키보드_감지:
172+
return .run { send in
173+
for await detect in await keyboardClient.isVisible() {
174+
await send(.inner(.키보드_감지_반영(detect)), animation: .pokitSpring)
175+
}
176+
}
159177
}
160178
}
161179
/// - Scope Effect

Projects/Feature/FeatureLogin/Sources/RegisterNickname/RegisterNicknameView.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ public extension RegisterNicknameView {
4545
: .disable,
4646
action: { send(.다음_버튼_눌렀을때) }
4747
)
48-
.setKeyboardHeight()
48+
.padding(.bottom, store.isKeyboardVisible ? -26 : 0)
49+
.padding(.bottom, 36)
50+
// .setKeyboardHeight()
4951
}
5052
.pokitMaxWidth()
5153
.padding(.horizontal, 20)
@@ -59,6 +61,7 @@ public extension RegisterNicknameView {
5961
}
6062
}
6163
.ignoresSafeArea(edges: .bottom)
64+
.onAppear { send(.onAppear) }
6265
}
6366
}
6467
}

Projects/Feature/FeatureLogin/Sources/SelectField/SelectFieldView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public extension SelectFieldView {
3939
action: { send(.nextButtonTapped) }
4040
)
4141
.pokitMaxWidth()
42+
.padding(.bottom, 36)
4243
}
4344
.padding(.horizontal, 20)
4445
.pokitNavigationBar {

Projects/Feature/FeatureLogin/Sources/SignUpDone/SignUpDoneView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public extension SignUpDoneView {
4545
)
4646
.pokitMaxWidth()
4747
.padding(.horizontal, 20)
48+
.padding(.bottom, 36)
4849
.background(.pokit(.bg(.base)))
4950
}
5051
.ignoresSafeArea(edges: .bottom)

0 commit comments

Comments
 (0)