Skip to content

Commit 50c1a19

Browse files
committed
temp
1 parent a724bc3 commit 50c1a19

31 files changed

+2539
-31
lines changed

packages/thirdweb/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@
341341
"test:ui": "NODE_OPTIONS=--max-old-space-size=8192 vitest dev -c ./test/vitest.config.ts --coverage --ui",
342342
"test:watch": "vitest -c ./test/vitest.config.ts dev",
343343
"typedoc": "node scripts/typedoc.mjs && node scripts/parse.mjs",
344+
"typecheck": "tsc --project ./tsconfig.build.json --module nodenext --moduleResolution nodenext --noEmit",
344345
"update-version": "node scripts/version.mjs"
345346
},
346347
"sideEffects": false,

packages/thirdweb/src/bridge/types/Chain.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ export interface Chain {
3838
decimals: number;
3939
};
4040
}
41+
42+
export type BridgeChain = Chain;

packages/thirdweb/src/pay/convert/type.ts

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,34 @@ const CURRENCIES = [
2727
export type SupportedFiatCurrency = (typeof CURRENCIES)[number] | (string & {});
2828

2929
export function getFiatSymbol(showBalanceInFiat: SupportedFiatCurrency) {
30-
switch (showBalanceInFiat) {
31-
case "USD":
32-
return "$";
33-
case "CAD":
34-
return "$";
35-
case "GBP":
36-
return "£";
37-
case "EUR":
38-
return "€";
39-
case "JPY":
40-
return "¥";
41-
case "AUD":
42-
return "$";
43-
case "NZD":
44-
return "$";
45-
default:
46-
return "$";
30+
if (currencySymbol[showBalanceInFiat]) {
31+
return currencySymbol[showBalanceInFiat];
4732
}
33+
return "$";
4834
}
35+
36+
const currencySymbol: Record<SupportedFiatCurrency, string> = {
37+
USD: "$",
38+
EUR: "€",
39+
GBP: "£",
40+
JPY: "¥",
41+
KRW: "₩",
42+
CNY: "¥",
43+
INR: "₹",
44+
NOK: "kr",
45+
SEK: "kr",
46+
CHF: "CHF",
47+
AUD: "$",
48+
CAD: "$",
49+
NZD: "$",
50+
MXN: "$",
51+
BRL: "R$",
52+
CLP: "$",
53+
CZK: "Kč",
54+
DKK: "kr",
55+
HKD: "$",
56+
HUF: "Ft",
57+
IDR: "Rp",
58+
ILS: "₪",
59+
ISK: "kr",
60+
};

packages/thirdweb/src/react/core/design-system/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function createThemeObj(type: "dark" | "light", colors: ThemeColors): Theme {
136136
selectedTextColor: colors.base1,
137137

138138
separatorLine: colors.base4,
139-
skeletonBg: colors.base3,
139+
skeletonBg: colors.base4,
140140
success: colors.success,
141141
tertiaryBg: colors.base2,
142142

@@ -191,6 +191,7 @@ export const radius = {
191191
xl: "20px",
192192
xs: "4px",
193193
xxl: "32px",
194+
full: "9999px",
194195
};
195196

196197
export const iconSize = {

packages/thirdweb/src/react/web/ui/Bridge/StepRunner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ export function StepRunner({
374374
</Container>
375375

376376
<Spacer y="md" />
377-
<Text center color="secondaryText" size="xs">
377+
<Text center color="secondaryText" size="xs" multiline>
378378
Keep this window open until all
379379
<br /> transactions are complete.
380380
</Text>

packages/thirdweb/src/react/web/ui/Bridge/UnsupportedTokenScreen.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function UnsupportedTokenScreen(props: UnsupportedTokenScreenProps) {
6464
size="sm"
6565
style={{ lineHeight: 1.5, maxWidth: "280px" }}
6666
>
67-
The Universal Bridge does not support testnets at this time.
67+
Bridge does not support testnets at this time.
6868
</Text>
6969
</Container>
7070
);
@@ -94,7 +94,7 @@ export function UnsupportedTokenScreen(props: UnsupportedTokenScreenProps) {
9494
size="sm"
9595
style={{ lineHeight: 1.5, maxWidth: "280px" }}
9696
>
97-
This token or chain is not supported by the Universal Bridge.
97+
This token or chain is not supported by the Bridge
9898
</Text>
9999
</Container>
100100
);
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { MagnifyingGlassIcon } from "@radix-ui/react-icons";
2+
import { iconSize, spacing } from "../../../../core/design-system/index.js";
3+
import { Container } from "../../components/basic.js";
4+
import { Input } from "../../components/formElements.js";
5+
6+
export function SearchInput(props: {
7+
value: string;
8+
onChange: (value: string) => void;
9+
placeholder: string;
10+
}) {
11+
return (
12+
<div
13+
style={{
14+
position: "relative",
15+
}}
16+
>
17+
<Container color="secondaryText">
18+
<MagnifyingGlassIcon
19+
width={iconSize.md}
20+
height={iconSize.md}
21+
style={{
22+
position: "absolute",
23+
left: spacing.sm,
24+
top: "50%",
25+
transform: "translateY(-50%)",
26+
}}
27+
/>
28+
</Container>
29+
30+
<Input
31+
variant="outline"
32+
placeholder={props.placeholder}
33+
value={props.value}
34+
style={{
35+
paddingLeft: "44px",
36+
}}
37+
onChange={(e) => props.onChange(e.target.value)}
38+
/>
39+
</div>
40+
);
41+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { ChevronDownIcon } from "@radix-ui/react-icons";
2+
import type { BridgeChain } from "../../../../../bridge/types/Chain.js";
3+
import type { ThirdwebClient } from "../../../../../client/client.js";
4+
import {
5+
fontSize,
6+
iconSize,
7+
spacing,
8+
} from "../../../../core/design-system/index.js";
9+
import { Button } from "../../components/buttons.js";
10+
import { Img } from "../../components/Img.js";
11+
import { cleanedChainName } from "./utils.js";
12+
13+
export function SelectChainButton(props: {
14+
selectedChain: BridgeChain;
15+
client: ThirdwebClient;
16+
onClick: () => void;
17+
}) {
18+
return (
19+
<Button
20+
variant="secondary"
21+
fullWidth
22+
style={{
23+
justifyContent: "flex-start",
24+
fontWeight: 500,
25+
fontSize: fontSize.md,
26+
padding: `${spacing.sm} ${spacing.sm}`,
27+
minHeight: "48px",
28+
}}
29+
gap="sm"
30+
onClick={props.onClick}
31+
>
32+
<Img
33+
src={props.selectedChain.icon}
34+
client={props.client}
35+
width={iconSize.lg}
36+
height={iconSize.lg}
37+
/>
38+
<span> {cleanedChainName(props.selectedChain.name)} </span>
39+
40+
<ChevronDownIcon
41+
width={iconSize.sm}
42+
height={iconSize.sm}
43+
style={{ marginLeft: "auto" }}
44+
/>
45+
</Button>
46+
);
47+
}

0 commit comments

Comments
 (0)