-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
152 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
export default function BigNumber(props: { val: number, name: string }) { | ||
return ( | ||
<div className='flex flex-col items-center justify-between bg-[#1f1f1f] p-4 rounded-md w-28 flex-1'> | ||
<div className='text-green-500 text-xs font-mono w-fit ml-auto mb-2'>+16</div> | ||
<div className='font-mono text-3xl'>{props.val}</div> | ||
<div className="opacity-60 text-sm font-extralight">{props.name}</div> | ||
</div> | ||
) | ||
import useVictoryValue, { MapValue } from "@/hooks/useVictoryValue"; | ||
import { LOS } from "./sidebar"; | ||
|
||
export default function BigNumber(props: { val: number; name?: string; victory_id: string }) { | ||
const [val] = useVictoryValue(props.victory_id); | ||
|
||
const get_val = (map_val: MapValue | undefined) => { | ||
if (map_val) { | ||
return (val as number).toFixed(2) | ||
} else { | ||
return (<LOS />) | ||
} | ||
} | ||
|
||
return ( | ||
<div className="flex flex-col items-center justify-between bg-[#1f1f1f] p-4 rounded-md w-28 flex-1"> | ||
<div className="text-green-500 text-xs font-mono w-fit ml-auto mb-2">+16</div> | ||
<div className="font-mono text-3xl">{get_val(val)}</div> | ||
<div className="opacity-60 text-sm font-extralight">{props.name ?? props.victory_id}</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.