Skip to content

Commit

Permalink
remove usdt denomination
Browse files Browse the repository at this point in the history
  • Loading branch information
nattadex committed Jul 19, 2024
1 parent 0e1668b commit 5aa2136
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ export const ActiveUSDValue = React.memo(
displayType="text"
prefix={
props.denominationCurrency === undefined ||
props.denominationCurrency === PortfolioButtonGroupTabKey.USDT
props.denominationCurrency === PortfolioButtonGroupTabKey.USDC
? "≈ $"
: undefined
}
suffix={
props.denominationCurrency !== undefined &&
props.denominationCurrency !== PortfolioButtonGroupTabKey.USDT
props.denominationCurrency !== PortfolioButtonGroupTabKey.USDC
? ` ${props.denominationCurrency}`
: undefined
}
Expand All @@ -56,5 +56,5 @@ export const ActiveUSDValue = React.memo(
{props.isOraclePrice === true && <IconTooltip />}
</View>
);
}
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ export const ActiveUSDValueV2 = React.memo(
displayType="text"
prefix={
props.denominationCurrency === undefined ||
props.denominationCurrency === PortfolioButtonGroupTabKey.USDT
props.denominationCurrency === PortfolioButtonGroupTabKey.USDC
? "$"
: undefined
}
suffix={
props.denominationCurrency !== undefined &&
props.denominationCurrency !== PortfolioButtonGroupTabKey.USDT
props.denominationCurrency !== PortfolioButtonGroupTabKey.USDC
? ` ${props.denominationCurrency}`
: undefined
}
Expand All @@ -56,5 +56,5 @@ export const ActiveUSDValueV2 = React.memo(
{props.isOraclePrice === true && <IconTooltip />}
</View>
);
}
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,12 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element {
};

