-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for creator update detail screens
- Loading branch information
1 parent
ef38dd9
commit 04ccf57
Showing
9 changed files
with
315 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...arra/Containers/Widgets/Feed/Views/CreatorUpdates/FeedCreatorUpdateDetailHeaderView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// | ||
// FeedCreatorUpdateDetailHeaderView.swift | ||
// Parra | ||
// | ||
// Created by Mick MacCallum on 12/16/24. | ||
// | ||
|
||
import SwiftUI | ||
import UIKit | ||
|
||
struct FeedCreatorUpdateDetailHeaderView: View { | ||
let creatorUpdate: ParraCreatorUpdateAppStub | ||
let feedItemId: String | ||
let containerGeometry: GeometryProxy | ||
@ObservedObject var reactor: FeedItemReactor | ||
|
||
var body: some View { | ||
VStack(spacing: 0) { | ||
FeedCreatorUpdateHeaderView( | ||
creatorUpdate: creatorUpdate | ||
) | ||
.padding([.horizontal, .top], 16) | ||
|
||
FeedCreatorUpdateContentView( | ||
creatorUpdate: creatorUpdate | ||
) | ||
.padding(.horizontal, 16) | ||
|
||
if let attachments = creatorUpdate.attachments?.elements, | ||
!attachments.isEmpty, | ||
containerGeometry.size.width > 0 && containerGeometry.size.height > 0 | ||
{ | ||
ParraPaywalledContentView( | ||
entitlement: creatorUpdate.attachmentPaywall?.entitlement, | ||
context: creatorUpdate.attachmentPaywall?.context | ||
) { requiredEntitlement, unlock in | ||
CreatorUpdateAttachmentsView( | ||
attachments: attachments, | ||
containerGeometry: containerGeometry, | ||
requiredEntitlement: requiredEntitlement | ||
) { | ||
do { | ||
try await unlock() | ||
} catch { | ||
Logger.error("Error unlocking attachment", error) | ||
} | ||
} | ||
} unlockedContentBuilder: { | ||
CreatorUpdateAttachmentsView( | ||
attachments: attachments, | ||
containerGeometry: containerGeometry | ||
) | ||
} | ||
.padding(.top, 8) | ||
} | ||
|
||
if reactor.showReactions { | ||
FeedReactionView( | ||
feedItemId: feedItemId, | ||
reactor: _reactor | ||
) | ||
.padding() | ||
.frame( | ||
maxWidth: .infinity, | ||
alignment: .leading | ||
) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.