feat: 메인 홈
- 라이브, 인기 크리, 최신 콘텐츠, 이벤트 배너 UI 추가
This commit is contained in:
		
							
								
								
									
										92
									
								
								SodaLive/Sources/Home/HomeLiveItemView.swift
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										92
									
								
								SodaLive/Sources/Home/HomeLiveItemView.swift
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,92 @@
 | 
			
		||||
//
 | 
			
		||||
//  HomeLiveItemView.swift
 | 
			
		||||
//  SodaLive
 | 
			
		||||
//
 | 
			
		||||
//  Created by klaus on 7/11/25.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
import SwiftUI
 | 
			
		||||
import Kingfisher
 | 
			
		||||
 | 
			
		||||
struct HomeLiveItemView: View {
 | 
			
		||||
    
 | 
			
		||||
    let item: GetRoomListResponse
 | 
			
		||||
    
 | 
			
		||||
    var body: some View {
 | 
			
		||||
        HStack(spacing: 16) {
 | 
			
		||||
            ZStack(alignment: .bottom) {
 | 
			
		||||
                ZStack {
 | 
			
		||||
                    KFImage(URL(string: item.creatorProfileImage))
 | 
			
		||||
                        .cancelOnDisappear(true)
 | 
			
		||||
                        .resizable()
 | 
			
		||||
                        .frame(width: 62, height: 62)
 | 
			
		||||
                        .clipShape(Circle())
 | 
			
		||||
                }
 | 
			
		||||
                .padding(7)
 | 
			
		||||
                .overlay {
 | 
			
		||||
                    Circle()
 | 
			
		||||
                        .strokeBorder(lineWidth: 3)
 | 
			
		||||
                        .foregroundColor(.button)
 | 
			
		||||
                }
 | 
			
		||||
                
 | 
			
		||||
                Image("img_live")
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            VStack(alignment: .leading, spacing: 4) {
 | 
			
		||||
                Text(item.title)
 | 
			
		||||
                    .font(.custom(Font.preRegular.rawValue, size: 18))
 | 
			
		||||
                    .foregroundColor(.white)
 | 
			
		||||
                
 | 
			
		||||
                Text(item.creatorNickname)
 | 
			
		||||
                    .font(.custom(Font.preRegular.rawValue, size: 16))
 | 
			
		||||
                    .foregroundColor(Color(hex: "B0BEC5"))
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        .padding(.horizontal, 14)
 | 
			
		||||
        .padding(.vertical, 10)
 | 
			
		||||
        .frame(width: 282, alignment: .leading)
 | 
			
		||||
        .background(
 | 
			
		||||
            RadialGradient(
 | 
			
		||||
                gradient: Gradient(colors: [Color(hex: "5ACDE1"), Color(hex: "2A339D")]),
 | 
			
		||||
                center: .center,
 | 
			
		||||
                startRadius: 0,
 | 
			
		||||
                endRadius: 200
 | 
			
		||||
            )
 | 
			
		||||
        )
 | 
			
		||||
        .cornerRadius(999)
 | 
			
		||||
        .overlay(
 | 
			
		||||
            RoundedRectangle(cornerRadius: 999)
 | 
			
		||||
                .strokeBorder(
 | 
			
		||||
                    LinearGradient(
 | 
			
		||||
                        colors: [Color(hex: "9AE2F6"), Color(hex: "FFFFFF")],
 | 
			
		||||
                        startPoint: .topLeading,
 | 
			
		||||
                        endPoint: .bottomTrailing
 | 
			
		||||
                    ),
 | 
			
		||||
                    lineWidth: 1
 | 
			
		||||
                )
 | 
			
		||||
        )
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#Preview {
 | 
			
		||||
    HomeLiveItemView(
 | 
			
		||||
        item: GetRoomListResponse(
 | 
			
		||||
            roomId: 1,
 | 
			
		||||
            title: "네네코 마사로",
 | 
			
		||||
            content: "테스트",
 | 
			
		||||
            beginDateTime: "2025-08-10 15:00:00",
 | 
			
		||||
            numberOfParticipate: 1,
 | 
			
		||||
            numberOfPeople: 10,
 | 
			
		||||
            coverImageUrl: "https://cf.sodalive.net/live_room_cover/18038/18038-cover-8c3cb985-733d-4425-8eaf-ef753064d371-2283-1751800412922",
 | 
			
		||||
            isAdult: false,
 | 
			
		||||
            price: 0,
 | 
			
		||||
            tags: [""],
 | 
			
		||||
            channelName: "",
 | 
			
		||||
            creatorProfileImage: "https://cf.sodalive.net/profile/34806/34806-profile-49db6b45-bb1e-4dc7-917e-1a614a853f5f-4232-1752158072656",
 | 
			
		||||
            creatorNickname: "설린",
 | 
			
		||||
            creatorId: 1,
 | 
			
		||||
            isReservation: false,
 | 
			
		||||
            isPrivateRoom: false
 | 
			
		||||
        )
 | 
			
		||||
    )
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user