diff --git a/components/Navigation.tsx b/components/Navigation.tsx index 5ac84234..38a844af 100644 --- a/components/Navigation.tsx +++ b/components/Navigation.tsx @@ -5,6 +5,7 @@ import { Popover } from "@headlessui/react"; import { ChevronDownIcon } from "@heroicons/react/24/solid"; import SearchInput from "components/SearchInput"; +import ProgressBar from "components/ProgressBar"; import Wallet from "./Wallet"; const mockedAccounts = [ @@ -58,7 +59,7 @@ const Navigation = () => { {/* Sub navigation bar */} -
+
{mockedAccounts.map((account, index) => ( @@ -102,8 +103,14 @@ const Navigation = () => {

$: 2500

-
Lvg Gauge
-
Risk Gauge
+
Lvg
+
Risk
+ +
+ + + +
diff --git a/components/ProgressBar.tsx b/components/ProgressBar.tsx new file mode 100644 index 00000000..fdc78eaa --- /dev/null +++ b/components/ProgressBar.tsx @@ -0,0 +1,42 @@ +import React, { useEffect, useState } from "react"; +import { ArrowRightIcon } from "@heroicons/react/24/solid"; + +type Props = { + value: number; +}; + +const ProgressBar = ({ value }: Props) => { + const percentageValue = `${(value * 100).toFixed(0)}%`; + const [newValue, setNewValue] = useState(0.77); + + useEffect(() => { + setInterval(() => { + // randomizing value between value and 1 + setNewValue(Math.random() * (1 - value) + value); + }, 3000); + }, [value]); + + console.log(newValue); + + const percentageNewValue = `${(newValue * 100).toFixed(0)}%`; + + return ( +
+
+
+
+ {percentageValue} + + {percentageNewValue} +
+
+ ); +}; + +export default ProgressBar;