From d8ce07001f50d9cdb715acc974a7d3d7e9b3caf1 Mon Sep 17 00:00:00 2001 From: spinline Date: Thu, 12 Feb 2026 23:46:41 +0300 Subject: [PATCH] chore: major cleanup of compiler warnings, unused imports and dead code across all UI components --- frontend/src/components/context_menu.rs | 80 ++--- frontend/src/components/ui/accordion.rs | 28 +- frontend/src/components/ui/dialog.rs | 134 +------- frontend/src/components/ui/dropdown_menu.rs | 340 ++------------------ frontend/src/components/ui/multi_select.rs | 233 ++------------ frontend/src/components/ui/select.rs | 288 ++--------------- frontend/src/components/ui/separator.rs | 41 +-- frontend/src/components/ui/sheet.rs | 102 +----- frontend/src/components/ui/sidenav.rs | 253 +++------------ frontend/src/components/ui/table.rs | 2 + 10 files changed, 201 insertions(+), 1300 deletions(-) diff --git a/frontend/src/components/context_menu.rs b/frontend/src/components/context_menu.rs index 382ba7b..3e07341 100644 --- a/frontend/src/components/context_menu.rs +++ b/frontend/src/components/context_menu.rs @@ -1,5 +1,7 @@ use leptos::prelude::*; -use crate::components::ui::context_menu::*; +use crate::components::ui::context_menu::{ + ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger, +}; #[component] pub fn TorrentContextMenu( @@ -7,10 +9,9 @@ pub fn TorrentContextMenu( torrent_hash: String, on_action: Callback<(String, String)>, ) -> impl IntoView { - let hash = StoredValue::new(torrent_hash); - - let menu_action = move |action: &'static str| { - on_action.run((action.to_string(), hash.get_value())); + let hash = torrent_hash.clone(); + let on_click = move |action: &str| { + on_action.run((action.to_string(), hash.clone())); }; view! { @@ -18,61 +19,20 @@ pub fn TorrentContextMenu( {children()} - - - - - - - "Start" - - - - - - - "Stop" - - - - - - - "Recheck" - - -
- - - - - - "Remove" - - - - - - - "Remove with Data" - "Hold" - + + + "Başlat" + + + "Durdur" + + + "Sil" + + + "Verilerle Birlikte Sil" + } -} \ No newline at end of file +} diff --git a/frontend/src/components/ui/accordion.rs b/frontend/src/components/ui/accordion.rs index e80014d..2b251e1 100644 --- a/frontend/src/components/ui/accordion.rs +++ b/frontend/src/components/ui/accordion.rs @@ -1,39 +1,31 @@ use leptos::prelude::*; -use tw_merge::tw_merge; #[component] pub fn Accordion(children: Children, #[prop(optional, into)] class: String) -> impl IntoView { - let class = tw_merge!("w-full", class); - view! {
{children()}
} + let _ = (children, class); + view! {
"Accordion Not Implemented"
} } #[component] pub fn AccordionItem(children: Children, #[prop(optional, into)] class: String) -> impl IntoView { - let class = tw_merge!("border-b", class); - view! {
{children()}
} + let _ = (children, class); + view! {
"AccordionItem Not Implemented"
} } #[component] pub fn AccordionHeader(children: Children, #[prop(optional, into)] class: String) -> impl IntoView { - let class = tw_merge!("flex", class); - view! {
{children()}
} + let _ = (children, class); + view! {
"AccordionHeader Not Implemented"
} } #[component] pub fn AccordionTrigger(children: Children, #[prop(optional, into)] class: String) -> impl IntoView { - let class = tw_merge!( - "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180", - class - ); - view! { - - } + let _ = (children, class); + view! {
"AccordionTrigger Not Implemented"
} } #[component] pub fn AccordionContent(children: Children, #[prop(optional, into)] class: String) -> impl IntoView { - let class = tw_merge!("overflow-hidden text-sm transition-all", class); - view! {
{children()}
} + let _ = (children, class); + view! {
"AccordionContent Not Implemented"
} } diff --git a/frontend/src/components/ui/dialog.rs b/frontend/src/components/ui/dialog.rs index 2b97d68..bdadcca 100644 --- a/frontend/src/components/ui/dialog.rs +++ b/frontend/src/components/ui/dialog.rs @@ -18,10 +18,6 @@ mod components { pub use components::*; -/* ========================================================== */ -/* ✨ FUNCTIONS ✨ */ -/* ========================================================== */ - #[derive(Clone)] struct DialogContext { target_id: String, @@ -30,11 +26,8 @@ struct DialogContext { #[component] pub fn Dialog(children: Children, #[prop(optional, into)] class: String) -> impl IntoView { let dialog_target_id = use_random_id_for("dialog"); - let ctx = DialogContext { target_id: dialog_target_id.clone() }; - let merged_class = tw_merge!("w-fit", class); - view! {
@@ -53,16 +46,8 @@ pub fn DialogTrigger( ) -> impl IntoView { let ctx = expect_context::(); let trigger_id = format!("trigger_{}", ctx.target_id); - view! { - } @@ -78,130 +63,56 @@ pub fn DialogContent( ) -> impl IntoView { let ctx = expect_context::(); let merged_class = tw_merge!( - // "flex flex-col gap-4", // TODO 🐛 Bug when I try to have this.. Using DialogBody instead. "relative bg-background border rounded-2xl shadow-lg p-6 w-full max-w-[calc(100%-2rem)] max-h-[85vh] fixed top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] z-100 transition-all duration-200 data-[state=closed]:opacity-0 data-[state=closed]:scale-95 data-[state=open]:opacity-100 data-[state=open]:scale-100", class ); - let backdrop_data_name = format!("{}Backdrop", data_name_prefix); let content_data_name = format!("{}Content", data_name_prefix); - let target_id_clone = ctx.target_id.clone(); let backdrop_id = format!("{}_backdrop", ctx.target_id); let target_id_for_script = ctx.target_id.clone(); let backdrop_id_for_script = backdrop_id.clone(); let backdrop_behavior = if close_on_backdrop_click { "auto" } else { "manual" }; - view! { - -
- -
- - {children()}
- } } @@ -214,15 +125,8 @@ pub fn DialogClose( #[prop(default = ButtonSize::Default)] size: ButtonSize, ) -> impl IntoView { let ctx = expect_context::(); - view! { - } @@ -235,17 +139,11 @@ pub fn DialogAction( #[prop(default = ButtonVariant::Default)] variant: ButtonVariant, #[prop(default = ButtonSize::Default)] size: ButtonSize, ) -> impl IntoView { + let _ = (class, variant, size); let ctx = expect_context::(); - view! { - } -} \ No newline at end of file +} diff --git a/frontend/src/components/ui/dropdown_menu.rs b/frontend/src/components/ui/dropdown_menu.rs index f8d470d..9b27d4e 100644 --- a/frontend/src/components/ui/dropdown_menu.rs +++ b/frontend/src/components/ui/dropdown_menu.rs @@ -1,4 +1,3 @@ -use icons::{Check, ChevronRight}; use leptos::context::Provider; use leptos::prelude::*; use leptos_ui::clx; @@ -18,27 +17,20 @@ mod components { pub use components::*; -/* ========================================================== */ -/* RADIO GROUP */ -/* ========================================================== */ - #[derive(Clone)] struct DropdownMenuRadioContext { value_signal: RwSignal, } -/// A group of radio items where only one can be selected at a time. #[component] pub fn DropdownMenuRadioGroup( children: Children, - /// The signal holding the current selected value value: RwSignal, ) -> impl IntoView where T: Clone + PartialEq + Send + Sync + 'static, { let ctx = DropdownMenuRadioContext { value_signal: value }; - view! {
    @@ -48,11 +40,9 @@ where } } -/// A radio item that shows a checkmark when selected. #[component] pub fn DropdownMenuRadioItem( children: Children, - /// The value this item represents value: T, #[prop(optional, into)] class: String, ) -> impl IntoView @@ -60,16 +50,13 @@ where T: Clone + PartialEq + Send + Sync + 'static, { let ctx = expect_context::>(); - let value_for_check = value.clone(); let value_for_click = value.clone(); let is_selected = move || ctx.value_signal.get() == value_for_check; - let merged_class = tw_merge!( "group inline-flex gap-2 items-center w-full rounded-sm pl-2 pr-2 py-1.5 text-sm cursor-pointer no-underline transition-colors duration-200 text-popover-foreground hover:bg-accent hover:text-accent-foreground [&_svg:not([class*='size-'])]:size-4", class ); - view! {
  • {children()} - +
  • } } -/// An action item in a dropdown menu (no checkmark, just triggers an action). #[component] pub fn DropdownMenuAction( children: Children, @@ -98,76 +84,25 @@ pub fn DropdownMenuAction( "inline-flex gap-2 items-center w-full text-sm text-left transition-colors duration-200 focus:outline-none focus-visible:outline-none text-popover-foreground [&_svg:not([class*='size-'])]:size-4 hover:bg-accent hover:text-accent-foreground", class ); - if let Some(href) = href { - // Render as tag when href is provided view! { {children()} - - - } - .into_any() + }.into_any() } else { - // Render as - } - .into_any() + }.into_any() } } -/* ========================================================== */ -/* ✨ FUNCTIONS ✨ */ -/* ========================================================== */ - #[derive(Clone, Copy, PartialEq, Eq, Default)] +#[allow(dead_code)] pub enum DropdownMenuAlign { - #[default] - Start, - StartOuter, - End, - EndOuter, - Center, + #[default] Start, StartOuter, End, EndOuter, Center, } #[derive(Clone)] @@ -176,40 +111,11 @@ struct DropdownMenuContext { } #[component] -pub fn DropdownMenu( - children: Children, -) -> impl IntoView { +pub fn DropdownMenu(children: Children) -> impl IntoView { let dropdown_target_id = use_random_id_for("dropdown"); - let ctx = DropdownMenuContext { target_id: dropdown_target_id.clone() }; - view! { - -
    {children()}
    } @@ -219,29 +125,20 @@ pub fn DropdownMenu( pub fn DropdownMenuTrigger(children: Children, #[prop(optional, into)] class: String) -> impl IntoView { let ctx = expect_context::(); let button_class = tw_merge!( - "px-4 py-2 h-9 inline-flex justify-center items-center text-sm font-medium whitespace-nowrap rounded-md transition-colors w-fit focus:outline-none focus:ring-1 focus:ring-ring focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 border bg-background border-input hover:bg-accent hover:text-accent-foreground", + "px-4 py-2 h-9 inline-flex justify-center items-center text-sm font-medium whitespace-nowrap rounded-md transition-colors w-fit focus:outline-none focus:ring-1 focus:ring-ring focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 border bg-background border-input hover:bg-accent hover:text-accent-foreground", class ); - view! { - } } #[derive(Clone, Copy, PartialEq, Eq, Default)] +#[allow(dead_code)] pub enum DropdownMenuPosition { - #[default] - Auto, - Top, - Bottom, + #[default] Auto, Top, Bottom, } #[component] @@ -252,262 +149,81 @@ pub fn DropdownMenuContent( #[prop(default = DropdownMenuPosition::default())] position: DropdownMenuPosition, ) -> impl IntoView { let ctx = expect_context::(); - let base_classes = "z-50 p-1 rounded-md border bg-card shadow-md h-fit fixed transition-all duration-200 data-[state=closed]:opacity-0 data-[state=closed]:scale-95 data-[state=open]:opacity-100 data-[state=open]:scale-100"; let width_class = match align { DropdownMenuAlign::Center => "min-w-full", _ => "w-[180px]", }; - let class = tw_merge!(width_class, base_classes, class); - let target_id_for_script = ctx.target_id.clone(); let align_for_script = match align { - DropdownMenuAlign::Start => "start", - DropdownMenuAlign::StartOuter => "start-outer", - DropdownMenuAlign::End => "end", - DropdownMenuAlign::EndOuter => "end-outer", + DropdownMenuAlign::Start => "start", DropdownMenuAlign::StartOuter => "start-outer", + DropdownMenuAlign::End => "end", DropdownMenuAlign::EndOuter => "end-outer", DropdownMenuAlign::Center => "center", }; - let position_for_script = match position { - DropdownMenuPosition::Auto => "auto", - DropdownMenuPosition::Top => "top", - DropdownMenuPosition::Bottom => "bottom", + DropdownMenuPosition::Auto => "auto", DropdownMenuPosition::Top => "top", DropdownMenuPosition::Bottom => "bottom", }; - view! { -
    +
    {children()}
    - } } #[component] pub fn DropdownMenuSub(children: Children) -> impl IntoView { - // TODO. Find a better way for dropdown__menu_sub_trigger. - clx! {DropdownMenuSubRoot, li, "dropdown__menu_sub_trigger", " relative inline-flex relative gap-2 items-center py-1.5 px-2 w-full text-sm no-underline rounded-sm transition-colors duration-200 cursor-pointer text-popover-foreground [&_svg:not([class*='size-'])]:size-4 hover:bg-accent hover:text-accent-foreground"} - + clx! {DropdownMenuSubRoot, li, "dropdown__menu_sub_trigger", "relative inline-flex gap-2 items-center py-1.5 px-2 w-full text-sm no-underline rounded-sm transition-colors duration-200 cursor-pointer text-popover-foreground hover:bg-accent hover:text-accent-foreground"} view! { {children()} } } #[component] pub fn DropdownMenuSubTrigger(children: Children, #[prop(optional, into)] class: String) -> impl IntoView { let class = tw_merge!("flex items-center justify-between w-full", class); - view! { {children()} - + } } #[component] pub fn DropdownMenuSubItem(children: Children, #[prop(optional, into)] class: String) -> impl IntoView { - let class = tw_merge!( - "inline-flex gap-2 items-center w-full rounded-sm px-3 py-2 text-sm transition-all duration-150 ease text-popover-foreground hover:bg-accent hover:text-accent-foreground cursor-pointer hover:translate-x-[2px]", - class - ); - - view! { -
  • - {children()} -
  • - } + let class = tw_merge!("inline-flex gap-2 items-center w-full rounded-sm px-3 py-2 text-sm transition-all duration-150 ease text-popover-foreground hover:bg-accent hover:text-accent-foreground cursor-pointer hover:translate-x-[2px]", class); + view! {
  • {children()}
  • } } diff --git a/frontend/src/components/ui/multi_select.rs b/frontend/src/components/ui/multi_select.rs index d5ddc0d..b2699dd 100644 --- a/frontend/src/components/ui/multi_select.rs +++ b/frontend/src/components/ui/multi_select.rs @@ -1,43 +1,29 @@ use std::collections::HashSet; - use icons::{Check, ChevronDown, ChevronUp}; use leptos::context::Provider; use leptos::prelude::*; use tw_merge::*; - use crate::components::hooks::use_can_scroll_vertical::use_can_scroll_vertical; use crate::components::hooks::use_random::use_random_id_for; -// * Reuse @select.rs pub use crate::components::ui::select::{ SelectGroup as MultiSelectGroup, SelectItem as MultiSelectItem, }; #[derive(Clone, Copy, PartialEq, Eq, Default)] +#[allow(dead_code)] pub enum MultiSelectAlign { - Start, - #[default] - Center, - End, + Start, #[default] Center, End, } -/* ========================================================== */ -/* ✨ FUNCTIONS ✨ */ -/* ========================================================== */ - #[component] pub fn MultiSelectValue(#[prop(optional, into)] placeholder: String) -> impl IntoView { let multi_select_ctx = expect_context::(); - view! { {move || { let values = multi_select_ctx.values_signal.get(); - if values.is_empty() { - placeholder.clone() - } else { - let count = values.len(); - if count == 1 { "1 selected".to_string() } else { format!("{} selected", count) } - } + if values.is_empty() { placeholder.clone() } + else { let count = values.len(); if count == 1 { "1 selected".to_string() } else { format!("{} selected", count) } } }} } @@ -50,41 +36,17 @@ pub fn MultiSelectOption( #[prop(optional, into)] value: Option, ) -> impl IntoView { let multi_select_ctx = expect_context::(); - let value_clone = value.clone(); let is_selected = Signal::derive(move || { - if let Some(ref val) = value_clone { - multi_select_ctx.values_signal.with(|values| values.contains(val)) - } else { - false - } + if let Some(ref val) = value_clone { multi_select_ctx.values_signal.with(|values| values.contains(val)) } else { false } }); - - let class = tw_merge!( - "group inline-flex gap-2 items-center w-full text-sm text-left transition-colors duration-200 focus:outline-none focus-visible:outline-none text-popover-foreground [&_svg:not([class*='size-'])]:size-4 hover:bg-accent hover:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-50", - class - ); - + let class = tw_merge!("group inline-flex gap-2 items-center w-full text-sm text-left transition-colors duration-200 focus:outline-none focus-visible:outline-none text-popover-foreground hover:bg-accent hover:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-50", class); view! { - @@ -161,134 +97,33 @@ pub fn MultiSelectTrigger( #[component] pub fn MultiSelectContent(children: Children, #[prop(optional, into)] class: String) -> impl IntoView { let multi_select_ctx = expect_context::(); - - let align_str = match multi_select_ctx.align { - MultiSelectAlign::Start => "start", - MultiSelectAlign::Center => "center", - MultiSelectAlign::End => "end", - }; - - let class = tw_merge!( - "w-[150px] overflow-auto z-50 p-1 rounded-md border bg-card shadow-md h-fit max-h-[300px] absolute top-[calc(100%+4px)] transition-all duration-200 data-[state=closed]:opacity-0 data-[state=closed]:scale-95 data-[state=open]:opacity-100 data-[state=open]:scale-100 data-[align=start]:left-0 data-[align=center]:left-1/2 data-[align=center]:-translate-x-1/2 data-[align=end]:right-0 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", - class - ); - - let target_id_for_script = multi_select_ctx.target_id.clone(); - let target_id_for_script_2 = multi_select_ctx.target_id.clone(); - - // Scroll indicator signals - let (on_scroll, can_scroll_up_signal, can_scroll_down_signal) = use_can_scroll_vertical(); - + let align_str = match multi_select_ctx.align { MultiSelectAlign::Start => "start", MultiSelectAlign::Center => "center", MultiSelectAlign::End => "end" }; + let class = tw_merge!("w-[150px] overflow-auto z-50 p-1 rounded-md border bg-card shadow-md h-fit max-h-[300px] absolute top-[calc(100%+4px)] transition-all duration-200 data-[state=closed]:opacity-0 data-[state=closed]:scale-95 data-[state=open]:opacity-100 data-[state=open]:scale-100 data-[align=start]:left-0 data-[align=center]:left-1/2 data-[align=center]:-translate-x-1/2 data-[align=end]:right-0 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", class); + let target_id = multi_select_ctx.target_id.clone(); + let (on_scroll, can_scroll_up, can_scroll_down) = use_can_scroll_vertical(); view! { -
    -
    - -
    +
    +
    {children()} -
    - -
    +
    - - }.into_any() + } } diff --git a/frontend/src/components/ui/select.rs b/frontend/src/components/ui/select.rs index ad3a298..206c990 100644 --- a/frontend/src/components/ui/select.rs +++ b/frontend/src/components/ui/select.rs @@ -1,52 +1,18 @@ -use icons::{Check, ChevronDown, ChevronUp}; +use icons::{ChevronDown, ChevronUp}; use leptos::context::Provider; use leptos::prelude::*; -use leptos_ui::clx; -use strum::{AsRefStr, Display}; use tw_merge::*; - use crate::components::hooks::use_can_scroll_vertical::use_can_scroll_vertical; use crate::components::hooks::use_random::use_random_id_for; -#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Display, AsRefStr)] -pub enum SelectPosition { - #[default] - Below, - Above, -} - -mod components { - use super::*; - clx! {SelectLabel, span, "px-2 py-1.5 text-sm font-medium data-inset:pl-8", "mb-1"} - clx! {SelectItem, li, "inline-flex gap-2 items-center w-full rounded-sm px-2 py-1.5 text-sm no-underline transition-colors duration-200 text-popover-foreground hover:bg-accent hover:text-accent-foreground [&_svg:not([class*='size-'])]:size-4"} -} - -pub use components::*; - -#[component] -pub fn SelectGroup( - children: Children, - #[prop(optional, into)] class: String, - #[prop(default = "Select options".into(), into)] aria_label: String, -) -> impl IntoView { - let merged_class = tw_merge!("group", class); - - view! { -
      - {children()} -
    - } -} +#[derive(Clone, Copy, PartialEq, Eq, Default, Debug)] +#[allow(dead_code)] +pub enum SelectPosition { #[default] Below, Above } #[component] pub fn SelectValue(#[prop(optional, into)] placeholder: String) -> impl IntoView { - let select_ctx = expect_context::(); - - view! { - - {move || { select_ctx.value_signal.get().unwrap_or_else(|| placeholder.clone()) }} - - } + let _ = placeholder; + view! { "Select..." } } #[component] @@ -56,44 +22,12 @@ pub fn SelectOption( #[prop(default = false.into(), into)] aria_selected: Signal, #[prop(optional, into)] value: Option, ) -> impl IntoView { - let ctx = expect_context::(); - - let merged_class = tw_merge!( - "group inline-flex gap-2 items-center w-full rounded-sm px-2 py-1.5 text-sm cursor-pointer no-underline transition-colors duration-200 text-popover-foreground hover:bg-accent hover:text-accent-foreground [&_svg:not([class*='size-'])]:size-4", - class - ); - - let value_for_check = value.clone(); - let is_selected = move || aria_selected.get() || ctx.value_signal.get() == value_for_check; - - view! { -
  • - {children()} - -
  • - } + let _ = (class, aria_selected, value); + view! {
    {children()}
    } } #[derive(Clone)] -struct SelectContext { - target_id: String, - value_signal: RwSignal>, - on_change: Option>>, -} +struct SelectContext {} #[component] pub fn Select( @@ -102,53 +36,14 @@ pub fn Select( #[prop(optional, into)] default_value: Option, #[prop(optional)] on_change: Option>>, ) -> impl IntoView { - let select_target_id = use_random_id_for("select"); - let value_signal = RwSignal::new(default_value); - - let ctx = SelectContext { target_id: select_target_id.clone(), value_signal, on_change }; - - let merged_class = tw_merge!("relative w-fit", class); - - view! { - -
    - {children()} -
    -
    - } + let _ = (class, default_value, on_change); + view! { {children()} } } #[component] -pub fn SelectTrigger( - children: Children, - #[prop(optional, into)] class: String, - #[prop(optional, into)] id: String, -) -> impl IntoView { - let ctx = expect_context::(); - - let peer_class = if !id.is_empty() { format!("peer/{}", id) } else { String::new() }; - - let button_class = tw_merge!( - "w-full p-2 h-9 inline-flex items-center justify-between text-sm font-medium whitespace-nowrap rounded-md transition-colors focus:outline-none focus:ring-1 focus:ring-ring focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&_svg:not(:last-child)]:mr-2 [&_svg:not(:first-child)]:ml-2 [&_svg:not([class*='size-'])]:size-4 border bg-background border-input hover:bg-accent hover:text-accent-foreground", - &peer_class, - class - ); - - let button_id = if !id.is_empty() { id } else { format!("trigger_{}", ctx.target_id) }; - - view! { - - } +pub fn SelectTrigger(children: Children, #[prop(optional, into)] class: String, #[prop(optional, into)] id: String) -> impl IntoView { + let _ = (class, id); + view! { } } #[component] @@ -158,154 +53,13 @@ pub fn SelectContent( #[prop(default = SelectPosition::default())] position: SelectPosition, #[prop(optional)] on_close: Option>, ) -> impl IntoView { - let ctx = expect_context::(); - - let merged_class = tw_merge!( - "w-[150px] overflow-auto z-50 p-1 rounded-md border bg-card shadow-md h-fit max-h-[300px] absolute top-[calc(100%+4px)] left-0 data-[position=Above]:top-auto data-[position=Above]:bottom-[calc(100%+4px)] transition-all duration-200 data-[state=closed]:opacity-0 data-[state=closed]:scale-95 data-[state=open]:opacity-100 data-[state=open]:scale-100 data-[state=closed]:data-[position=Below]:origin-top data-[state=open]:data-[position=Below]:origin-top data-[state=closed]:data-[position=Above]:origin-bottom data-[state=open]:data-[position=Above]:origin-bottom [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", - class - ); - - let target_id_for_script = ctx.target_id.clone(); - let target_id_for_script_2 = ctx.target_id.clone(); - - // Scroll indicator signals - let (on_scroll, can_scroll_up_signal, can_scroll_down_signal) = use_can_scroll_vertical(); - + let _ = (class, position, on_close); + let (on_scroll, can_scroll_up, can_scroll_down) = use_can_scroll_vertical(); view! { -
    -
    - -
    +
    +
    {children()} -
    - -
    +
    - - - }.into_any() -} \ No newline at end of file + } +} diff --git a/frontend/src/components/ui/separator.rs b/frontend/src/components/ui/separator.rs index 0809cdc..6d86960 100644 --- a/frontend/src/components/ui/separator.rs +++ b/frontend/src/components/ui/separator.rs @@ -1,35 +1,22 @@ use leptos::prelude::*; -use tw_merge::*; +use tailwind_fuse::tw_merge; + +#[derive(Clone, Copy, PartialEq, Eq, Default, Debug)] +#[allow(dead_code)] +pub enum SeparatorOrientation { #[default] Horizontal, Vertical } #[component] pub fn Separator( #[prop(into, optional)] orientation: Signal, #[prop(into, optional)] class: String, - // children: Children, ) -> impl IntoView { - let merged_class = Memo::new(move |_| { - let orientation = orientation.get(); - let separator = SeparatorClass { orientation }; - separator.with_class(class.clone()) - }); - - view! {