@@ -517,6 +517,11 @@ function BuyScreenContent(props: BuyScreenContentProps) {
517
517
screen . id === "buy-with-fiat" ) &&
518
518
payer && (
519
519
< TokenSelectedLayout
520
+ disabled = {
521
+ ( "prefillBuy" in payOptions &&
522
+ payOptions . prefillBuy ?. allowEdits ?. amount === false ) ||
523
+ payOptions . mode !== "fund_wallet"
524
+ }
520
525
title = { props . title }
521
526
selectedChain = { toChain }
522
527
selectedToken = { toToken }
@@ -651,6 +656,7 @@ function SelectedTokenInfo(props: {
651
656
tokenAmount : string ;
652
657
setTokenAmount : ( amount : string ) => void ;
653
658
client : ThirdwebClient ;
659
+ disabled ?: boolean ;
654
660
} ) {
655
661
const getWidth = ( ) => {
656
662
let chars = props . tokenAmount . replace ( "." , "" ) . length ;
@@ -680,7 +686,7 @@ function SelectedTokenInfo(props: {
680
686
type = "text"
681
687
data-placeholder = { props . tokenAmount === "" }
682
688
value = { props . tokenAmount || "0" }
683
- disabled = { false } // TODO: add disabled freeze amount
689
+ disabled = { props . disabled }
684
690
onClick = { ( e ) => {
685
691
// put cursor at the end of the input
686
692
if ( props . tokenAmount === "" ) {
@@ -865,8 +871,13 @@ function MainScreen(props: {
865
871
} }
866
872
freezeAmount = { payOptions . prefillBuy ?. allowEdits ?. amount === false }
867
873
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 )
870
881
}
871
882
token = { toToken }
872
883
chain = { toChain }
@@ -924,6 +935,7 @@ function TokenSelectedLayout(props: {
924
935
selectedChain : Chain ;
925
936
client : ThirdwebClient ;
926
937
onBack : ( ) => void ;
938
+ disabled ?: boolean ;
927
939
} ) {
928
940
return (
929
941
< Container >
@@ -944,6 +956,7 @@ function TokenSelectedLayout(props: {
944
956
tokenAmount = { props . tokenAmount }
945
957
setTokenAmount = { props . setTokenAmount }
946
958
client = { props . client }
959
+ disabled = { props . disabled }
947
960
/>
948
961
949
962
< Spacer y = "md" />
0 commit comments