Update to Nuke 12 (Beta 1) (#924)

* Install Nuke from nuke-12 branch

* Fixes

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
This commit is contained in:
Alex Grebenyuk 2023-02-18 01:25:10 -05:00 committed by GitHub
parent d20423d547
commit 425a4eef4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 16 deletions

View File

@ -50,8 +50,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/kean/Nuke",
"state" : {
"revision" : "67bd45931180f652159e3342575277a7f197b3ab",
"version" : "11.6.2"
"branch" : "nuke-12",
"revision" : "1e3098adc210edb4b93f62d89c4687301e371a9a"
}
},
{

View File

@ -42,8 +42,11 @@ struct AccountDetailHeaderView: View {
LazyImage(url: account.header) { state in
if let image = state.image {
image
.resizingMode(.aspectFill)
.resizable()
.aspectRatio(contentMode: .fill)
.overlay(account.haveHeader ? .black.opacity(0.50) : .clear)
.frame(height: Constants.headerHeight)
.clipped()
} else if state.isLoading {
theme.secondaryBackgroundColor
.frame(height: Constants.headerHeight)

View File

@ -125,16 +125,22 @@ struct ConversationMessageView: View {
}
private func makeMediaView(_ attachement: MediaAttachment) -> some View {
LazyImage(url: attachement.url) { state in
if let image = state.image {
image
.resizingMode(.aspectFill)
.cornerRadius(8)
.padding(8)
} else if state.isLoading {
RoundedRectangle(cornerRadius: 8)
.fill(Color.gray)
.frame(height: 200)
GeometryReader { proxy in
LazyImage(url: attachement.url) { state in
if let image = state.image {
image
.resizable()
.aspectRatio(contentMode: .fill)
.frame(height: 200)
.frame(maxWidth: proxy.frame(in: .local).width)
.clipped()
.cornerRadius(8)
.padding(8)
} else if state.isLoading {
RoundedRectangle(cornerRadius: 8)
.fill(Color.gray)
.frame(height: 200)
}
}
}
.frame(height: 200)

View File

@ -19,7 +19,7 @@ let package = Package(
.package(name: "Models", path: "../Models"),
.package(name: "Env", path: "../Env"),
.package(url: "https://github.com/markiv/SwiftUI-Shimmer", exact: "1.1.0"),
.package(url: "https://github.com/kean/Nuke", from: "11.6.0"),
.package(url: "https://github.com/kean/Nuke", branch: "nuke-12"),
.package(url: "https://github.com/divadretlaw/EmojiText", from: "1.1.0"),
],
targets: [

View File

@ -243,7 +243,8 @@ struct StatusEditorAccessoryView: View {
LazyImage(url: emoji.url) { state in
if let image = state.image {
image
.resizingMode(.aspectFit)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 40, height: 40)
} else if state.isLoading {
Rectangle()

View File

@ -100,7 +100,8 @@ struct StatusEditorMediaView: View {
LazyImage(url: url) { state in
if let image = state.image {
image
.resizingMode(.aspectFill)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 150, height: 150)
} else {
placeholderView