Remove tx Destination default values.

This commit is contained in:
muzam1l
2023-03-23 19:39:56 +05:30
parent 6d1ef110b7
commit 9ecf5478e6
2 changed files with 14 additions and 11 deletions

View File

@@ -19,7 +19,7 @@ import Textarea from '../Textarea'
import { getFlags } from '../../state/constants/flags'
import { Plus, Trash } from 'phosphor-react'
import AccountSequence from '../Sequence'
import { typeIs } from '../../utils/helpers'
import { capitalize, typeIs } from '../../utils/helpers'
interface UIProps {
setState: (pTx?: Partial<TransactionState> | undefined) => TransactionState | undefined
@@ -266,7 +266,8 @@ export const TxUI: FC<UIProps> = ({
<CreatableAccount
value={tokenAmount.issuer}
field={'Issuer' as any}
setField={(_, value = "") => {
placeholder="Issuer"
setField={(_, value = '') => {
setRawField(field, 'amount.token', {
...tokenAmount,
issuer: value
@@ -529,8 +530,9 @@ export const TxUI: FC<UIProps> = ({
export const CreatableAccount: FC<{
value: string | undefined
field: keyof TxFields
placeholder?: string
setField: (field: keyof TxFields, value: string, opFields?: TxFields) => void
}> = ({ value, field, setField }) => {
}> = ({ value, field, setField, placeholder }) => {
const { accounts } = useSnapshot(state)
const accountOptions: SelectOption[] = accounts.map(acc => ({
label: acc.name,
@@ -541,11 +543,12 @@ export const CreatableAccount: FC<{
value,
label
}
placeholder = placeholder || `${capitalize(field)} account`
return (
<CreatableSelect
isClearable
instanceId={field}
placeholder={field}
placeholder={placeholder}
options={accountOptions}
value={value ? val : undefined}
onChange={(acc: any) => setField(field, acc?.value)}

View File

@@ -4,7 +4,7 @@
"Account": "rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm",
"Destination": {
"$type": "account",
"$value": "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe"
"$value": ""
},
"DestinationTag": 13,
"Fee": "2000000",
@@ -45,7 +45,7 @@
"Account": "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
"Destination": {
"$type": "account",
"$value": "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy"
"$value": ""
},
"SendMax": "100000000",
"Expiration": 570113521,
@@ -66,7 +66,7 @@
"TransactionType": "EscrowCancel",
"Owner": {
"$type": "account",
"$value": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
"$value": ""
},
"OfferSequence": 7,
"Fee": "10"
@@ -80,7 +80,7 @@
},
"Destination": {
"$type": "account",
"$value": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW"
"$value": ""
},
"CancelAfter": 533257958,
"FinishAfter": 533171558,
@@ -94,7 +94,7 @@
"TransactionType": "EscrowFinish",
"Owner": {
"$type": "account",
"$value": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
"$value": ""
},
"OfferSequence": 7,
"Condition": "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100",
@@ -186,7 +186,7 @@
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Destination": {
"$type": "account",
"$value": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX"
"$value": ""
},
"Amount": {
"$value": "100",
@@ -205,7 +205,7 @@
},
"Destination": {
"$type": "account",
"$value": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW"
"$value": ""
},
"SettleDelay": 86400,
"PublicKey": "32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A",