Skip to content

Commit afb3059

Browse files
committed
formatting
1 parent 40770ef commit afb3059

File tree

6 files changed

+31
-32
lines changed

6 files changed

+31
-32
lines changed

app/src/components/breadcrumbs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ pub fn Breadcrumbs(path: Signal<PathBuf>) -> impl IntoView {
2525

2626
let home_icon = view! {
2727
<a href="/index">
28-
<svg class="h-6 w-6 fill-current" viewBox="0 0 24 24">
28+
<svg class="w-6 h-6 fill-current" viewBox="0 0 24 24">
2929
<path d="M12,3L20,9V21H15V14H9V21H4V9L12,3Z" />
3030
</svg>
3131
</a>
3232
};
3333

3434
view! {
35-
<div class="text-lg breadcrumbs max-w-full">
35+
<div class="max-w-full text-lg breadcrumbs">
3636
<ul class="h-8">
3737
<li>{home_icon}</li>
3838
{breadcrumbs}

app/src/components/file_entries.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ pub fn EntryComponent(data: Entry) -> impl IntoView {
3333
} = data;
3434

3535
let inner = view! {
36-
<div class="entry w-full grid grid-cols-(--entry-cols-mobile) md:grid-cols-(--entry-cols) gap-2">
36+
<div class="grid gap-2 w-full entry grid-cols-(--entry-cols-mobile) md:grid-cols-(--entry-cols)">
3737
<Icon type_=type_ name=name.clone() />
38-
<span class="flex items-center overflow-x-hidden">{name}</span>
39-
<span class="flex items-center justify-end">{size}</span>
40-
<span class="hidden md:flex items-center">{relative_time}</span>
38+
<span class="flex overflow-x-hidden items-center">{name}</span>
39+
<span class="flex justify-end items-center">{size}</span>
40+
<span class="hidden items-center md:flex">{relative_time}</span>
4141
</div>
4242
};
4343

app/src/components/folder_download.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ pub fn FolderDownloads(path: Signal<PathBuf>) -> impl IntoView {
1919

2020
view! {
2121
<div class="dropdown dropdown-hover grow">
22-
<label tabindex="0" class="btn btn-primary w-full">
22+
<label tabindex="0" class="w-full btn btn-primary">
2323
Download Folder
2424
</label>
25-
<ul tabindex="0" class="dropdown-content menu p-2 shadow bg-base-100 rounded-box">
25+
<ul tabindex="0" class="p-2 shadow dropdown-content menu bg-base-100 rounded-box">
2626
{method_list}
2727
</ul>
2828
</div>

app/src/components/new_folder.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,27 @@ pub fn NewFolderButton(path: Signal<PathBuf>, action: ServerAction<NewFolder>) -
1717

1818
view! {
1919
<div class="grow">
20-
<button class="btn btn-primary w-full" onclick="new_folder_modal.showModal()">
20+
<button class="w-full btn btn-primary" onclick="new_folder_modal.showModal()">
2121
Create New Folder
2222
</button>
2323
<dialog id="new_folder_modal" class="modal">
2424
<ActionForm action=action>
2525
<div class="modal-box">
26-
<h3 class="font-bold text-lg">New Folder</h3>
26+
<h3 class="text-lg font-bold">New Folder</h3>
2727
<input
28-
class="input py-2 my-2"
28+
class="py-2 my-2 input"
2929
type="text"
3030
value="New Folder"
3131
on:focus=on_new_folder_focus
3232
node_ref=new_folder_input
3333
name="name"
3434
autofocus
3535
/>
36-
<input type="hidden" name="path" value=move || os_to_string(path.read().as_os_str()) />
36+
<input
37+
type="hidden"
38+
name="path"
39+
value=move || os_to_string(path.read().as_os_str())
40+
/>
3741
<div class="modal-action">
3842
<button class="btn" type="reset" onclick="new_folder_modal.close()">
3943
Cancel

app/src/components/upload.rs

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -218,33 +218,35 @@ pub fn FileUpload(path: Signal<PathBuf>, #[prop(into)] on_upload: Callback<()>)
218218
});
219219
};
220220

221-
let ProgressBar = |Progress {
222-
size,
223-
start_time,
224-
uploaded,
225-
}| {
221+
fn ProgressBar(
222+
Progress {
223+
size,
224+
start_time,
225+
uploaded,
226+
}: Progress,
227+
) -> impl IntoView {
226228
let percent = move || *uploaded.read() * 100 / size;
227229
let speed = move || {
228230
format_bytes(((uploaded() * 1000) as f64 / start_time.elapsed().as_millis_f64()) as u64)
229231
};
230232
view! {
231-
<div class="m-2 flex flex-row items-baseline justify-between gap-5 w-full">
233+
<div class="flex flex-row gap-5 justify-between items-baseline m-2 w-full">
232234
<span>Uploading {move || format!("{: >3}", percent())}%</span>
233-
<div class="bg-neutral rounded-full grow h-3">
235+
<div class="h-3 rounded-full bg-neutral grow">
234236
<div
235-
class="bg-info h-full transition-all ease-linear duration-50 rounded-full"
237+
class="h-full rounded-full transition-all ease-linear bg-info duration-50"
236238
style:width=move || format!("{: >3}%", percent())
237239
/>
238240
</div>
239241
<span class="w-28 text-right">{speed}/s</span>
240242
</div>
241243
}
242-
};
244+
}
243245

244246
view! {
245-
<div class="flex grow flex-col gap-2">
247+
<div class="flex flex-col gap-2 grow">
246248
<form
247-
class="flex flex-wrap grow-2 gap-2"
249+
class="flex flex-wrap gap-2 grow-2"
248250
method="POST"
249251
enctype="multipart/form-data"
250252
node_ref=form_ref
@@ -257,14 +259,7 @@ pub fn FileUpload(path: Signal<PathBuf>, #[prop(into)] on_upload: Callback<()>)
257259
/>
258260
// placeholder that is filled on submission
259261
<input type="hidden" name="id" value="" />
260-
<input
261-
type="file"
262-
name="uploads"
263-
class="file-input grow-3"
264-
multiple
265-
node_ref=file_ref
266-
/>
267-
// ref_=file_ref
262+
<input type="file" name="uploads" class="file-input grow-3" multiple node_ref=file_ref />
268263
<button type="submit" class="btn btn-primary grow-1">
269264
Upload
270265
</button>

app/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub fn FilesPage() -> impl IntoView {
7474

7575
<Breadcrumbs path=path_signal />
7676

77-
<div class="grid grid-cols-(--entry-cols-mobile) md:grid-cols-(--entry-cols) gap-2 border-b border-base-content mb-1">
77+
<div class="grid gap-2 mb-1 border-b grid-cols-(--entry-cols-mobile) border-base-content md:grid-cols-(--entry-cols)">
7878
<span></span>
7979
<span>Name</span>
8080
<span>Size</span>

0 commit comments

Comments
 (0)