Skip to content

Commit

Permalink
Create a USD currency
Browse files Browse the repository at this point in the history
  • Loading branch information
kkosiorowska committed Nov 28, 2023
1 parent 679d226 commit 0abcd5d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dapp/src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -12,7 +12,7 @@ export default function Navbar() {
</HStack>
<HStack mt={8} justifyContent="space-between">
{/* TODO: Handle click actions */}
<Switch size="sm">Show values in {FIAT_CURRENCY_USD}</Switch>
<Switch size="sm">Show values in {USD.symbol}</Switch>
<Button variant="link" rightIcon={<Icon as={ChevronRight} />}>
Read documentation
</Button>
Expand Down
4 changes: 2 additions & 2 deletions dapp/src/components/Overview/PositionDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -31,7 +31,7 @@ export default function PositionDetails() {
<HStack w="100%" justifyContent="space-between">
<HStack>
<Text>1.245.148,1</Text>
<Text>{FIAT_CURRENCY_USD}</Text>
<Text>{USD.symbol}</Text>
</HStack>
{/* TODO: Add correct text for tooltip */}
<Tooltip label="Template">
Expand Down
8 changes: 6 additions & 2 deletions dapp/src/constants/currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 0abcd5d

Please sign in to comment.