const portfolioButtonGroup = [
{
id: PortfolioButtonGroupTabKey.USDT,
label: translate("screens/PortfolioScreen", "USDT"),
handleOnPress: () =>
onPortfolioButtonGroupChange(PortfolioButtonGroupTabKey.USDT),
},
// {
// id: PortfolioButtonGroupTabKey.USDT,
// label: translate("screens/PortfolioScreen", "USDT"),
// handleOnPress: () =>
// onPortfolioButtonGroupChange(PortfolioButtonGroupTabKey.USDT),
// },
{
id: PortfolioButtonGroupTabKey.DFI,
label: translate("screens/PortfolioScreen", "DFI"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("Token Breakdown Details", () => {
availableAmount={new BigNumber("99")}
availableValue={new BigNumber("999999.12345678")}
testID="foo"
denominationCurrency={PortfolioButtonGroupTabKey.USDT}
denominationCurrency={PortfolioButtonGroupTabKey.USDC}
/>
);
const rendered = render(component);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ export function TokenBreakdownDetails(
}}
containerStyle={tailwind("mb-2")}
prefix={
props.denominationCurrency === PortfolioButtonGroupTabKey.USDT
props.denominationCurrency === PortfolioButtonGroupTabKey.USDC
? "≈ $"
: undefined
}
suffix={
props.denominationCurrency !== PortfolioButtonGroupTabKey.USDT
props.denominationCurrency !== PortfolioButtonGroupTabKey.USDC
? ` ${props.denominationCurrency}`
: undefined
}
Expand All @@ -81,12 +81,12 @@ export function TokenBreakdownDetails(
dark: tailwind("text-gray-400"),
}}
prefix={
props.denominationCurrency === PortfolioButtonGroupTabKey.USDT
props.denominationCurrency === PortfolioButtonGroupTabKey.USDC
? "≈ $"
: undefined
}
suffix={
props.denominationCurrency !== PortfolioButtonGroupTabKey.USDT
props.denominationCurrency !== PortfolioButtonGroupTabKey.USDC
? ` ${props.denominationCurrency}`
: undefined
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function TokenBreakdownDetailsV2(
return getTokenPrice(symbol, amount, isLPs);
};
const isUSDDenomination =
denominationCurrency === PortfolioButtonGroupTabKey.USDT;
denominationCurrency === PortfolioButtonGroupTabKey.USDC;

return (
<ThemedViewV2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ describe("DFI Total Portfolio Card", () => {
totalLoansValue={new BigNumber(100)}
portfolioButtonGroup={[
{
id: PortfolioButtonGroupTabKey.USDT,
id: PortfolioButtonGroupTabKey.USDC,
label: "USD",
handleOnPress: jest.fn(),
},
]}
denominationCurrency={PortfolioButtonGroupTabKey.USDT}
denominationCurrency={PortfolioButtonGroupTabKey.USDC}
setDenominationCurrency={jest.fn()}
/>
</Provider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { BalanceText } from "./BalanceText";
import { BalanceTextV2 } from "./BalanceTextV2";

export enum PortfolioButtonGroupTabKey {
USDT = "USDT",
DFI = "DFI",
BTC = "BTC",
DUSD = "DUSD",
Expand Down Expand Up @@ -98,7 +97,7 @@ export function TotalPortfolio(props: TotalPortfolioProps): JSX.Element {
<NumberFormat
displayType="text"
prefix={
denominationCurrency === PortfolioButtonGroupTabKey.USDT
denominationCurrency === PortfolioButtonGroupTabKey.USDC
? "$"
: undefined
}
Expand All @@ -120,7 +119,7 @@ export function TotalPortfolio(props: TotalPortfolioProps): JSX.Element {
)}
thousandSeparator
value={
denominationCurrency === PortfolioButtonGroupTabKey.USDT
denominationCurrency === PortfolioButtonGroupTabKey.USDC
? getPrecisedCurrencyValue(totalPortfolioValue)
: getPrecisedTokenValue(totalPortfolioValue)
}
Expand Down Expand Up @@ -234,13 +233,13 @@ function USDValueRow(props: {
// TODO: modify condition when API is ready for denomination currency change for other pages other than BalanceScreen page
prefix={
props.denominationCurrency === undefined ||
props.denominationCurrency === PortfolioButtonGroupTabKey.USDT
props.denominationCurrency === PortfolioButtonGroupTabKey.USDC
? "$"
: undefined
}
suffix={
props.denominationCurrency !== undefined &&
props.denominationCurrency !== PortfolioButtonGroupTabKey.USDT
props.denominationCurrency !== PortfolioButtonGroupTabKey.USDC
? ` ${props.denominationCurrency}`
: undefined
}
Expand All @@ -255,7 +254,7 @@ function USDValueRow(props: {
)}
thousandSeparator
value={
props.denominationCurrency === PortfolioButtonGroupTabKey.USDT
props.denominationCurrency === PortfolioButtonGroupTabKey.USDC
? getPrecisedCurrencyValue(props.value)
: getPrecisedTokenValue(props.value)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface PortfolioCurrency {
export function useDenominationCurrency(): PortfolioCurrency {
const logger = useLogger();
const [denominationCurrency, setDenominationCurrency] =
useState<PortfolioButtonGroupTabKey>(PortfolioButtonGroupTabKey.USDT);
useState<PortfolioButtonGroupTabKey>(PortfolioButtonGroupTabKey.USDC);

useEffect(() => {
PortfolioCurrencyPersistence.get()
Expand All @@ -22,7 +22,7 @@ export function useDenominationCurrency(): PortfolioCurrency {
}, []);

const updatePortfolioCurrency = async (
denomination: PortfolioButtonGroupTabKey
denomination: PortfolioButtonGroupTabKey,
): Promise<void> => {
setDenominationCurrency(denomination);
await PortfolioCurrencyPersistence.set(denomination);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,12 +538,12 @@ function TokenSummary(props: {
<NumberFormat
displayType="text"
prefix={
denominationCurrency === PortfolioButtonGroupTabKey.USDT
denominationCurrency === PortfolioButtonGroupTabKey.USDC
? "$"
: undefined
}
suffix={
denominationCurrency !== PortfolioButtonGroupTabKey.USDT
denominationCurrency !== PortfolioButtonGroupTabKey.USDC
? ` ${denominationCurrency}`
: undefined
}
Expand Down

0 comments on commit 5aa2136

Please sign in to comment.