Skip to content

Commit

Permalink
Update InfoRowView.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
ming1016 committed Nov 22, 2024
1 parent 2ee3790 commit 174673b
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions SwiftPamphletApp/InfoOrganizer/Info/InfoRowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,23 @@ import SwiftUI
import InfoOrganizer
import SMDate


struct InfoRowView: View {
@State var info: IOInfo
@State private var showAlert = false
@Environment(\.colorScheme) var colorScheme
@Environment(\.isFocused) private var isFocused
#if os(iOS)
let cardbgColor = Color(UIColor.systemBackground)
#elseif os(macOS)
let cardbgColor = Color(NSColor.textBackgroundColor)
#endif

var body: some View {
VStack(alignment:.leading) {
HStack(alignment: .top) {
if let coverImg = info.coverImage {
VStack {
// Rectangle()
// .fill(Color(light: .white, dark: .black))
// .frame(height: 80)
// .cornerRadius(5)
// GeometryReader { geometry in
// if coverImg.url.isEmpty == false {
// NukeImage(width: geometry.size.width, height: geometry.size.height, url: coverImg.url, contentModel: .fill)
// } else if let imgData = coverImg.imgData {
// if let nsImage = NSImage(data: imgData) {
// Image(nsImage: nsImage)
// .resizable()
// .scaledToFill()
// .frame(width: geometry.size.width, height: geometry.size.height)
// .cornerRadius(5)
// }
// }
// }

if coverImg.url.isEmpty == false {
NukeImage(width: 50, height: 50, url: coverImg.url, contentModel: .fill)
} else if let imgData = coverImg.imgData {
Expand All @@ -57,7 +47,6 @@ struct InfoRowView: View {
}
#endif
}

}
.shadow(color: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 0.3), radius: 1, x: 0, y: 0)
}
Expand Down Expand Up @@ -122,7 +111,8 @@ struct InfoRowView: View {
.font(.footnote)
.padding(EdgeInsets(top: 0, leading: 0, bottom: 10, trailing: 0))
}
.listRowSeparator(.hidden, edges: .all)
// .listRowSeparator(.hidden, edges: .all)
.padding(5)
.swipeActions {
Button(role: .destructive) {
IOInfo.delete(info)
Expand Down

0 comments on commit 174673b

Please sign in to comment.