Use spread syntax for Icon class
This commit is contained in:
@ -50,7 +50,7 @@ pub fn AddAlbum(open: RwSignal<bool>) -> impl IntoView {
|
||||
<div class="upload-header">
|
||||
<h1>Add Album</h1>
|
||||
</div>
|
||||
<div class="close-button" on:click=close_dialog><Icon icon=icondata::IoClose /></div>
|
||||
<div class="close-button" on:click=close_dialog><Icon icon={icondata::IoClose} /></div>
|
||||
<form class="create-album-form" action="POST" on:submit=on_add_album>
|
||||
<div class="input-bx">
|
||||
<input type="text" required class="text-input"
|
||||
|
@ -42,7 +42,7 @@ pub fn AddArtist(open: RwSignal<bool>) -> impl IntoView {
|
||||
<div class="upload-header">
|
||||
<h1>Add Artist</h1>
|
||||
</div>
|
||||
<div class="close-button" on:click=close_dialog><Icon icon=icondata::IoClose /></div>
|
||||
<div class="close-button" on:click=close_dialog><Icon icon={icondata::IoClose} /></div>
|
||||
<form class="create-artist-form" action="POST" on:submit=on_add_artist>
|
||||
<div class="input-bx">
|
||||
<input type="text" name="title" required class="text-input"
|
||||
|
@ -96,10 +96,10 @@ impl IntoView for DashboardRow {
|
||||
<h2>{self.title}</h2>
|
||||
<div class="dashboard-tile-row-scroll-btn">
|
||||
<button on:click=scroll_left tabindex=-1 style=scroll_left_hidden>
|
||||
<Icon class="dashboard-tile-row-scroll" icon=icondata::FiChevronLeft />
|
||||
<Icon icon={icondata::FiChevronLeft} {..} class="dashboard-tile-row-scroll" />
|
||||
</button>
|
||||
<button on:click=scroll_right tabindex=-1 style=scroll_right_hidden>
|
||||
<Icon class="dashboard-tile-row-scroll" icon=icondata::FiChevronRight />
|
||||
<Icon icon={icondata::FiChevronRight} {..} class="dashboard-tile-row-scroll" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -14,7 +14,7 @@ pub fn ServerError<E: Display + 'static>(
|
||||
view!{
|
||||
<div class="error-container">
|
||||
<div class="error-header">
|
||||
<Icon icon=icondata::BiErrorSolid />
|
||||
<Icon icon={icondata::BiErrorSolid} />
|
||||
<h1>{title}</h1>
|
||||
</div>
|
||||
<p>{message}</p>
|
||||
@ -35,7 +35,7 @@ pub fn Error<E: Display + 'static>(
|
||||
view! {
|
||||
<div class="error-container">
|
||||
<div class="error-header">
|
||||
<Icon icon=icondata::BiErrorSolid />
|
||||
<Icon icon={icondata::BiErrorSolid} />
|
||||
<h1>{title}</h1>
|
||||
</div>
|
||||
<p>{message}</p>
|
||||
|
@ -52,13 +52,13 @@ pub fn Profile() -> impl IntoView {
|
||||
</Suspense>
|
||||
</div>
|
||||
<div class="profile-icon" on:click=open_dropdown>
|
||||
<Suspense fallback=|| view! { <Icon icon=icondata::CgProfile width="45" height="45"/> }>
|
||||
<Suspense fallback=|| view! { <Icon icon={icondata::CgProfile} width="45" height="45"/> }>
|
||||
<Show
|
||||
when=move || user.get().map(|user| user.is_some()).unwrap_or(false)
|
||||
fallback=|| view! { <Icon icon=icondata::CgProfile width="45" height="45"/> }
|
||||
fallback=|| view! { <Icon icon={icondata::CgProfile} width="45" height="45"/> }
|
||||
>
|
||||
<object class="profile-image" data={user_profile_picture} type="image/webp">
|
||||
<Icon class="profile-image" icon=icondata::CgProfile width="45" height="45"/>
|
||||
<Icon icon={icondata::CgProfile} width="45" height="45" {..} class="profile-image" />
|
||||
</object>
|
||||
</Show>
|
||||
</Suspense>
|
||||
|
@ -42,11 +42,11 @@ pub fn Sidebar(upload_open: RwSignal<bool>, add_artist_open: RwSignal<bool>, add
|
||||
</Show>
|
||||
</div>
|
||||
<a class="buttons" href="/dashboard" style={move || if on_dashboard() {"color: #e1e3e1"} else {""}} >
|
||||
<Icon icon=icondata::OcHomeFillLg />
|
||||
<Icon icon={icondata::OcHomeFillLg} />
|
||||
<h1>Dashboard</h1>
|
||||
</a>
|
||||
<a class="buttons" href="/search" style={move || if on_search() {"color: #e1e3e1"} else {""}}>
|
||||
<Icon icon=icondata::BiSearchRegular />
|
||||
<Icon icon={icondata::BiSearchRegular} />
|
||||
<h1>Search</h1>
|
||||
</a>
|
||||
</div>
|
||||
@ -64,7 +64,7 @@ pub fn Bottom() -> impl IntoView {
|
||||
<h1 class="header">Playlists</h1>
|
||||
<button class="add-playlist">
|
||||
<div class="add-sign">
|
||||
<Icon icon=icondata::IoAddSharp />
|
||||
<Icon icon={icondata::IoAddSharp} />
|
||||
</div>
|
||||
New Playlist
|
||||
</button>
|
||||
|
@ -127,11 +127,11 @@ pub fn SongImage(image_path: String, song_playing: MaybeSignal<bool>, list_index
|
||||
view! {
|
||||
<img class="song-image" src={image_path}/>
|
||||
{move || if song_playing.get() {
|
||||
view! { <Icon class="song-image-overlay song-playing-overlay"
|
||||
icon=icondata::BsPauseFill on:click=pause_song /> }.into_view()
|
||||
view! { <Icon icon={icondata::BsPauseFill} on:click={pause_song}
|
||||
{..} class="song-image-overlay song-playing-overlay" /> }.into_view()
|
||||
} else {
|
||||
view! { <Icon class="song-image-overlay hide-until-hover"
|
||||
icon=icondata::BsPlayFill on:click=play_song /> }.into_view()
|
||||
view! { <Icon icon={icondata::BsPlayFill} on:click={play_song}
|
||||
{..} class="song-image-overlay hide-until-hover" /> }.into_view()
|
||||
}}
|
||||
}
|
||||
}
|
||||
@ -261,10 +261,10 @@ pub fn SongLikeDislike(
|
||||
|
||||
view! {
|
||||
<button on:click=toggle_dislike>
|
||||
<Icon class=dislike_class width=LIKE_DISLIKE_BTN_SIZE height=LIKE_DISLIKE_BTN_SIZE icon=dislike_icon />
|
||||
<Icon width=LIKE_DISLIKE_BTN_SIZE height=LIKE_DISLIKE_BTN_SIZE icon={dislike_icon} {..} class=dislike_class />
|
||||
</button>
|
||||
<button on:click=toggle_like>
|
||||
<Icon class=like_class width=LIKE_DISLIKE_BTN_SIZE height=LIKE_DISLIKE_BTN_SIZE icon=like_icon />
|
||||
<Icon width=LIKE_DISLIKE_BTN_SIZE height=LIKE_DISLIKE_BTN_SIZE icon={like_icon} {..} class=like_class />
|
||||
</button>
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ pub fn Upload(open: RwSignal<bool>) -> impl IntoView {
|
||||
view! {
|
||||
<Show when=open fallback=move || view! {}>
|
||||
<div class="upload-container" open=open>
|
||||
<div class="close-button" on:click=close_dialog><Icon icon=icondata::IoClose /></div>
|
||||
<div class="close-button" on:click=close_dialog><Icon icon={icondata::IoClose} /></div>
|
||||
<div class="upload-header">
|
||||
<h1>Upload Song</h1>
|
||||
</div>
|
||||
@ -169,7 +169,7 @@ pub fn Upload(open: RwSignal<bool>) -> impl IntoView {
|
||||
fallback=move || view! {}
|
||||
>
|
||||
<div class="error-msg">
|
||||
<Icon icon=icondata::IoAlertCircleSharp />
|
||||
<Icon icon={icondata::IoAlertCircleSharp} />
|
||||
{error_msg.get().as_ref().unwrap()}
|
||||
</div>
|
||||
</Show>
|
||||
|
@ -12,7 +12,7 @@ pub fn UploadDropdownBtn(dropdown_open: RwSignal<bool>) -> impl IntoView {
|
||||
view! {
|
||||
<button class={move || if dropdown_open() {"upload-dropdown-btn upload-dropdown-btn-active"} else {"upload-dropdown-btn"}} on:click=open_dropdown>
|
||||
<div class="add-sign">
|
||||
<Icon icon=icondata::IoAddSharp />
|
||||
<Icon icon={icondata::IoAddSharp} />
|
||||
</div>
|
||||
</button>
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ fn ArtistProfile(artist: Artist) -> impl IntoView {
|
||||
view! {
|
||||
<div class="artist-header">
|
||||
<object class="artist-image" data={profile_image_path.clone()} type="image/webp">
|
||||
<Icon class="artist-image" icon=icondata::CgProfile width="100" height="100"/>
|
||||
<Icon icon={icondata::CgProfile} width="100" height="100" {..} class="artist-image" />
|
||||
</object>
|
||||
<h1>{artist.name}</h1>
|
||||
</div>
|
||||
|
@ -69,7 +69,7 @@ pub fn Login() -> impl IntoView {
|
||||
view! {
|
||||
<div class="auth-page-container">
|
||||
<div class="login-container">
|
||||
<a class="return" href="/"><Icon icon=icondata::IoReturnUpBackSharp /></a>
|
||||
<a class="return" href="/"><Icon icon={icondata::IoReturnUpBackSharp} /></a>
|
||||
<div class="header">
|
||||
<h1>LibreTunes</h1>
|
||||
</div>
|
||||
@ -97,11 +97,11 @@ pub fn Login() -> impl IntoView {
|
||||
<Show
|
||||
when=move || {show_password() == false}
|
||||
fallback=move || view!{ <button on:click=toggle_password class="login-password-visibility">
|
||||
<Icon icon=icondata::AiEyeInvisibleFilled />
|
||||
<Icon icon={icondata::AiEyeInvisibleFilled} />
|
||||
</button> /> }
|
||||
>
|
||||
<button on:click=toggle_password class="login-password-visibility">
|
||||
<Icon icon=icondata::AiEyeFilled />
|
||||
<Icon icon={icondata::AiEyeFilled} />
|
||||
</button>
|
||||
|
||||
</Show>
|
||||
|
@ -150,7 +150,7 @@ fn UserProfile(user: User) -> impl IntoView {
|
||||
view! {
|
||||
<div class="profile-header">
|
||||
<object class="profile-image" data={profile_image_path.clone()} type="image/webp">
|
||||
<Icon class="profile-image" icon=icondata::CgProfile width="75" height="75"/>
|
||||
<Icon icon={icondata::CgProfile} width="75" height="75" {..} class="profile-image" />
|
||||
</object>
|
||||
<h1>{user.username}</h1>
|
||||
</div>
|
||||
|
@ -65,7 +65,7 @@ pub fn Signup() -> impl IntoView {
|
||||
view! {
|
||||
<div class="auth-page-container">
|
||||
<div class="signup-container">
|
||||
<a class="return" href="/"><Icon icon=icondata::IoReturnUpBackSharp /></a>
|
||||
<a class="return" href="/"><Icon icon={icondata::IoReturnUpBackSharp} /></a>
|
||||
<div class="header">
|
||||
<h1>LibreTunes</h1>
|
||||
</div>
|
||||
@ -102,10 +102,10 @@ pub fn Signup() -> impl IntoView {
|
||||
<i></i>
|
||||
<Show
|
||||
when=move || {show_password() == false}
|
||||
fallback=move || view!{ <button on:click=toggle_password class="password-visibility"> <Icon icon=icondata::AiEyeInvisibleFilled /></button> /> }
|
||||
fallback=move || view!{ <button on:click=toggle_password class="password-visibility"> <Icon icon={icondata::AiEyeInvisibleFilled} /></button> /> }
|
||||
>
|
||||
<button on:click=toggle_password class="password-visibility">
|
||||
<Icon icon=icondata::AiEyeFilled />
|
||||
<Icon icon={icondata::AiEyeFilled} />
|
||||
</button>
|
||||
</Show>
|
||||
</div>
|
||||
|
@ -133,7 +133,7 @@ fn SongOverview(song: SongData) -> impl IntoView {
|
||||
</div>
|
||||
<div class="song-actions">
|
||||
<button on:click=toggle_play_song>
|
||||
<Icon class="controlbtn" width=PLAY_BTN_SIZE height=PLAY_BTN_SIZE icon />
|
||||
<Icon width=PLAY_BTN_SIZE height=PLAY_BTN_SIZE icon {..} class="controlbtn" />
|
||||
</button>
|
||||
<SongLikeDislike song_id=song.id liked disliked /><br/>
|
||||
</div>
|
||||
|
@ -212,15 +212,15 @@ fn PlayControls() -> impl IntoView {
|
||||
<div class="playcontrols" align="center">
|
||||
|
||||
<button on:click=skip_back on:mousedown=prevent_focus>
|
||||
<Icon class="controlbtn" width=SKIP_BTN_SIZE height=SKIP_BTN_SIZE icon=icondata::BsSkipStartFill />
|
||||
<Icon width=SKIP_BTN_SIZE height=SKIP_BTN_SIZE icon={icondata::BsSkipStartFill} {..} class="controlbtn" />
|
||||
</button>
|
||||
|
||||
<button on:click=toggle_play on:mousedown=prevent_focus>
|
||||
<Icon class="controlbtn" width=PLAY_BTN_SIZE height=PLAY_BTN_SIZE icon={icon} />
|
||||
<Icon width=PLAY_BTN_SIZE height=PLAY_BTN_SIZE icon={icon} {..} class="controlbtn" />
|
||||
</button>
|
||||
|
||||
<button on:click=skip_forward on:mousedown=prevent_focus>
|
||||
<Icon class="controlbtn" width=SKIP_BTN_SIZE height=SKIP_BTN_SIZE icon=icondata::BsSkipEndFill />
|
||||
<Icon width=SKIP_BTN_SIZE height=SKIP_BTN_SIZE icon={icondata::BsSkipEndFill} {..} class="controlbtn" />
|
||||
</button>
|
||||
|
||||
</div>
|
||||
@ -395,10 +395,10 @@ fn LikeDislike() -> impl IntoView {
|
||||
view! {
|
||||
<div class="like-dislike">
|
||||
<button on:click=toggle_dislike>
|
||||
<Icon class="controlbtn hmirror" width=SKIP_BTN_SIZE height=SKIP_BTN_SIZE icon=dislike_icon />
|
||||
<Icon width=SKIP_BTN_SIZE height=SKIP_BTN_SIZE icon={dislike_icon} {..} class="controlbtn hmirror" />
|
||||
</button>
|
||||
<button on:click=toggle_like>
|
||||
<Icon class="controlbtn" width=SKIP_BTN_SIZE height=SKIP_BTN_SIZE icon=like_icon />
|
||||
<Icon width=SKIP_BTN_SIZE height=SKIP_BTN_SIZE icon={like_icon} {..} class="controlbtn" />
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
@ -461,7 +461,7 @@ fn QueueToggle() -> impl IntoView {
|
||||
view! {
|
||||
<div class="queue-toggle">
|
||||
<button on:click=update_queue on:mousedown=prevent_focus>
|
||||
<Icon class="controlbtn" width=QUEUE_BTN_SIZE height=QUEUE_BTN_SIZE icon=icondata::RiPlayListMediaFill />
|
||||
<Icon width=QUEUE_BTN_SIZE height=QUEUE_BTN_SIZE icon={icondata::RiPlayListMediaFill} {..} class="controlbtn" />
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ pub fn Queue() -> impl IntoView {
|
||||
<p>Playing</p>
|
||||
}>
|
||||
<button on:click=move |_| remove_song(index) on:mousedown=prevent_focus>
|
||||
<Icon class="remove-song" width=RM_BTN_SIZE height=RM_BTN_SIZE icon=icondata::CgTrash />
|
||||
<Icon width=RM_BTN_SIZE height=RM_BTN_SIZE icon={icondata::CgTrash} {..} class="remove-song" />
|
||||
</button>
|
||||
</Show>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user