Add BTC holdings to display

Co-authored-by: Andrew Parker <aparker@squareup.com>
This commit is contained in:
Steven 2025-04-10 13:22:44 -04:00
parent 5936eb301f
commit c9afef5c74
No known key found for this signature in database
GPG Key ID: 1EC151C18B307356

View File

@ -1,8 +1,8 @@
"use client"; "use client";
import { useRouter, useSearchParams } from "next/navigation";
import { Suspense, useEffect, useMemo, useRef, useState } from "react";
import { SolariBoard } from "./components/solari/SolariBoard"; import { SolariBoard } from "./components/solari/SolariBoard";
import { useState, useEffect, useMemo, useRef, Suspense } from "react";
import { useSearchParams, useRouter } from "next/navigation";
// import { useDisplayLength } from "./components/useDisplayLength"; // import { useDisplayLength } from "./components/useDisplayLength";
function formatCurrency(number: number, locale = "en-US", currency = "USD") { function formatCurrency(number: number, locale = "en-US", currency = "USD") {
@ -64,7 +64,8 @@ function HomeContent() {
priceDirection ? ` ${priceDirection}` : "" priceDirection ? ` ${priceDirection}` : ""
}`; }`;
const holdingDisplay = error ? "Error" : formatCurrency(holdingValue); const holdingDisplay = error ? "Error" : `${holding.toLocaleString("en-US")}`;
const holdingValueDisplay = error ? "Error" : formatCurrency(holdingValue);
// Define the final board rows // Define the final board rows
const finalBoardRows = useMemo( const finalBoardRows = useMemo(
@ -72,14 +73,15 @@ function HomeContent() {
{ value: "", length: displayLength }, { value: "", length: displayLength },
{ value: ` ${ticker}`, length: displayLength }, { value: ` ${ticker}`, length: displayLength },
{ value: "", length: displayLength }, { value: "", length: displayLength },
{ value: " TOTAL HOLDING", length: displayLength }, { value: " TOTAL HOLDINGS", length: displayLength },
{ value: ` ${holdingDisplay}`, length: displayLength }, { value: ` BTC ${holdingDisplay}`, length: displayLength },
{ value: ` ${holdingValueDisplay}`, length: displayLength },
{ value: "", length: displayLength }, { value: "", length: displayLength },
{ value: " BTC PRICE", length: displayLength }, { value: " BTC PRICE", length: displayLength },
{ value: ` ${displayValue}`, length: displayLength }, { value: ` ${displayValue}`, length: displayLength },
{ value: "", length: displayLength }, { value: "", length: displayLength },
], ],
[ticker, holdingDisplay, displayValue, displayLength] [ticker, holdingValueDisplay, holdingDisplay, displayValue, displayLength]
); );
// Current board rows based on loading state and animation progress // Current board rows based on loading state and animation progress