File tree Expand file tree Collapse file tree 4 files changed +30
-1
lines changed
react/web/ui/Bridge/swap-widget Expand file tree Collapse file tree 4 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
1212 iconSize ,
1313 radius ,
1414 spacing ,
15+ type Theme ,
1516} from "../../../../core/design-system/index.js" ;
1617import { ConnectButton } from "../../ConnectWallet/ConnectButton.js" ;
1718import { formatTokenAmount } from "../../ConnectWallet/screens/formatTokenBalance.js" ;
@@ -46,6 +47,7 @@ function getDefaultSelectedChain(
4647export function SelectSellToken (
4748 props : SelectSellTokenProps & {
4849 activeWalletInfo : ActiveWalletInfo | undefined ;
50+ theme : Theme | "light" | "dark" ;
4951 } ,
5052) {
5153 if ( props . activeWalletInfo ) {
@@ -60,13 +62,15 @@ export function SelectSellToken(
6062 < SelectSellTokenDisconnectedUI
6163 onBack = { props . onBack }
6264 client = { props . client }
65+ theme = { props . theme }
6366 />
6467 ) ;
6568}
6669
6770export function SelectSellTokenDisconnectedUI ( props : {
6871 onBack : ( ) => void ;
6972 client : ThirdwebClient ;
73+ theme : Theme | "light" | "dark" ;
7074} ) {
7175 return (
7276 < Container >
@@ -111,6 +115,7 @@ export function SelectSellTokenDisconnectedUI(props: {
111115 < ConnectButton
112116 client = { props . client }
113117 connectButton = { { style : { width : "100%" } , label : "Connect Wallet" } }
118+ theme = { props . theme }
114119 />
115120 </ Container >
116121 </ Container >
Original file line number Diff line number Diff line change @@ -184,6 +184,7 @@ export function SwapUI(props: SwapUIProps) {
184184 onBack = { ( ) => setScreen ( "base" ) }
185185 client = { props . client }
186186 selectedToken = { sellToken }
187+ theme = { props . theme }
187188 setSelectedToken = { ( token ) => {
188189 setSellToken ( token ) ;
189190 setScreen ( "base" ) ;
Original file line number Diff line number Diff line change @@ -72,7 +72,11 @@ export function ChainLoading() {
7272export function Disconnected ( ) {
7373 return (
7474 < SwapWidgetContainer theme = "dark" className = "w-full" >
75- < SelectSellTokenDisconnectedUI client = { storyClient } onBack = { ( ) => { } } />
75+ < SelectSellTokenDisconnectedUI
76+ client = { storyClient }
77+ onBack = { ( ) => { } }
78+ theme = "dark"
79+ />
7680 </ SwapWidgetContainer >
7781 ) ;
7882}
Original file line number Diff line number Diff line change 11import type { Meta } from "@storybook/react-vite" ;
2+ import { lightTheme } from "../../../react/core/design-system/index.js" ;
23import { SwapWidget } from "../../../react/web/ui/Bridge/swap-widget/SwapWidget.js" ;
34import { storyClient } from "../../utils.js" ;
45
@@ -21,3 +22,21 @@ export function CurrencySet() {
2122export function LightMode ( ) {
2223 return < SwapWidget client = { storyClient } currency = "JPY" theme = "light" /> ;
2324}
25+
26+ export function CustomTheme ( ) {
27+ return (
28+ < SwapWidget
29+ client = { storyClient }
30+ currency = "JPY"
31+ theme = { lightTheme ( {
32+ colors : {
33+ modalBg : "#FFFFF0" ,
34+ tertiaryBg : "#DBE4C9" ,
35+ borderColor : "#8AA624" ,
36+ secondaryText : "#3E3F29" ,
37+ accentText : "#E43636" ,
38+ } ,
39+ } ) }
40+ />
41+ ) ;
42+ }
You can’t perform that action at this time.
0 commit comments