Skip to content

Commit

Permalink
fixed the display of images in a FeedCell
Browse files Browse the repository at this point in the history
  • Loading branch information
KateKashko committed May 7, 2024
1 parent 9482fc2 commit ddd912d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ struct FeedCell: View {
var body: some View {

VStack {
FeedCellHeaderView(post: PostModel.MockPosts[0])
FeedCellContentView(post: PostModel.MockPosts[1])
FeedCellCountersView(post: PostModel.MockPosts[2])
FeedCellHeaderView(post: post)
FeedCellContentView(post: post)
FeedCellCountersView(post: post)

Divider()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@
//

import SwiftUI
import Design

struct FeedCellContentView: View {
let post: PostModel

var body: some View {
// MARK: - post mesage
// MARK: - post message
Text(post.content)
.frame(maxWidth: .infinity, alignment: .leading)
.font(.footnote)
.padding(.horizontal, 10)
.padding(.top, 4)

// MARK: - post image
if let imageUrl = post.imageUrl, !imageUrl.isEmpty {
Image(imageUrl)
if let image = post.imageUrl, !image.isEmpty {
Image(image, bundle: DesignResources.bundle)
.resizable()
.scaledToFit()
}
Expand Down

0 comments on commit ddd912d

Please sign in to comment.