StatusBar Component

Implemented a basic status bar with 3 dots, that is able to show 3 states. The length of the status line can be controlled by a paramter called "progress". Every value between 0 and 100 is valid. The Progress bar will change its color depending on the value of "progress"
This commit is contained in:
brausjonas
2023-05-02 22:49:05 +02:00
parent 104c30553b
commit 124ad09c37
6 changed files with 118 additions and 17 deletions
+29 -7
View File
@@ -1,10 +1,32 @@
import { Inter } from 'next/font/google'
import {Inter} from 'next/font/google'
import React, {useState} from "react";
import StatusBar from "@/components/StatusBar";
import Button from "@/components/Button";
import {arrowLeft, arrowRight} from "@/components/Icons";
const inter = Inter({ subsets: ['latin'] })
const inter = Inter({subsets: ['latin']})
export default function Home() {
return (
<></>
)
}
export default function Home(p) {
const [pr, setPr] = useState(0)
return (
<div style={{
display: "flex",
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
gap: 30
}}>
<Button onClick={() => {
setPr(pr - 50)
}} width={50} height={50} icon={arrowLeft}/>
<StatusBar progress={pr}/>
<Button onClick={() => {
setPr(pr + 50)
}} width={50} height={50} icon={arrowRight}/>
</div>
)
}