@@ -517,6 +517,11 @@ function BuyScreenContent(props: BuyScreenContentProps) {
517517 screen . id === "buy-with-fiat" ) &&
518518 payer && (
519519 < TokenSelectedLayout
520+ disabled = {
521+ ( "prefillBuy" in payOptions &&
522+ payOptions . prefillBuy ?. allowEdits ?. amount === false ) ||
523+ payOptions . mode !== "fund_wallet"
524+ }
520525 title = { props . title }
521526 selectedChain = { toChain }
522527 selectedToken = { toToken }
@@ -651,6 +656,7 @@ function SelectedTokenInfo(props: {
651656 tokenAmount : string ;
652657 setTokenAmount : ( amount : string ) => void ;
653658 client : ThirdwebClient ;
659+ disabled ?: boolean ;
654660} ) {
655661 const getWidth = ( ) => {
656662 let chars = props . tokenAmount . replace ( "." , "" ) . length ;
@@ -680,7 +686,7 @@ function SelectedTokenInfo(props: {
680686 type = "text"
681687 data-placeholder = { props . tokenAmount === "" }
682688 value = { props . tokenAmount || "0" }
683- disabled = { false } // TODO: add disabled freeze amount
689+ disabled = { props . disabled }
684690 onClick = { ( e ) => {
685691 // put cursor at the end of the input
686692 if ( props . tokenAmount === "" ) {
@@ -865,8 +871,13 @@ function MainScreen(props: {
865871 } }
866872 freezeAmount = { payOptions . prefillBuy ?. allowEdits ?. amount === false }
867873 freezeChainAndToken = {
868- payOptions . prefillBuy ?. allowEdits ?. chain === false &&
869- payOptions . prefillBuy ?. allowEdits ?. token === false
874+ ( payOptions . prefillBuy ?. allowEdits ?. chain === false &&
875+ payOptions . prefillBuy ?. allowEdits ?. token === false ) ||
876+ ( payOptions . buyWithCrypto !== false &&
877+ payOptions . buyWithCrypto ?. prefillSource ?. allowEdits ?. token ===
878+ false &&
879+ payOptions . buyWithCrypto ?. prefillSource ?. allowEdits ?. chain ===
880+ false )
870881 }
871882 token = { toToken }
872883 chain = { toChain }
@@ -924,6 +935,7 @@ function TokenSelectedLayout(props: {
924935 selectedChain : Chain ;
925936 client : ThirdwebClient ;
926937 onBack : ( ) => void ;
938+ disabled ?: boolean ;
927939} ) {
928940 return (
929941 < Container >
@@ -944,6 +956,7 @@ function TokenSelectedLayout(props: {
944956 tokenAmount = { props . tokenAmount }
945957 setTokenAmount = { props . setTokenAmount }
946958 client = { props . client }
959+ disabled = { props . disabled }
947960 />
948961
949962 < Spacer y = "md" />
0 commit comments