File tree Expand file tree Collapse file tree 5 files changed +27
-1
lines changed
apps/playground-web/src/app/payments Expand file tree Collapse file tree 5 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ function Example() {
7171 <${ componentName }
7272 client={client}
7373 chain={defineChain(${ options . payOptions . buyTokenChain . id } )}
74- amount="${ options . payOptions . buyTokenAmount } "${ options . payOptions . buyTokenAddress ? `\n\t tokenAddress="${ options . payOptions . buyTokenAddress } "` : "" } ${ options . payOptions . sellerAddress ? `\n\t seller="${ options . payOptions . sellerAddress } "` : "" } ${ options . payOptions . title ? `\n\t ${ options . payOptions . widget === "checkout" ? "name" : "title" } ="${ options . payOptions . title } "` : "" } ${ options . payOptions . image ? `\n\t image="${ options . payOptions . image } "` : "" } ${ options . payOptions . description ? `\n\t description="${ options . payOptions . description } "` : "" } ${ options . payOptions . paymentMethods && options . payOptions . paymentMethods . length > 0 ? `\n\t paymentMethods={${ JSON . stringify ( options . payOptions . paymentMethods ) } }` : "" } ${ options . payOptions . currency ? `\n\t currency="${ options . payOptions . currency } "` : "" } ${
74+ amount="${ options . payOptions . buyTokenAmount } "${ options . payOptions . buyTokenAddress ? `\n\t tokenAddress="${ options . payOptions . buyTokenAddress } "` : "" } ${ options . payOptions . sellerAddress ? `\n\t seller="${ options . payOptions . sellerAddress } "` : "" } ${ options . payOptions . title ? `\n\t ${ options . payOptions . widget === "checkout" ? "name" : "title" } ="${ options . payOptions . title } "` : "" } ${ options . payOptions . image ? `\n\t image="${ options . payOptions . image } "` : "" } ${ options . payOptions . description ? `\n\t description="${ options . payOptions . description } "` : "" } ${ options . payOptions . buttonLabel ? `\n\t buttonLabel=" ${ options . payOptions . buttonLabel } "` : "" } ${ options . payOptions . paymentMethods && options . payOptions . paymentMethods . length > 0 ? `\n\t paymentMethods={${ JSON . stringify ( options . payOptions . paymentMethods ) } }` : "" } ${ options . payOptions . currency ? `\n\t currency="${ options . payOptions . currency } "` : "" } ${
7575 options . payOptions . widget === "transaction"
7676 ? `\n\t transaction={claimTo({
7777 contract: nftContract,
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ export type BridgeComponentsPlaygroundOptions = {
4141 title : string | undefined ;
4242 image : string | undefined ;
4343 description : string | undefined ;
44+ buttonLabel : string | undefined ;
4445
4546 buyTokenAddress ?: Address ;
4647 buyTokenAmount : string ;
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ export function LeftSection(props: {
7373 const modalTitleId = useId ( ) ;
7474 const modalTitleIconId = useId ( ) ;
7575 const modalDescriptionId = useId ( ) ;
76+ const buttonLabelId = useId ( ) ;
7677 const themeId = useId ( ) ;
7778 const cryptoPaymentId = useId ( ) ;
7879 const cardPaymentId = useId ( ) ;
@@ -486,6 +487,26 @@ export function LeftSection(props: {
486487 value = { options . payOptions . description }
487488 />
488489 </ div >
490+
491+ { /* Button Label */ }
492+ < div className = "flex flex-col gap-2" >
493+ < Label htmlFor = { buttonLabelId } > Button Label</ Label >
494+ < Input
495+ className = "bg-card"
496+ id = { buttonLabelId }
497+ onChange = { ( e ) =>
498+ setOptions ( ( v ) => ( {
499+ ...v ,
500+ payOptions : {
501+ ...payOptions ,
502+ buttonLabel : e . target . value ,
503+ } ,
504+ } ) )
505+ }
506+ placeholder = "Custom button text (optional)"
507+ value = { options . payOptions . buttonLabel }
508+ />
509+ </ div >
489510 </ div >
490511 </ CollapsibleSection >
491512
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ export function RightSection(props: {
6666 tokenAddress = { props . options . payOptions . buyTokenAddress }
6767 currency = { props . options . payOptions . currency }
6868 showThirdwebBranding = { props . options . payOptions . showThirdwebBranding }
69+ { ...( props . options . payOptions . buttonLabel && { buttonLabel : props . options . payOptions . buttonLabel } ) }
6970 />
7071 ) ;
7172 }
@@ -91,6 +92,7 @@ export function RightSection(props: {
9192 tokenAddress = { props . options . payOptions . buyTokenAddress }
9293 currency = { props . options . payOptions . currency }
9394 showThirdwebBranding = { props . options . payOptions . showThirdwebBranding }
95+ { ...( props . options . payOptions . buttonLabel && { buttonLabel : props . options . payOptions . buttonLabel } ) }
9496 />
9597 ) ;
9698 }
@@ -112,6 +114,7 @@ export function RightSection(props: {
112114 } ) }
113115 currency = { props . options . payOptions . currency }
114116 showThirdwebBranding = { props . options . payOptions . showThirdwebBranding }
117+ { ...( props . options . payOptions . buttonLabel && { buttonLabel : props . options . payOptions . buttonLabel } ) }
115118 />
116119 ) ;
117120 }
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const defaultConnectOptions: BridgeComponentsPlaygroundOptions = {
1313 buyTokenChain : arbitrum ,
1414 description : "" ,
1515 image : "" ,
16+ buttonLabel : "" ,
1617 paymentMethods : [ "crypto" , "card" ] ,
1718 sellerAddress : "0x0000000000000000000000000000000000000000" ,
1819 title : "" ,
You can’t perform that action at this time.
0 commit comments