Skip to content

Commit b7b346f

Browse files
committed
fix: update PriceWidget to show no fresh price
1 parent a7c1812 commit b7b346f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/nextjs/components/oracle/PriceWidget.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,27 @@ export const PriceWidget = ({ contractName }: PriceWidgetProps) => {
4444
prevPrice.current = currentPrice;
4545
}, [currentPrice]);
4646

47+
console.log(currentPrice, isLoading, isError);
48+
4749
return (
4850
<div className="flex flex-col gap-2">
4951
<h2 className="text-xl font-bold">Current Price</h2>
5052
<div className="bg-base-100 rounded-lg p-4 w-1/2 md:w-1/4 mx-auto flex justify-center items-center relative">
5153
<TooltipInfo
5254
top={0}
5355
right={0}
54-
infoText="Displays the median price. If an error occurs, it means that no oracle nodes have reported prices in the last 10 seconds."
56+
infoText="Displays the median price. If no oracle nodes have reported prices in the last 10 seconds, it will display 'No fresh price'."
5557
/>
5658
<div className={`rounded-lg transition-colors duration-1000 ${highlight ? highlightColor : ""}`}>
57-
<div className="text-4xl font-bold">
59+
<div className="font-bold h-10 text-4xl flex items-center justify-center">
5860
{isError ? (
59-
<div className="text-error">Error</div>
60-
) : currentPrice !== undefined ? (
61-
`$${parseFloat(formatEther(currentPrice)).toFixed(2)}`
61+
<div className="text-error text-xl">No fresh price</div>
6262
) : isLoading || currentPrice === undefined ? (
6363
<div className="animate-pulse">
6464
<div className="h-10 bg-secondary rounded-md w-32"></div>
6565
</div>
6666
) : (
67-
<div className="text-error">Error</div>
67+
`$${parseFloat(formatEther(currentPrice)).toFixed(2)}`
6868
)}
6969
</div>
7070
</div>

0 commit comments

Comments
 (0)