Skip to content

Commit 3596e52

Browse files
applebuddyios-min
authored andcommitted
[Fix] #319 저장리스트, placeholder가 표출되는 경우 북마크버튼 누락되는문제 수정
1 parent 07baf6e commit 3596e52

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

Projects/Coffice/Sources/App/Main/SavedList/SavedListView.swift

+23-14
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ struct SavedListView: View {
9090
.frame(width: 44, height: 44)
9191
}
9292
)
93+
.overlay(alignment: .topTrailing) {
94+
bookmarkButton(cafe: cafe)
95+
}
9396
}
9497
Text(cafe.name)
9598
.lineLimit(1)
@@ -130,20 +133,7 @@ struct SavedListView: View {
130133
height: (proxy.size.width - 60) / 2
131134
)
132135
.overlay(alignment: .topTrailing) {
133-
Button {
134-
viewStore.send(.bookmarkButtonTapped(cafe: cafe))
135-
} label: {
136-
(
137-
cafe.isBookmarked
138-
? CofficeAsset.Asset.bookmarkFill40px.swiftUIImage
139-
: CofficeAsset.Asset.bookmarkLine40px.swiftUIImage
140-
)
141-
.resizable()
142-
.renderingMode(.template)
143-
.foregroundColor(CofficeAsset.Colors.grayScale1.swiftUIColor)
144-
.frame(width: 40, height: 40)
145-
.opacity(0.8)
146-
}
136+
bookmarkButton(cafe: cafe)
147137
}
148138
.background(alignment: .center) {
149139
KFImage.url(URL(string: cafe.imageUrls?.first ?? ""))
@@ -161,6 +151,25 @@ struct SavedListView: View {
161151
}
162152
}
163153

154+
private func bookmarkButton(cafe: Cafe) -> some View {
155+
WithViewStore(store, observe: { $0 }) { viewStore in
156+
Button {
157+
viewStore.send(.bookmarkButtonTapped(cafe: cafe))
158+
} label: {
159+
(
160+
cafe.isBookmarked
161+
? CofficeAsset.Asset.bookmarkFill40px.swiftUIImage
162+
: CofficeAsset.Asset.bookmarkLine40px.swiftUIImage
163+
)
164+
.resizable()
165+
.renderingMode(.template)
166+
.foregroundColor(CofficeAsset.Colors.grayScale1.swiftUIColor)
167+
.frame(width: 40, height: 40)
168+
.opacity(0.8)
169+
}
170+
}
171+
}
172+
164173
private var emptyListReplaceView: some View {
165174
VStack(alignment: .center) {
166175
Text("아직 저장된 공간이 없어요")

0 commit comments

Comments
 (0)