재생목록 만들기 페이지 추가
This commit is contained in:
		@@ -11,6 +11,8 @@ struct ContentPlaylistListView: View {
 | 
			
		||||
    
 | 
			
		||||
    @ObservedObject var viewModel = ContentPlaylistListViewModel()
 | 
			
		||||
    
 | 
			
		||||
    let onClickCreate: () -> Void
 | 
			
		||||
    
 | 
			
		||||
    var body: some View {
 | 
			
		||||
        BaseView(isLoading: $viewModel.isLoading) {
 | 
			
		||||
            VStack(spacing: 13.3) {
 | 
			
		||||
@@ -21,7 +23,9 @@ struct ContentPlaylistListView: View {
 | 
			
		||||
                    .frame(maxWidth: .infinity)
 | 
			
		||||
                    .background(Color.button)
 | 
			
		||||
                    .cornerRadius(5.3)
 | 
			
		||||
                    .contentShape(Rectangle())
 | 
			
		||||
                    .onTapGesture {
 | 
			
		||||
                        onClickCreate()
 | 
			
		||||
                    }
 | 
			
		||||
                
 | 
			
		||||
                if viewModel.playlists.isEmpty {
 | 
			
		||||
@@ -52,13 +56,31 @@ struct ContentPlaylistListView: View {
 | 
			
		||||
                    }
 | 
			
		||||
                    .frame(maxWidth: .infinity)
 | 
			
		||||
                    
 | 
			
		||||
                    ForEach(0..<viewModel.playlists.count, id: \.self) { index in
 | 
			
		||||
                        let playlist = viewModel.playlists[index]
 | 
			
		||||
                        
 | 
			
		||||
                        ContentPlaylistItemView(item: playlist)
 | 
			
		||||
                    ScrollView(.vertical) {
 | 
			
		||||
                        LazyVStack(spacing: 11) {
 | 
			
		||||
                            ForEach(0..<viewModel.playlists.count, id: \.self) { index in
 | 
			
		||||
                                let playlist = viewModel.playlists[index]
 | 
			
		||||
                                ContentPlaylistItemView(item: playlist)
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            .popup(isPresented: $viewModel.isShowPopup, type: .toast, position: .bottom, autohideIn: 2) {
 | 
			
		||||
                HStack {
 | 
			
		||||
                    Spacer()
 | 
			
		||||
                    Text(viewModel.errorMessage)
 | 
			
		||||
                        .padding(.vertical, 13.3)
 | 
			
		||||
                        .frame(width: screenSize().width - 66.7, alignment: .center)
 | 
			
		||||
                        .font(.custom(Font.medium.rawValue, size: 12))
 | 
			
		||||
                        .background(Color.button)
 | 
			
		||||
                        .foregroundColor(Color.white)
 | 
			
		||||
                        .multilineTextAlignment(.leading)
 | 
			
		||||
                        .cornerRadius(20)
 | 
			
		||||
                        .padding(.bottom, 66.7)
 | 
			
		||||
                    Spacer()
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            .onAppear {
 | 
			
		||||
                viewModel.getPlaylistList()
 | 
			
		||||
            }
 | 
			
		||||
@@ -67,5 +89,5 @@ struct ContentPlaylistListView: View {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#Preview {
 | 
			
		||||
    ContentPlaylistListView()
 | 
			
		||||
    ContentPlaylistListView(onClickCreate: {})
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user