-
Notifications
You must be signed in to change notification settings - Fork 588
Add SwapWidget in SDK, add in dashboard, BuyWidget UI improvements #8044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
50c1a19
c917607
751bd0a
ce099a3
ad7daa8
0b70ce8
dbba64d
2fe8436
814acd6
a630bc9
8513839
7681650
a5011af
3d7fd1e
ebf6eef
6fb8a4e
ae43ed5
abf8eea
2f2f8de
8ff84b5
9d17bdc
ed5ce8a
b2d6429
2a78c45
654cc82
0349636
1d98c3e
8f75d50
9cf8688
b3fe76a
33fa31a
0d2d39d
1405e11
f0c4fc8
43b06e1
d87c23b
b1f23a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,5 @@ export interface Chain { | |
decimals: number; | ||
}; | ||
} | ||
|
||
export type BridgeChain = Chain; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,22 +27,34 @@ | |
export type SupportedFiatCurrency = (typeof CURRENCIES)[number] | (string & {}); | ||
|
||
export function getFiatSymbol(showBalanceInFiat: SupportedFiatCurrency) { | ||
switch (showBalanceInFiat) { | ||
case "USD": | ||
return "$"; | ||
case "CAD": | ||
return "$"; | ||
case "GBP": | ||
return "£"; | ||
case "EUR": | ||
return "€"; | ||
case "JPY": | ||
return "¥"; | ||
case "AUD": | ||
return "$"; | ||
case "NZD": | ||
return "$"; | ||
default: | ||
return "$"; | ||
if (currencySymbol[showBalanceInFiat]) { | ||
return currencySymbol[showBalanceInFiat]; | ||
} | ||
return "$"; | ||
} | ||
|
||
const currencySymbol: Record<SupportedFiatCurrency, string> = { | ||
|
||
USD: "$", | ||
EUR: "€", | ||
GBP: "£", | ||
JPY: "¥", | ||
KRW: "₩", | ||
CNY: "¥", | ||
INR: "₹", | ||
NOK: "kr", | ||
SEK: "kr", | ||
CHF: "CHF", | ||
AUD: "$", | ||
CAD: "$", | ||
NZD: "$", | ||
MXN: "$", | ||
BRL: "R$", | ||
CLP: "$", | ||
CZK: "Kč", | ||
DKK: "kr", | ||
HKD: "$", | ||
HUF: "Ft", | ||
IDR: "Rp", | ||
ILS: "₪", | ||
ISK: "kr", | ||
}; | ||
MananTank marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { MagnifyingGlassIcon } from "@radix-ui/react-icons"; | ||
import { iconSize, spacing } from "../../../../core/design-system/index.js"; | ||
import { Container } from "../../components/basic.js"; | ||
import { Input } from "../../components/formElements.js"; | ||
|
||
export function SearchInput(props: { | ||
value: string; | ||
onChange: (value: string) => void; | ||
placeholder: string; | ||
}) { | ||
return ( | ||
<div | ||
style={{ | ||
position: "relative", | ||
}} | ||
> | ||
<Container color="secondaryText"> | ||
<MagnifyingGlassIcon | ||
width={iconSize.md} | ||
height={iconSize.md} | ||
style={{ | ||
position: "absolute", | ||
left: spacing.sm, | ||
top: "50%", | ||
transform: "translateY(-50%)", | ||
}} | ||
/> | ||
</Container> | ||
|
||
<Input | ||
variant="outline" | ||
placeholder={props.placeholder} | ||
value={props.value} | ||
style={{ | ||
paddingLeft: "44px", | ||
}} | ||
onChange={(e) => props.onChange(e.target.value)} | ||
/> | ||
</div> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { ChevronDownIcon } from "@radix-ui/react-icons"; | ||
import type { BridgeChain } from "../../../../../bridge/types/Chain.js"; | ||
import type { ThirdwebClient } from "../../../../../client/client.js"; | ||
import { | ||
fontSize, | ||
iconSize, | ||
spacing, | ||
} from "../../../../core/design-system/index.js"; | ||
import { Button } from "../../components/buttons.js"; | ||
import { Img } from "../../components/Img.js"; | ||
import { cleanedChainName } from "./utils.js"; | ||
|
||
export function SelectChainButton(props: { | ||
selectedChain: BridgeChain; | ||
client: ThirdwebClient; | ||
onClick: () => void; | ||
}) { | ||
return ( | ||
<Button | ||
variant="secondary" | ||
fullWidth | ||
style={{ | ||
justifyContent: "flex-start", | ||
fontWeight: 500, | ||
fontSize: fontSize.md, | ||
padding: `${spacing.sm} ${spacing.sm}`, | ||
minHeight: "48px", | ||
}} | ||
gap="sm" | ||
onClick={props.onClick} | ||
> | ||
<Img | ||
src={props.selectedChain.icon} | ||
client={props.client} | ||
width={iconSize.lg} | ||
height={iconSize.lg} | ||
/> | ||
<span> {cleanedChainName(props.selectedChain.name)} </span> | ||
|
||
<ChevronDownIcon | ||
width={iconSize.sm} | ||
height={iconSize.sm} | ||
style={{ marginLeft: "auto" }} | ||
/> | ||
</Button> | ||
); | ||
} |
Uh oh!
There was an error while loading. Please reload this page.