Separate Song component to own file instead of with queue
This commit is contained in:
parent
bf47efbff7
commit
147e3c16c8
@ -4,6 +4,7 @@ pub mod playstatus;
|
||||
pub mod playbar;
|
||||
pub mod database;
|
||||
pub mod queue;
|
||||
pub mod song;
|
||||
use cfg_if::cfg_if;
|
||||
|
||||
cfg_if! {
|
||||
|
14
src/queue.rs
14
src/queue.rs
@ -1,4 +1,5 @@
|
||||
use crate::playstatus::PlayStatus;
|
||||
use crate::song::Song;
|
||||
use leptos::ev::MouseEvent;
|
||||
use leptos::leptos_dom::*;
|
||||
use leptos::*;
|
||||
@ -19,19 +20,6 @@ fn remove_song_fn(index: usize, status: RwSignal<PlayStatus>) {
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
fn Song(song_image_path: String, song_title: String, song_artist: String) -> impl IntoView {
|
||||
view!{
|
||||
<div class="queue-song">
|
||||
<img src={song_image_path} alt={song_title.clone()} />
|
||||
<div class="queue-song-info">
|
||||
<h3>{song_title}</h3>
|
||||
<p>{song_artist}</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn Queue(status: RwSignal<PlayStatus>) -> impl IntoView {
|
||||
|
||||
|
14
src/song.rs
Normal file
14
src/song.rs
Normal file
@ -0,0 +1,14 @@
|
||||
use leptos::*;
|
||||
|
||||
#[component]
|
||||
pub fn Song(song_image_path: String, song_title: String, song_artist: String) -> impl IntoView {
|
||||
view!{
|
||||
<div class="queue-song">
|
||||
<img src={song_image_path} alt={song_title.clone()} />
|
||||
<div class="queue-song-info">
|
||||
<h3>{song_title}</h3>
|
||||
<p>{song_artist}</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user