diff --git a/Cargo.lock b/Cargo.lock index b71b5c2..de13562 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1274,6 +1274,7 @@ dependencies = [ "leptos-shadcn-scroll-area", "leptos-shadcn-separator", "leptos-shadcn-sheet", + "leptos-shadcn-skeleton", "leptos-shadcn-tabs", "leptos-shadcn-toast", "leptos-shadcn-tooltip", @@ -2390,6 +2391,21 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "leptos-shadcn-skeleton" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c14b6bd0f2fe191e3e114a34cee889fc983546ad488e76e76511e3d75ea3f86" +dependencies = [ + "leptos", + "leptos-node-ref", + "leptos-shadcn-signal-management", + "leptos-struct-component", + "leptos-style", + "tailwind_fuse", + "web-sys", +] + [[package]] name = "leptos-shadcn-tabs" version = "0.8.1" diff --git a/frontend/Cargo.toml b/frontend/Cargo.toml index 5a52764..6f59215 100644 --- a/frontend/Cargo.toml +++ b/frontend/Cargo.toml @@ -51,4 +51,5 @@ leptos-shadcn-label = "0.8" leptos-shadcn-alert = "0.8" leptos-shadcn-toast = "0.8" leptos-shadcn-dropdown-menu = "0.8" -leptos-shadcn-tooltip = "0.8" \ No newline at end of file +leptos-shadcn-tooltip = "0.8" +leptos-shadcn-skeleton = "0.8" \ No newline at end of file diff --git a/frontend/public/tailwind.css b/frontend/public/tailwind.css index d48725b..7859045 100644 --- a/frontend/public/tailwind.css +++ b/frontend/public/tailwind.css @@ -79,7 +79,6 @@ --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-semibold: 600; - --font-weight-bold: 700; --tracking-tight: -0.025em; --tracking-wider: 0.05em; --tracking-widest: 0.1em; @@ -1578,6 +1577,11 @@ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)); transition-duration: var(--tw-duration, var(--default-transition-duration)); } + .transition-opacity { + transition-property: opacity; + transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)); + transition-duration: var(--tw-duration, var(--default-transition-duration)); + } .transition-shadow { transition-property: box-shadow; transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)); diff --git a/frontend/src/components/torrent/add_torrent.rs b/frontend/src/components/torrent/add_torrent.rs index ace38f3..7d7178d 100644 --- a/frontend/src/components/torrent/add_torrent.rs +++ b/frontend/src/components/torrent/add_torrent.rs @@ -1,6 +1,5 @@ use leptos::prelude::*; use leptos::task::spawn_local; -use leptos_shadcn_dialog::{Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter}; use leptos_shadcn_input::Input; use leptos_shadcn_button::{Button, ButtonVariant}; use leptos_shadcn_alert::{Alert, AlertDescription, AlertVariant}; @@ -17,7 +16,6 @@ pub fn AddTorrentDialog( let uri = signal(String::new()); let is_loading = signal(false); let error_msg = signal(Option::::None); - let is_open = signal(true); let handle_submit = move |ev: web_sys::SubmitEvent| { ev.prevent_default(); @@ -41,7 +39,6 @@ pub fn AddTorrentDialog( shared::NotificationLevel::Success, "Torrent başarıyla eklendi" ); - is_open.1.set(false); on_close.run(()); } Err(e) => { @@ -53,58 +50,76 @@ pub fn AddTorrentDialog( }); }; + let handle_backdrop = { + let on_close = on_close.clone(); + move |e: web_sys::MouseEvent| { + e.stop_propagation(); + on_close.run(()); + } + }; view! { - - - - "Add Torrent" - "Enter a Magnet link or a .torrent file URL." - + // Backdrop overlay +
+ // Dialog panel +
+ // Header +
+

"Add Torrent"

+

"Enter a Magnet link or a .torrent file URL."

+
+ +
+ - - - - {move || error_msg.0.get().map(|msg| view! { - - {msg} - - })} + {move || error_msg.0.get().map(|msg| view! { + + {msg} + + })} - - + - - -
- -
+ } else { + leptos::either::Either::Right(view! { "Add" }) + }} + + + + + // Close button (X) + + } } \ No newline at end of file