feat: 메인 라이브
- 새로운 UI의 기본 골격 적용
This commit is contained in:
@@ -19,51 +19,39 @@ struct LiveView: View {
|
|||||||
ZStack {
|
ZStack {
|
||||||
Color.black.ignoresSafeArea()
|
Color.black.ignoresSafeArea()
|
||||||
|
|
||||||
GeometryReader { geo in
|
|
||||||
ZStack(alignment: .bottomTrailing) {
|
ZStack(alignment: .bottomTrailing) {
|
||||||
ScrollView(.vertical, showsIndicators: false) {
|
VStack(spacing: 0) {
|
||||||
LazyVStack(spacing: 40) {
|
HStack(spacing: 24) {
|
||||||
if viewModel.recommendLiveItems.count > 0 {
|
Image("img_text_logo")
|
||||||
SectionRecommendLiveView(items: viewModel.recommendLiveItems)
|
|
||||||
.padding(.top, 13.3)
|
|
||||||
}
|
|
||||||
|
|
||||||
ZStack {
|
Spacer()
|
||||||
Image("img_bg_review_live")
|
|
||||||
.resizable()
|
|
||||||
.frame(height: 53.3)
|
|
||||||
.frame(maxWidth: .infinity)
|
|
||||||
.cornerRadius(2.6)
|
|
||||||
|
|
||||||
HStack(spacing: 2.7) {
|
|
||||||
Image("ic_thumb_play_purple")
|
|
||||||
|
|
||||||
Text("라이브 다시듣기")
|
|
||||||
.font(.custom(Font.bold.rawValue, size: 16.7))
|
|
||||||
.foregroundColor(Color(hex: "672bff"))
|
|
||||||
}
|
|
||||||
.cornerRadius(2.6)
|
|
||||||
}
|
|
||||||
.padding(.horizontal, 13.3)
|
|
||||||
.onTapGesture {
|
|
||||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||||
AppState.shared.setAppStep(
|
Image("ic_search_white")
|
||||||
step: .contentAllByTheme(themeId: 7)
|
.onTapGesture {
|
||||||
)
|
AppState
|
||||||
} else {
|
.shared
|
||||||
AppState.shared.setAppStep(step: .login)
|
.setAppStep(step: .search)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if viewModel.recommendChannelItems.count > 0 {
|
Image("ic_can_circle")
|
||||||
SectionRecommendChannelView(
|
.onTapGesture {
|
||||||
items: viewModel.isFollowingList ?
|
AppState
|
||||||
viewModel.followedChannelItems :
|
.shared
|
||||||
viewModel.recommendChannelItems,
|
.setAppStep(step: .canCharge(refresh: {}))
|
||||||
isFollowingList: $viewModel.isFollowingList
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Image("ic_message")
|
||||||
|
.onTapGesture {
|
||||||
|
AppState.shared.setAppStep(step: .message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.padding(.horizontal, 24)
|
||||||
|
.padding(.vertical, 20)
|
||||||
|
|
||||||
|
ScrollView(.vertical, showsIndicators: false) {
|
||||||
|
LazyVStack(spacing: 48) {
|
||||||
SectionLiveNowView(
|
SectionLiveNowView(
|
||||||
items: viewModel.liveNowItems,
|
items: viewModel.liveNowItems,
|
||||||
onClickParticipant: {
|
onClickParticipant: {
|
||||||
@@ -85,14 +73,23 @@ struct LiveView: View {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if viewModel.eventBannerItems.count > 0 {
|
|
||||||
SectionEventBannerView(items: viewModel.eventBannerItems)
|
|
||||||
}
|
|
||||||
|
|
||||||
if viewModel.communityPostItems.count > 0 {
|
if viewModel.communityPostItems.count > 0 {
|
||||||
SectionCommunityPostView(items: viewModel.communityPostItems)
|
SectionCommunityPostView(items: viewModel.communityPostItems)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if viewModel.recommendLiveItems.count > 0 {
|
||||||
|
SectionRecommendLiveView(items: viewModel.recommendLiveItems)
|
||||||
|
}
|
||||||
|
|
||||||
|
if viewModel.recommendChannelItems.count > 0 {
|
||||||
|
SectionRecommendChannelView(
|
||||||
|
items: viewModel.isFollowingList ?
|
||||||
|
viewModel.followedChannelItems :
|
||||||
|
viewModel.recommendChannelItems,
|
||||||
|
isFollowingList: $viewModel.isFollowingList
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
SectionLiveReservationView(
|
SectionLiveReservationView(
|
||||||
items: viewModel.liveReservationItems,
|
items: viewModel.liveReservationItems,
|
||||||
onClickCancel: { viewModel.getSummary() },
|
onClickCancel: { viewModel.getSummary() },
|
||||||
@@ -119,8 +116,8 @@ struct LiveView: View {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
.padding(.vertical, 24)
|
||||||
}
|
}
|
||||||
.frame(width: geo.size.width, height: geo.size.height)
|
|
||||||
.onAppear {
|
.onAppear {
|
||||||
viewModel.getSummary()
|
viewModel.getSummary()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,26 +17,6 @@ struct SectionRecommendLiveView: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
HStack(spacing: 0) {
|
|
||||||
Text("추천 ")
|
|
||||||
.font(.custom(Font.bold.rawValue, size: 18.3))
|
|
||||||
.foregroundColor(Color(hex: "ff5c49"))
|
|
||||||
|
|
||||||
Text("라이브")
|
|
||||||
.font(.custom(Font.bold.rawValue, size: 18.3))
|
|
||||||
.foregroundColor(.grayee)
|
|
||||||
|
|
||||||
Spacer()
|
|
||||||
|
|
||||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
|
||||||
Image("ic_message")
|
|
||||||
.onTapGesture {
|
|
||||||
AppState.shared.setAppStep(step: .message)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.frame(width: screenSize().width - 26.7, alignment: .leading)
|
|
||||||
|
|
||||||
TabView(selection: $currentIndex) {
|
TabView(selection: $currentIndex) {
|
||||||
ForEach(0..<items.count, id: \.self) { index in
|
ForEach(0..<items.count, id: \.self) { index in
|
||||||
let item = items[index]
|
let item = items[index]
|
||||||
|
|||||||
Reference in New Issue
Block a user