48 lines
1.5 KiB
Swift
48 lines
1.5 KiB
Swift
import SwiftUI
|
|
|
|
struct CreatorChannelHomeView: View {
|
|
let response: CreatorChannelHomeResponse
|
|
let onSelectTab: (CreatorChannelTab) -> Void
|
|
let onTapLive: (Int) -> Void
|
|
let onTapContent: (Int) -> Void
|
|
let onTapDonate: () -> Void
|
|
|
|
init(
|
|
response: CreatorChannelHomeResponse,
|
|
onSelectTab: @escaping (CreatorChannelTab) -> Void,
|
|
onTapLive: @escaping (Int) -> Void = { _ in },
|
|
onTapContent: @escaping (Int) -> Void = { _ in },
|
|
onTapDonate: @escaping () -> Void = {}
|
|
) {
|
|
self.response = response
|
|
self.onSelectTab = onSelectTab
|
|
self.onTapLive = onTapLive
|
|
self.onTapContent = onTapContent
|
|
self.onTapDonate = onTapDonate
|
|
}
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 0) {
|
|
CreatorChannelCurrentLiveSection(
|
|
currentLive: response.currentLive,
|
|
onTapLive: onTapLive
|
|
)
|
|
|
|
CreatorChannelLatestAudioSection(
|
|
latestAudioContent: response.latestAudioContent,
|
|
onTapContent: onTapContent
|
|
)
|
|
|
|
CreatorChannelDonationSection(
|
|
channelDonations: response.channelDonations,
|
|
onSelectTab: onSelectTab,
|
|
onTapDonate: onTapDonate
|
|
)
|
|
|
|
CreatorChannelNoticeSection(notices: response.notices)
|
|
}
|
|
.frame(maxWidth: .infinity, alignment: .leading)
|
|
.background(Color.black)
|
|
}
|
|
}
|