Skip to content

Commit fcc705f

Browse files
authored
shadcn progress (#619)
1 parent 1217aac commit fcc705f

2 files changed

Lines changed: 19 additions & 59 deletions

File tree

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
import { useGlobalStore } from "@/GlobalStates/GlobalStore"
2-
import '../css/Loading.css'
31
import { useShallow } from "zustand/shallow"
2+
import { Field, FieldLabel } from "@/components/ui/field"
3+
import { Progress } from "@/components/ui/progress"
4+
import { useGlobalStore } from "@/GlobalStates/GlobalStore"
45

5-
6-
export function Loading(){
7-
const {progress, status} = useGlobalStore(useShallow(state => ({
6+
export function Loading() {
7+
const { progress, status } = useGlobalStore(useShallow(state => ({
88
progress: state.progress,
99
status: state.status
1010
})))
1111

12-
return (
13-
status &&
14-
<div className="loading-container">
15-
<div className='loading'>
16-
{status}
17-
</div>
18-
<div className="progress-bar"
19-
style={{
20-
width:`${progress}%`
21-
}}
22-
/>
23-
</div>
24-
)
25-
}
12+
if (!status) return null
13+
14+
return (
15+
<div className="fixed top-32 sm:top-12 right-4 z-50">
16+
<Field className="w-full max-w-md">
17+
<FieldLabel htmlFor="progress-loading">
18+
<span>{status}</span>
19+
<span className="ml-auto">{progress}%</span>
20+
</FieldLabel>
21+
<Progress value={progress} id="progress-loading" />
22+
</Field>
23+
</div>
24+
)
25+
}

src/components/ui/css/Loading.css

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)