@@ -90,6 +90,9 @@ struct SavedListView: View {
90
90
. frame ( width: 44 , height: 44 )
91
91
}
92
92
)
93
+ . overlay ( alignment: . topTrailing) {
94
+ bookmarkButton ( cafe: cafe)
95
+ }
93
96
}
94
97
Text ( cafe. name)
95
98
. lineLimit ( 1 )
@@ -130,20 +133,7 @@ struct SavedListView: View {
130
133
height: ( proxy. size. width - 60 ) / 2
131
134
)
132
135
. 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)
147
137
}
148
138
. background ( alignment: . center) {
149
139
KFImage . url ( URL ( string: cafe. imageUrls? . first ?? " " ) )
@@ -161,6 +151,25 @@ struct SavedListView: View {
161
151
}
162
152
}
163
153
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
+
164
173
private var emptyListReplaceView : some View {
165
174
VStack ( alignment: . center) {
166
175
Text ( " 아직 저장된 공간이 없어요 " )
0 commit comments