Skip to content

Commit 6da4439

Browse files
applebuddyios-min
authored andcommitted
[Fix] #319 카페 상세, thumbnail image, placeholder 사양 수정
1 parent 6877403 commit 6da4439

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

Projects/Coffice/Sources/App/Main/Search/CafeDetail/CafeDetailHeaderView.swift

+23-21
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,22 @@ extension CafeDetailHeaderView {
112112
if let imageUrls = viewStore.cafe?.imageUrls,
113113
imageUrls.isNotEmpty {
114114
TabView {
115-
ForEach(imageUrls, id: \.self) { imageUrl in
116-
LinearGradient(
117-
gradient: Gradient(colors: [.black.opacity(0.06), .black.opacity(0.3)]),
118-
startPoint: .top,
119-
endPoint: .bottom
120-
)
121-
.background(alignment: .center) {
122-
KFImage.url(URL(string: imageUrl))
123-
.placeholder {
124-
imagePlaceholderView
115+
ForEach(imageUrls, id: \.self) { imageUrlString in
116+
Group {
117+
if let imageUrl = URL(string: imageUrlString) {
118+
LinearGradient(
119+
gradient: Gradient(colors: [.black.opacity(0.06), .black.opacity(0.3)]),
120+
startPoint: .top,
121+
endPoint: .bottom
122+
)
123+
.background(alignment: .center) {
124+
KFImage.url(imageUrl)
125+
.resizable()
126+
.scaledToFill()
125127
}
126-
.resizable()
127-
.scaledToFill()
128+
} else {
129+
imagePlaceholderView
130+
}
128131
}
129132
}
130133
}
@@ -138,15 +141,14 @@ extension CafeDetailHeaderView {
138141
}
139142

140143
private var imagePlaceholderView: some View {
141-
LinearGradient(
142-
gradient: Gradient(colors: [.black.opacity(0.06), .black.opacity(0.3)]),
143-
startPoint: .top,
144-
endPoint: .bottom
145-
)
146-
.background(alignment: .center) {
147-
CofficeAsset.Asset.icPlaceholder.swiftUIImage
148-
.padding(.top, UIApplication.keyWindow?.safeAreaInsets.top ?? 0.0)
149-
}
144+
CofficeAsset.Colors.grayScale2.swiftUIColor
145+
.overlay(
146+
alignment: .center,
147+
content: {
148+
CofficeAsset.Asset.icPlaceholder.swiftUIImage
149+
.padding(.top, UIApplication.keyWindow?.safeAreaInsets.top ?? 0.0)
150+
}
151+
)
150152
}
151153
}
152154

0 commit comments

Comments
 (0)