@@ -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>
0 commit comments