Skip to content

Commit

Permalink
hacked images to be smooth
Browse files Browse the repository at this point in the history
  • Loading branch information
EricBAndrews committed Sep 16, 2023
1 parent 6c23b8b commit 522b499
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Mlem/Views/Shared/Links/Community/CommunityLinkView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ struct CommunityLinkView: View {
}

var body: some View {
NavigationLink(value: community) {
// NavigationLink(value: community) {
NavigationLink(.apiCommunity(community)) {
HStack {
CommunityLabelView(
community: community,
Expand Down
14 changes: 11 additions & 3 deletions Mlem/Views/Shared/Posts/Post Sizes/Large Post.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ struct LargePost: View {
}
}

// REMOVEME: needed for TF hack
var screenWidth: CGFloat = UIScreen.main.bounds.width - (AppConstants.postAndCommentSpacing * 2)

// initializer--used so we can set showNsfwFilterToggle to false when expanded or true when not
init(
post: PostModel,
Expand Down Expand Up @@ -202,13 +205,18 @@ struct LargePost: View {
if layoutMode != .minimize {
CachedImage(
url: url,
maxHeight: layoutMode.getMaxHeight(limitHeight),
// maxHeight: layoutMode.getMaxHeight(limitHeight),
// CHANGEME: hack for TF release
fixedSize: CGSize(width: screenWidth, height: screenWidth),
dismissCallback: markPostAsRead,
cornerRadius: AppConstants.largeItemCornerRadius
)
.frame(
maxWidth: .infinity,
maxHeight: layoutMode.getMaxHeight(limitHeight),
// CHANGEME: hack for TF release
width: screenWidth,
height: screenWidth,
// maxWidth: .infinity,
// maxHeight: layoutMode.getMaxHeight(limitHeight),
alignment: .top
)
.applyNsfwOverlay(post.post.nsfw || post.community.nsfw, canTapFullImage: isExpanded)
Expand Down
17 changes: 13 additions & 4 deletions Mlem/Views/Shared/Website Icon Complex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,23 @@ struct WebsiteIconComplex: View {
}
return "some website"
}

// REMOVEME: needed for TF hack
var screenWidth: CGFloat = UIScreen.main.bounds.width - (AppConstants.postAndCommentSpacing * 2)

var body: some View {
VStack(spacing: 0) {
if shouldShowWebsitePreviews, let thumbnailURL = post.thumbnailImageUrl {
CachedImage(url: thumbnailURL, shouldExpand: false)
.frame(maxHeight: 400)
.applyNsfwOverlay(post.nsfw)
.clipped()
CachedImage(
url: thumbnailURL,
shouldExpand: false,
// CHANGEME: hack for TF release
fixedSize: CGSize(width: screenWidth, height: screenWidth * 0.66)
)
// .frame(maxHeight: 400)
.frame(width: screenWidth, height: screenWidth * 0.66)
.applyNsfwOverlay(post.nsfw)
.clipped()
}

VStack(alignment: .leading, spacing: AppConstants.postAndCommentSpacing) {
Expand Down

0 comments on commit 522b499

Please sign in to comment.