From 0abcd5d631c2eaf07535845c1d77a703876d2b94 Mon Sep 17 00:00:00 2001 From: Karolina Kosiorowska Date: Tue, 28 Nov 2023 16:47:18 +0100 Subject: [PATCH] Create a USD currency --- dapp/src/components/Navbar/index.tsx | 4 ++-- dapp/src/components/Overview/PositionDetails.tsx | 4 ++-- dapp/src/constants/currency.ts | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dapp/src/components/Navbar/index.tsx b/dapp/src/components/Navbar/index.tsx index 23c4edb9e..f524f6fe5 100644 --- a/dapp/src/components/Navbar/index.tsx +++ b/dapp/src/components/Navbar/index.tsx @@ -2,7 +2,7 @@ import React from "react" import { Box, Button, HStack, Icon, Switch } from "@chakra-ui/react" import ConnectWallet from "./ConnectWallet" import { ChevronRight } from "../../static/icons" -import { FIAT_CURRENCY_USD } from "../../constants" +import { USD } from "../../constants" export default function Navbar() { return ( @@ -12,7 +12,7 @@ export default function Navbar() { {/* TODO: Handle click actions */} - Show values in {FIAT_CURRENCY_USD} + Show values in {USD.symbol} diff --git a/dapp/src/components/Overview/PositionDetails.tsx b/dapp/src/components/Overview/PositionDetails.tsx index e5a426efb..9e5c4be71 100644 --- a/dapp/src/components/Overview/PositionDetails.tsx +++ b/dapp/src/components/Overview/PositionDetails.tsx @@ -9,7 +9,7 @@ import { Icon, useColorModeValue, } from "@chakra-ui/react" -import { BITCOIN, FIAT_CURRENCY_USD } from "../../constants" +import { BITCOIN, USD } from "../../constants" import { Info } from "../../static/icons" export default function PositionDetails() { @@ -31,7 +31,7 @@ export default function PositionDetails() { 1.245.148,1 - {FIAT_CURRENCY_USD} + {USD.symbol} {/* TODO: Add correct text for tooltip */} diff --git a/dapp/src/constants/currency.ts b/dapp/src/constants/currency.ts index dee8507e4..feecf3127 100644 --- a/dapp/src/constants/currency.ts +++ b/dapp/src/constants/currency.ts @@ -12,10 +12,14 @@ export const ETHEREUM: Currency = { decimals: 18, } +export const USD: Currency = { + name: "United States Dollar", + symbol: "USD", + decimals: 10, +} + export const CURRENCY_ID_BITCOIN = import.meta.env.VITE_USE_TESTNET === "true" ? "bitcoin_testnet" : "bitcoin" export const CURRENCY_ID_ETHEREUM = import.meta.env.VITE_USE_TESTNET === "true" ? "ethereum_goerli" : "ethereum" - -export const FIAT_CURRENCY_USD = "USD"