feat(main): 라이브 전체 진입을 추가한다
This commit is contained in:
@@ -3,6 +3,7 @@ import SwiftUI
|
||||
struct MainHomeLiveSection: View {
|
||||
let items: [HomeLiveItem]
|
||||
let onTapLive: (Int) -> Void
|
||||
let onTapAll: () -> Void
|
||||
|
||||
var body: some View {
|
||||
if !items.isEmpty {
|
||||
@@ -11,6 +12,8 @@ struct MainHomeLiveSection: View {
|
||||
ForEach(items, id: \.self) { item in
|
||||
MainHomeLiveItemView(item: item, onTapLive: onTapLive)
|
||||
}
|
||||
|
||||
MainHomeLiveAllItemView(onTapAll: onTapAll)
|
||||
}
|
||||
.padding(.horizontal, SodaSpacing.s20)
|
||||
}
|
||||
@@ -54,6 +57,27 @@ private struct MainHomeLiveItemView: View {
|
||||
}
|
||||
}
|
||||
|
||||
private struct MainHomeLiveAllItemView: View {
|
||||
let onTapAll: () -> Void
|
||||
|
||||
var body: some View {
|
||||
Button(action: onTapAll) {
|
||||
VStack(alignment: .center, spacing: SodaSpacing.s6) {
|
||||
Circle()
|
||||
.fill(Color.gray800)
|
||||
.frame(width: 70, height: 70)
|
||||
.overlay {
|
||||
Text(I18n.HomeRecommendation.liveAll)
|
||||
.appFont(.body4)
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
}
|
||||
.frame(width: 70, height: 102, alignment: .top)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
}
|
||||
|
||||
struct MainHomeLiveSection_Previews: PreviewProvider {
|
||||
private static let previewImageUrl = "https://picsum.photos/500/500"
|
||||
|
||||
@@ -72,7 +96,8 @@ struct MainHomeLiveSection_Previews: PreviewProvider {
|
||||
HomeLiveItem(roomId: 1, creatorNickname: "설린", creatorProfileImage: previewImageUrl),
|
||||
HomeLiveItem(roomId: 2, creatorNickname: "크리에이터", creatorProfileImage: previewImageUrl)
|
||||
],
|
||||
onTapLive: { _ in }
|
||||
onTapLive: { _ in },
|
||||
onTapAll: {}
|
||||
)
|
||||
.padding(.vertical, SodaSpacing.s20)
|
||||
.background(Color.black)
|
||||
|
||||
Reference in New Issue
Block a user