-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9867 from hicommonwealth/malik.8804.token-trading…
…-from-explore `[Launchpad Discovery]:` Token Trade From Explore Page - Buy Mode
- Loading branch information
Showing
41 changed files
with
1,085 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
export enum SupportedCurrencies { | ||
USD = 'USD', | ||
} | ||
|
||
export enum CurrenciesSymbols { | ||
USD = '$', | ||
} | ||
|
||
export const currencyNameToSymbolMap: Record< | ||
SupportedCurrencies, | ||
CurrenciesSymbols | ||
> = { | ||
[SupportedCurrencies.USD]: CurrenciesSymbols.USD, | ||
// add more when supported | ||
}; | ||
|
||
export const currencySymbolPlacements = { | ||
onLeft: [SupportedCurrencies.USD], | ||
onRight: [] as string[], // some currencies use right side placements | ||
}; | ||
|
||
export const getAmountWithCurrencySymbol = ( | ||
amount: number, | ||
currencyName: SupportedCurrencies, | ||
) => { | ||
const symbol = currencyNameToSymbolMap[currencyName]; | ||
const leftSymbol = currencySymbolPlacements.onLeft.includes(currencyName) | ||
? symbol | ||
: ''; | ||
const rightymbol = currencySymbolPlacements.onRight.includes(currencyName) | ||
? symbol | ||
: ''; | ||
|
||
return `${leftSymbol} ${amount} ${rightymbol}`; | ||
}; |
Oops, something went wrong.