Skip to content

Commit 8bec6c1

Browse files
committed
[fix] #193 se 기기 값 미적용 수정
1 parent 768eb6a commit 8bec6c1

File tree

4 files changed

+144
-130
lines changed

4 files changed

+144
-130
lines changed

Projects/DSKit/Sources/Components/PokitAlert.swift

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -31,54 +31,58 @@ public struct PokitAlert: View {
3131
}
3232

3333
public var body: some View {
34-
VStack(spacing: 0) {
35-
VStack(spacing: 8) {
36-
title
34+
GeometryReader { proxy in
35+
let bottomSafeArea = proxy.safeAreaInsets.bottom
36+
VStack(spacing: 0) {
37+
VStack(spacing: 8) {
38+
title
39+
40+
if message != nil {
41+
messageLabel
42+
}
43+
}
44+
.padding(.top, 36)
45+
.padding(.bottom, 20)
3746

38-
if message != nil {
39-
messageLabel
47+
PokitBottomSwitchRadio {
48+
PokitPartSwitchRadio(
49+
labelText: "취소",
50+
selection: .constant(false),
51+
to: true,
52+
style: .stroke
53+
) {
54+
cancelAction?()
55+
dismiss()
56+
}
57+
.background()
58+
59+
PokitPartSwitchRadio(
60+
labelText: confirmText,
61+
selection: .constant(true),
62+
to: true,
63+
style: .filled,
64+
action: action
65+
)
66+
.background()
4067
}
68+
.pokitMaxWidth()
4169
}
42-
.padding(.top, 36)
43-
.padding(.bottom, 20)
44-
45-
PokitBottomSwitchRadio {
46-
PokitPartSwitchRadio(
47-
labelText: "취소",
48-
selection: .constant(false),
49-
to: true,
50-
style: .stroke
51-
) {
52-
cancelAction?()
53-
dismiss()
70+
.pokitPresentationBackground()
71+
.pokitPresentationCornerRadius()
72+
.presentationDragIndicator(.visible)
73+
.padding(.bottom, 36 - bottomSafeArea)
74+
.readHeight()
75+
.onPreferenceChange(HeightPreferenceKey.self) { height in
76+
if let height {
77+
self.height = height
5478
}
55-
.background()
56-
57-
PokitPartSwitchRadio(
58-
labelText: confirmText,
59-
selection: .constant(true),
60-
to: true,
61-
style: .filled,
62-
action: action
63-
)
64-
.background()
6579
}
66-
.pokitMaxWidth()
67-
}
68-
.pokitPresentationBackground()
69-
.pokitPresentationCornerRadius()
70-
.presentationDragIndicator(.visible)
71-
.readHeight()
72-
.onPreferenceChange(HeightPreferenceKey.self) { height in
73-
if let height {
74-
self.height = height
80+
.presentationDetents([.height(self.height)])
81+
.onAppear {
82+
UINotificationFeedbackGenerator()
83+
.notificationOccurred(.warning)
7584
}
7685
}
77-
.presentationDetents([.height(self.height)])
78-
.onAppear {
79-
UINotificationFeedbackGenerator()
80-
.notificationOccurred(.warning)
81-
}
8286
}
8387

8488
private var title: some View {

Projects/DSKit/Sources/Components/PokitDeleteBottomSheet.swift

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -22,51 +22,56 @@ public struct PokitDeleteBottomSheet: View {
2222
}
2323

2424
public var body: some View {
25-
VStack(spacing: 0) {
26-
/// - 텍스트 영역
27-
VStack(spacing: 8) {
28-
Text(type.sheetTitle)
29-
.foregroundStyle(.pokit(.text(.primary)))
30-
.pokitFont(.title2)
31-
Text(type.sheetContents)
32-
.fixedSize(horizontal: false, vertical: true)
33-
.multilineTextAlignment(.center)
34-
.foregroundStyle(.pokit(.text(.secondary)))
35-
.pokitFont(.b2(.m))
25+
GeometryReader { proxy in
26+
let bottomSafeArea = proxy.safeAreaInsets.bottom
27+
28+
VStack(spacing: 0) {
29+
/// - 텍스트 영역
30+
VStack(spacing: 8) {
31+
Text(type.sheetTitle)
32+
.foregroundStyle(.pokit(.text(.primary)))
33+
.pokitFont(.title2)
34+
Text(type.sheetContents)
35+
.fixedSize(horizontal: false, vertical: true)
36+
.multilineTextAlignment(.center)
37+
.foregroundStyle(.pokit(.text(.secondary)))
38+
.pokitFont(.b2(.m))
39+
}
40+
.padding(.top, 36)
41+
.padding(.bottom, 20)
42+
/// - 취소 / 삭제 버튼 영역
43+
HStack(spacing: 8) {
44+
PokitBottomButton(
45+
"취소",
46+
state: .default(.primary),
47+
action: { delegateSend?(.cancelButtonTapped) }
48+
)
49+
50+
PokitBottomButton(
51+
"삭제",
52+
state: .filled(.primary),
53+
action: { delegateSend?(.deleteButtonTapped) }
54+
)
55+
}
3656
}
37-
.padding(.top, 36)
38-
.padding(.bottom, 20)
39-
/// - 취소 / 삭제 버튼 영역
40-
HStack(spacing: 8) {
41-
PokitBottomButton(
42-
"취소",
43-
state: .default(.primary),
44-
action: { delegateSend?(.cancelButtonTapped) }
45-
)
46-
47-
PokitBottomButton(
48-
"삭제",
49-
state: .filled(.primary),
50-
action: { delegateSend?(.deleteButtonTapped) }
51-
)
57+
.padding(.horizontal, 20)
58+
.padding(.bottom, 36 - bottomSafeArea)
59+
.background(.white)
60+
.pokitPresentationCornerRadius()
61+
.pokitPresentationBackground()
62+
.presentationDragIndicator(.visible)
63+
.readHeight()
64+
.onPreferenceChange(HeightPreferenceKey.self) { height in
65+
if let height {
66+
self.height = height
67+
}
5268
}
53-
}
54-
.padding(.horizontal, 20)
55-
.background(.white)
56-
.pokitPresentationCornerRadius()
57-
.pokitPresentationBackground()
58-
.presentationDragIndicator(.visible)
59-
.readHeight()
60-
.onPreferenceChange(HeightPreferenceKey.self) { height in
61-
if let height {
62-
self.height = height
69+
.presentationDetents([.height(self.height)])
70+
.onAppear {
71+
UINotificationFeedbackGenerator()
72+
.notificationOccurred(.warning)
6373
}
6474
}
65-
.presentationDetents([.height(self.height)])
66-
.onAppear {
67-
UINotificationFeedbackGenerator()
68-
.notificationOccurred(.warning)
69-
}
7075
}
7176
}
7277
//MARK: - Delegate

Projects/Feature/FeatureCategorySetting/Sources/PokitCategorySettingView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public extension PokitCategorySettingView {
4545
.padding(.bottom, 36)
4646
}
4747
.padding(.horizontal, 20)
48-
.pokitMaxWidth()
49-
.ignoresSafeArea(.container, edges: .bottom)
48+
.padding(.top, 16)
49+
// .pokitMaxWidth()
5050
.pokitNavigationBar { navigationBar }
5151
.sheet(isPresented: $store.isProfileSheetPresented) {
5252
PokitProfileBottomSheet(

Projects/Feature/FeatureCategorySetting/Sources/Sheet/PokitKeywordBottomSheet.swift

Lines changed: 51 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -31,58 +31,63 @@ public struct PokitKeywordBottomSheet: View {
3131
}
3232

3333
public var body: some View {
34-
VStack(alignment: .leading, spacing: 0) {
35-
Text("포킷의 키워드를 선택해 주세요")
36-
.pokitFont(.title1)
37-
.foregroundStyle(.pokit(.text(.primary)))
38-
Text("키워드 기반으로 다른 사용자에게\n링크가 추천됩니다")
39-
.pokitFont(.title3)
40-
.foregroundStyle(.pokit(.text(.secondary)))
41-
.padding(.top, 12)
42-
PokitFlowLayout(rowSpacing: 12, colSpacing: 10) {
43-
ForEach(BaseInterestType.allCases, id: \.self) { field in
44-
let isSelected = selectedKeywordType != .default
45-
if field != .default {
46-
PokitTextChip(
47-
field.title,
48-
state: isSelected && field == selectedKeywordType
49-
? .filled(.primary)
50-
: .default(.primary),
51-
size: .medium
52-
) {
53-
selectedKeywordType = field
34+
GeometryReader { proxy in
35+
let bottomSafeArea = proxy.safeAreaInsets.bottom
36+
VStack(alignment: .leading, spacing: 0) {
37+
Text("포킷의 키워드를 선택해 주세요")
38+
.pokitFont(.title1)
39+
.foregroundStyle(.pokit(.text(.primary)))
40+
Text("키워드 기반으로 다른 사용자에게\n링크가 추천됩니다")
41+
.pokitFont(.title3)
42+
.foregroundStyle(.pokit(.text(.secondary)))
43+
.padding(.top, 12)
44+
.fixedSize(horizontal: false, vertical: true)
45+
PokitFlowLayout(rowSpacing: 16, colSpacing: 12) {
46+
ForEach(BaseInterestType.allCases, id: \.self) { field in
47+
let isSelected = selectedKeywordType != .default
48+
if field != .default {
49+
PokitTextChip(
50+
field.title,
51+
state: isSelected && field == selectedKeywordType
52+
? .filled(.primary)
53+
: .default(.primary),
54+
size: .medium
55+
) {
56+
selectedKeywordType = field
57+
}
5458
}
5559
}
60+
.animation(.pokitDissolve, value: selectedKeywordType)
5661
}
57-
.animation(.pokitDissolve, value: selectedKeywordType)
62+
.padding(.top, 36)
63+
.padding(.bottom, 40)
64+
65+
PokitBottomButton(
66+
"키워드 선택",
67+
state: keywordSheetBottomButtonState,
68+
action: { action(selectedKeywordType) }
69+
)
70+
.padding(.top, 16)
5871
}
59-
.padding(.top, 36)
60-
.padding(.bottom, 40)
61-
62-
PokitBottomButton(
63-
"키워드 선택",
64-
state: keywordSheetBottomButtonState,
65-
action: { action(selectedKeywordType) }
66-
)
67-
.padding(.top, 16)
68-
}
69-
.padding(.horizontal, 20)
70-
.padding(.top, 48)
71-
.onChange(of: selectedKeywordType) { _ in
72-
keywordSheetBottomButtonState = .filled(.primary)
73-
}
74-
.background(.pokit(.bg(.base)))
75-
.pokitPresentationCornerRadius()
76-
.pokitPresentationBackground()
77-
.presentationDragIndicator(.visible)
78-
.readHeight()
79-
.onPreferenceChange(HeightPreferenceKey.self) { height in
80-
if let height {
81-
self.height = height
72+
.padding(.horizontal, 20)
73+
.padding(.top, 48)
74+
.padding(.bottom, 36 - bottomSafeArea)
75+
.onChange(of: selectedKeywordType) { _ in
76+
keywordSheetBottomButtonState = .filled(.primary)
77+
}
78+
.background(.pokit(.bg(.base)))
79+
.pokitPresentationCornerRadius()
80+
.pokitPresentationBackground()
81+
.presentationDragIndicator(.visible)
82+
.readHeight()
83+
.onPreferenceChange(HeightPreferenceKey.self) { height in
84+
if let height {
85+
self.height = height
86+
}
8287
}
88+
.presentationDetents([.height(height)])
89+
.ignoresSafeArea(edges: [.bottom, .top])
8390
}
84-
.presentationDetents([.height(height)])
85-
.ignoresSafeArea(edges: [.bottom, .top])
8691
}
8792
}
8893

0 commit comments

Comments
 (0)