From 3ac0ffa7b9ee46809b93464170059aa3298f3f16 Mon Sep 17 00:00:00 2001 From: "Renato Ferraz C. B. Ferreira" Date: Fri, 5 Dec 2025 15:28:56 -0300 Subject: [PATCH 1/5] Moves PodcastCardView to old version Moves the `PodcastCardView` to a `PodcastCardView_old` version and updates the `PodcastView` to use the old card. This change prepares the way for introducing a new implementation of the `PodcastCardView`. Also, reduces the minimum length of the `Spacer` inside the `GlassCardView` --- .../Podcast/Views/PodcastCardView.swift | 7 ++ .../Podcast/Views/PodcastCardView_old.swift | 71 +++++++++++++++++++ .../Sources/Podcast/Views/PodcastView.swift | 2 +- .../Sources/Videos/Card/GlassCardView.swift | 2 +- 4 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView_old.swift diff --git a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift index 24edceae..78ba9da8 100644 --- a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift +++ b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift @@ -1,3 +1,10 @@ +// +// PodcastCardView.swift +// PodcastLibrary +// +// Created by Renato Ferraz Castelo Branco Ferreira on 05/12/25. +// + import FeedLibrary import SwiftUI import UIComponentsLibrary diff --git a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView_old.swift b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView_old.swift new file mode 100644 index 00000000..0abed19f --- /dev/null +++ b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView_old.swift @@ -0,0 +1,71 @@ +import FeedLibrary +import SwiftUI +import UIComponentsLibrary + +struct PodcastCardView_old: View { + let podcast: PodcastDB + let onPlay: () -> Void + @Environment(\.theme) private var theme + + var body: some View { + Button(action: onPlay) { + VStack(alignment: .leading, spacing: 0) { + thumbnail + metadata + } + } + .cornerRadius(12) + } +} + +private extension PodcastCardView_old { + @ViewBuilder + var thumbnail: some View { + if let url = URL(string: podcast.artworkURL) { + CachedAsyncImage(image: url) + .overlay { + VStack { + HStack { + Text(podcast.duration) + .font(.caption) + .padding(6) + .foregroundColor(.white) + .background(Color(red: 0.0, green: 0.0, blue: 0.0, opacity: 0.80)) + .cornerRadius(6) + Spacer() + } + Spacer() + } + .padding([.top, .leading, .trailing], 10) + } + } + } +} + +private extension PodcastCardView_old { + var metadata: some View { + VStack(spacing: 0) { + HStack(spacing: 0) { + Text(podcast.pubDate.format(using: .dateOnly)) + Spacer() + } + .font(.caption) + .foregroundColor(.primary) + .padding(.bottom, 4) + + HStack { + Text(podcast.title) + .font(.headline) + .multilineTextAlignment(.leading) + .lineLimit(3, reservesSpace: true) + Spacer() + } + .foregroundColor(.primary) + .padding(.bottom, 8) + } + .padding(.horizontal) + .padding(.vertical, 10) + .padding(.bottom, 2) + .background(.background) + } +} diff --git a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastView.swift b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastView.swift index 98029fa8..781224e5 100644 --- a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastView.swift +++ b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastView.swift @@ -57,7 +57,7 @@ extension PodcastView { LazyVGrid(columns: [GridItem(.adaptive(minimum: 300), spacing: 20, alignment: .top)], spacing: 20) { ForEach(podcasts) { podcast in - PodcastCardView(podcast: podcast) { + PodcastCardView_old(podcast: podcast) { playerManager.loadPodcast(podcast) } } diff --git a/MacMagazine/Features/VideosLibrary/Sources/Videos/Card/GlassCardView.swift b/MacMagazine/Features/VideosLibrary/Sources/Videos/Card/GlassCardView.swift index 6a7893b8..f6fc0a0a 100644 --- a/MacMagazine/Features/VideosLibrary/Sources/Videos/Card/GlassCardView.swift +++ b/MacMagazine/Features/VideosLibrary/Sources/Videos/Card/GlassCardView.swift @@ -176,7 +176,7 @@ struct GlassCardView: View { .foregroundStyle(.white.opacity(0.9)) .shadow(color: .white.opacity(0.6), radius: 2, x: 0, y: 1) - Spacer(minLength: 8) + Spacer(minLength: 1) duration } From fa04350de58da228ab7ca28505159b03fcd11354 Mon Sep 17 00:00:00 2001 From: "Renato Ferraz C. B. Ferreira" Date: Fri, 5 Dec 2025 18:25:55 -0300 Subject: [PATCH 2/5] Adapts podcast card layout based on dynamic type size Introduces an adaptive podcast card view that switches between a "glass" style card and a standard card based on the user's dynamic type size setting. The "glass" style card is used for smaller dynamic type sizes, while the standard card is used for larger sizes, improving readability and usability across different accessibility settings. --- .../Extensions/DynamicTypeSize.swift | 19 ++ .../Podcast/Views/PodcastCardView.swift | 251 ++++++++++++++++-- .../Podcast/Views/PodcastCardView_old.swift | 71 ----- .../Sources/Podcast/Views/PodcastView.swift | 2 +- .../Sources/Videos/Card/GlassCardView.swift | 22 +- 5 files changed, 250 insertions(+), 115 deletions(-) create mode 100644 MacMagazine/Features/MacMagazineLibrary/Sources/MacMagazineLibrary/Extensions/DynamicTypeSize.swift delete mode 100644 MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView_old.swift diff --git a/MacMagazine/Features/MacMagazineLibrary/Sources/MacMagazineLibrary/Extensions/DynamicTypeSize.swift b/MacMagazine/Features/MacMagazineLibrary/Sources/MacMagazineLibrary/Extensions/DynamicTypeSize.swift new file mode 100644 index 00000000..d2f3391c --- /dev/null +++ b/MacMagazine/Features/MacMagazineLibrary/Sources/MacMagazineLibrary/Extensions/DynamicTypeSize.swift @@ -0,0 +1,19 @@ +import SwiftUI + +public extension DynamicTypeSize { + var usesPrimaryCardLayout: Bool { + switch self { + case .xSmall, + .small, + .medium, + .large, + .xLarge, + .xxLarge, + .xxxLarge: + return true + + default: + return false + } + } +} diff --git a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift index 78ba9da8..8a77f5c4 100644 --- a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift +++ b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift @@ -1,17 +1,177 @@ -// -// PodcastCardView.swift -// PodcastLibrary -// -// Created by Renato Ferraz Castelo Branco Ferreira on 05/12/25. -// - import FeedLibrary +import MacMagazineLibrary import SwiftUI import UIComponentsLibrary -struct PodcastCardView: View { +struct AdaptivePodcastCardView: View { + @Environment(\.dynamicTypeSize) private var dynamicTypeSize + let podcast: PodcastDB + let onPlay: () -> Void + + var body: some View { + Group { + if dynamicTypeSize.usesPrimaryCardLayout { + GlassPodcastCardView( + podcast: podcast, + onPlay: onPlay + ) + } else { + PodcastCardView( + podcast: podcast, + onPlay: onPlay + ) + } + } + } +} + +// MARK: - New Card + +private struct GlassPodcastCardView: View { + let podcast: PodcastDB + let onPlay: () -> Void + + @Environment(\.theme) private var theme + + @State private var cardWidth: CGFloat = 0 + @State private var thumbnailSize: CGSize = .zero + + private var density: CardDensity { .from(width: cardWidth) } + + var body: some View { + Button(action: onPlay) { + + ZStack(alignment: .bottom) { + cardBase + // topButtons + } + .clipShape(RoundedRectangle(cornerRadius: 12, style: .continuous)) + .background( + GeometryReader { geo in + Color.clear + .onAppear { cardWidth = geo.size.width } + .onChange(of: geo.size) { _, newValue in + cardWidth = newValue.width + } + } + ) + + + } + .buttonStyle(.plain) + } + + // MARK: - Card base (thumbnail + bottom content) + + private var cardBase: some View { + ZStack(alignment: .bottom) { + thumbnail + content + } + } + + var fallbackBackground: LinearGradient { + LinearGradient( + gradient: Gradient(stops: [ + .init(color: .black.opacity(0.40), location: 0.0), + .init(color: .black.opacity(0.85), location: 1.0) + ]), + startPoint: .top, + endPoint: .bottom + ) + } + + // MARK: - Thumbnail + + @ViewBuilder + var thumbnail: some View { + if let url = URL(string: podcast.artworkURL) { + CachedAsyncImage(image: url) + } + } + + // MARK: - Bottom content block + + private var content: some View { + VStack(alignment: .leading, spacing: 6) { + + if density != .spacious { + dateRow + .font(.caption2) + .foregroundStyle(.white.opacity(0.9)) + .lineLimit(1) + .minimumScaleFactor(0.8) + .shadow(color: .white.opacity(0.6), radius: 2, x: 0, y: 1) + } + + Text(podcast.title) + .font(density.titleFont) + .multilineTextAlignment(.leading) + .lineLimit(density.titleLineLimit) + .foregroundStyle(.white) + .shadow(color: .white.opacity(0.6), radius: 2, x: 0, y: 1) + + HStack(alignment: .firstTextBaseline, spacing: 8) { + if density == .spacious { + dateRow + .foregroundStyle(.white.opacity(0.9)) + .shadow(color: .white.opacity(0.6), radius: 2, x: 0, y: 1) + } + + Spacer(minLength: 4) + + duration + .lineLimit(1) + .minimumScaleFactor(0.8) + .layoutPriority(0) + } + .font(.caption2) + .shadow(color: .black.opacity(0.7), radius: 2, x: 0, y: 1) + } + .padding(.horizontal, 12) + .padding(.vertical, 10) + .padding(.top, density == .compact ? 20 : 30) + .frame(maxWidth: .infinity, alignment: .leading) + .background(gradientOverlay) + } + + var gradientOverlay: LinearGradient { + LinearGradient( + gradient: Gradient(stops: [ + .init(color: .black.opacity(0.0), location: 0.0), + .init(color: .black.opacity(0.60), location: 0.4), + .init(color: .black.opacity(0.95), location: 1.0) + ]), + startPoint: .top, + endPoint: .bottom + ) + } + + private var dateRow: some View { + HStack(spacing: 4) { + Image(systemName: "calendar") + Text(podcast.pubDate.format(using: .dateOnly)) + } + } + + private var duration: some View { + Text(podcast.duration) + .font(.caption) + .padding(.horizontal, 8) + .padding(.vertical, 4) + .foregroundColor(.white) + .lineLimit(1) + .minimumScaleFactor(0.8) + .glassEffect(.clear, in: .rect(cornerRadius: 6)) + } +} + +// MARK: - Old Card + +private struct PodcastCardView: View { let podcast: PodcastDB let onPlay: () -> Void + @Environment(\.theme) private var theme var body: some View { @@ -23,33 +183,38 @@ struct PodcastCardView: View { } .cornerRadius(12) } -} -private extension PodcastCardView { @ViewBuilder var thumbnail: some View { if let url = URL(string: podcast.artworkURL) { CachedAsyncImage(image: url) .overlay { - VStack { - HStack { - Text(podcast.duration) - .font(.caption) - .padding(6) - .foregroundColor(.white) - .background(Color(red: 0.0, green: 0.0, blue: 0.0, opacity: 0.80)) - .cornerRadius(6) + ZStack { + VStack { + HStack { + Text(podcast.duration) + .font(.caption) + .padding(6) + .foregroundColor(.white) + .background( + Color( + red: 0.0, + green: 0.0, + blue: 0.0, + opacity: 0.80 + ) + ) + .cornerRadius(6) + Spacer() + } Spacer() } - Spacer() + .padding([.top, .leading, .trailing], 10) } - .padding([.top, .leading, .trailing], 10) } } } -} -private extension PodcastCardView { var metadata: some View { VStack(spacing: 0) { HStack(spacing: 0) { @@ -76,3 +241,45 @@ private extension PodcastCardView { .background(.background) } } + +#if DEBUG +#Preview { + @Previewable @State var playing = false + @Previewable @Environment(\.theme) var theme + + let mockPodcast = PodcastDB( + postId: "1", + title: "MacMagazine no Ar #123: Especial WWDC 2024", + subtitle: "Neste episódio especial, discutimos todas as novidades anunciadas na WWDC 2024", + pubDate: Date(), + artworkURL: "https://macmagazine.com.br/wp-content/uploads/2025/11/28-podcast-1260x709.jpg", + podcastURL: "https://traffic.libsyn.com/secure/macmagazine/MacMagazine_no_Ar_001.mp3", + podcastSize: 50_000_000, + duration: "45:30", + podcastFrame: "", + favorite: false, + playable: true + ) + + ZStack { + theme.main.background.color + .edgesIgnoringSafeArea(.all) + + VStack { + PodcastCardView( + podcast: mockPodcast, + onPlay: { playing.toggle() } + ) + .padding() + + GlassPodcastCardView( + podcast: mockPodcast, + onPlay: { playing.toggle() } + ) + .padding() + } + } + .environment(\.theme, ThemeColor()) + +} +#endif diff --git a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView_old.swift b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView_old.swift deleted file mode 100644 index 0abed19f..00000000 --- a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView_old.swift +++ /dev/null @@ -1,71 +0,0 @@ -import FeedLibrary -import SwiftUI -import UIComponentsLibrary - -struct PodcastCardView_old: View { - let podcast: PodcastDB - let onPlay: () -> Void - @Environment(\.theme) private var theme - - var body: some View { - Button(action: onPlay) { - VStack(alignment: .leading, spacing: 0) { - thumbnail - metadata - } - } - .cornerRadius(12) - } -} - -private extension PodcastCardView_old { - @ViewBuilder - var thumbnail: some View { - if let url = URL(string: podcast.artworkURL) { - CachedAsyncImage(image: url) - .overlay { - VStack { - HStack { - Text(podcast.duration) - .font(.caption) - .padding(6) - .foregroundColor(.white) - .background(Color(red: 0.0, green: 0.0, blue: 0.0, opacity: 0.80)) - .cornerRadius(6) - Spacer() - } - Spacer() - } - .padding([.top, .leading, .trailing], 10) - } - } - } -} - -private extension PodcastCardView_old { - var metadata: some View { - VStack(spacing: 0) { - HStack(spacing: 0) { - Text(podcast.pubDate.format(using: .dateOnly)) - Spacer() - } - .font(.caption) - .foregroundColor(.primary) - .padding(.bottom, 4) - - HStack { - Text(podcast.title) - .font(.headline) - .multilineTextAlignment(.leading) - .lineLimit(3, reservesSpace: true) - Spacer() - } - .foregroundColor(.primary) - .padding(.bottom, 8) - } - .padding(.horizontal) - .padding(.vertical, 10) - .padding(.bottom, 2) - .background(.background) - } -} diff --git a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastView.swift b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastView.swift index 781224e5..8f93719a 100644 --- a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastView.swift +++ b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastView.swift @@ -57,7 +57,7 @@ extension PodcastView { LazyVGrid(columns: [GridItem(.adaptive(minimum: 300), spacing: 20, alignment: .top)], spacing: 20) { ForEach(podcasts) { podcast in - PodcastCardView_old(podcast: podcast) { + AdaptivePodcastCardView(podcast: podcast) { playerManager.loadPodcast(podcast) } } diff --git a/MacMagazine/Features/VideosLibrary/Sources/Videos/Card/GlassCardView.swift b/MacMagazine/Features/VideosLibrary/Sources/Videos/Card/GlassCardView.swift index 5b137e21..e78a2947 100644 --- a/MacMagazine/Features/VideosLibrary/Sources/Videos/Card/GlassCardView.swift +++ b/MacMagazine/Features/VideosLibrary/Sources/Videos/Card/GlassCardView.swift @@ -22,7 +22,7 @@ public struct AdaptiveVideoCard: VideoCard { var body: some View { Group { - if shouldUseGlass { + if dynamicTypeSize.usesPrimaryCardLayout { GlassCard() .makeBody(data: data) } else { @@ -31,21 +31,6 @@ public struct AdaptiveVideoCard: VideoCard { } } } - - private var shouldUseGlass: Bool { - switch dynamicTypeSize { - case .xSmall, - .small, - .medium, - .large, - .xLarge, - .xxLarge, - .xxxLarge: - return true - default: - return false - } - } } } @@ -64,17 +49,12 @@ public struct GlassCard: VideoCard { @MainActor struct GlassCardView: View { @Namespace var namespace - @Environment(\.sizeCategory) private var sizeCategory let data: VideoDB @State private var cardWidth: CGFloat = 0 @State private var thumbnailSize: CGSize = .zero - var isAccessibilityCategory: Bool { - sizeCategory.isAccessibilityCategory - } - private var density: CardDensity { .from(width: cardWidth) } // MARK: - Body From 9e15a2335d5bdc4044fbc04072564454f2b02716 Mon Sep 17 00:00:00 2001 From: "Renato Ferraz C. B. Ferreira" Date: Sat, 6 Dec 2025 08:22:32 -0300 Subject: [PATCH 3/5] Adds share button to podcast card Improves the Podcast Card View by adding a share button to the top right corner, allowing users to easily share the podcast URL. This enhancement provides a more streamlined user experience. Removes unused code. --- .../Podcast/Views/PodcastCardView.swift | 48 ++++++++++++------- .../Sources/Videos/Card/GlassCardView.swift | 30 ------------ 2 files changed, 30 insertions(+), 48 deletions(-) diff --git a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift index 8a77f5c4..da3a293c 100644 --- a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift +++ b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift @@ -2,6 +2,8 @@ import FeedLibrary import MacMagazineLibrary import SwiftUI import UIComponentsLibrary +import UtilityLibrary +import YouTubeLibrary struct AdaptivePodcastCardView: View { @Environment(\.dynamicTypeSize) private var dynamicTypeSize @@ -41,9 +43,10 @@ private struct GlassPodcastCardView: View { var body: some View { Button(action: onPlay) { - ZStack(alignment: .bottom) { + ZStack(alignment: .topTrailing) { cardBase - // topButtons + topButtons + .padding(10) } .clipShape(RoundedRectangle(cornerRadius: 12, style: .continuous)) .background( @@ -55,8 +58,6 @@ private struct GlassPodcastCardView: View { } } ) - - } .buttonStyle(.plain) } @@ -95,15 +96,6 @@ private struct GlassPodcastCardView: View { private var content: some View { VStack(alignment: .leading, spacing: 6) { - if density != .spacious { - dateRow - .font(.caption2) - .foregroundStyle(.white.opacity(0.9)) - .lineLimit(1) - .minimumScaleFactor(0.8) - .shadow(color: .white.opacity(0.6), radius: 2, x: 0, y: 1) - } - Text(podcast.title) .font(density.titleFont) .multilineTextAlignment(.leading) @@ -112,11 +104,9 @@ private struct GlassPodcastCardView: View { .shadow(color: .white.opacity(0.6), radius: 2, x: 0, y: 1) HStack(alignment: .firstTextBaseline, spacing: 8) { - if density == .spacious { - dateRow - .foregroundStyle(.white.opacity(0.9)) - .shadow(color: .white.opacity(0.6), radius: 2, x: 0, y: 1) - } + dateRow + .foregroundStyle(.white.opacity(0.9)) + .shadow(color: .white.opacity(0.6), radius: 2, x: 0, y: 1) Spacer(minLength: 4) @@ -147,6 +137,27 @@ private struct GlassPodcastCardView: View { ) } + @ViewBuilder var topButtons: some View { +// FavoriteShareContainer( +// favoriteView: FavoriteButton(content: data), +// shareView: ShareButton(content: data) +// ) + + if let urlPodCast = URL(string: podcast.podcastURL) { + UtilityLibrary.ShareButton(title: podcast.title, + url: urlPodCast) + .buttonStyle(.plain) + .tint(.primary) + .font(.system(size: 16)) + .padding(.horizontal, 14) + .padding(.vertical, 10) + .padding(.bottom, 2) + .glassEffect() + } else { + EmptyView() + } + } + private var dateRow: some View { HStack(spacing: 4) { Image(systemName: "calendar") @@ -283,3 +294,4 @@ private struct PodcastCardView: View { } #endif + diff --git a/MacMagazine/Features/VideosLibrary/Sources/Videos/Card/GlassCardView.swift b/MacMagazine/Features/VideosLibrary/Sources/Videos/Card/GlassCardView.swift index 8d715120..d9927615 100644 --- a/MacMagazine/Features/VideosLibrary/Sources/Videos/Card/GlassCardView.swift +++ b/MacMagazine/Features/VideosLibrary/Sources/Videos/Card/GlassCardView.swift @@ -4,36 +4,6 @@ import SwiftUI import UtilityLibrary import YouTubeLibrary -@MainActor -public struct AdaptiveVideoCard: VideoCard { - public var accessibilityLabels: [CardLabel]? - public var accessibilityButtons: [CardButton]? - - public init() {} - - public func makeBody(data: VideoDB) -> some View { - AdaptiveBody(data: data) - } - - private struct AdaptiveBody: View { - @Environment(\.dynamicTypeSize) private var dynamicTypeSize - - let data: VideoDB - - var body: some View { - Group { - if dynamicTypeSize.usesPrimaryCardLayout { - GlassCard() - .makeBody(data: data) - } else { - ClassicCard() - .makeBody(data: data) - } - } - } - } -} - // MARK: - GlassCard @MainActor From 1ae4f9cc3495bc83c60624ae8920942ed2bcfca7 Mon Sep 17 00:00:00 2001 From: Renato Ferraz Date: Tue, 9 Dec 2025 10:30:25 -0300 Subject: [PATCH 4/5] Comments out favorite button implementation Comments out the Podcast Favorite Button implementation within the PodcastCardView. This change is made because the Podcast Favorite Button functionality is not yet ready for use. The code is commented out rather than removed to preserve the implementation for future use when the functionality is complete. --- .../Sources/Podcast/Views/PodcastCardView.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift index da3a293c..edfac0d7 100644 --- a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift +++ b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift @@ -138,11 +138,14 @@ private struct GlassPodcastCardView: View { } @ViewBuilder var topButtons: some View { + + //TODO: Uncomment this code when the Podcast Favorite Button functionality is ready. // FavoriteShareContainer( -// favoriteView: FavoriteButton(content: data), +// favoriteView: PodcastFavoriteButton(content: data), // shareView: ShareButton(content: data) // ) + //TODO: Remove this code when the Podcast Favorite Button functionality is ready. if let urlPodCast = URL(string: podcast.podcastURL) { UtilityLibrary.ShareButton(title: podcast.title, url: urlPodCast) From 3ee9d3eeffaf7f6b405b2f48265f8faaef0d2702 Mon Sep 17 00:00:00 2001 From: Renato Ferraz Date: Tue, 9 Dec 2025 10:35:08 -0300 Subject: [PATCH 5/5] Removes commented-out code in PodcastCardView Cleans up PodcastCardView by removing commented-out code related to the favorite button and share button functionality. This improves code readability and maintainability by removing unnecessary clutter. --- .../PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift | 3 --- 1 file changed, 3 deletions(-) diff --git a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift index edfac0d7..64ba8bed 100644 --- a/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift +++ b/MacMagazine/Features/PodcastLibrary/Sources/Podcast/Views/PodcastCardView.swift @@ -139,13 +139,11 @@ private struct GlassPodcastCardView: View { @ViewBuilder var topButtons: some View { - //TODO: Uncomment this code when the Podcast Favorite Button functionality is ready. // FavoriteShareContainer( // favoriteView: PodcastFavoriteButton(content: data), // shareView: ShareButton(content: data) // ) - //TODO: Remove this code when the Podcast Favorite Button functionality is ready. if let urlPodCast = URL(string: podcast.podcastURL) { UtilityLibrary.ShareButton(title: podcast.title, url: urlPodCast) @@ -297,4 +295,3 @@ private struct PodcastCardView: View { } #endif -