Skip to content

Commit

Permalink
feat: enums SendType
Browse files Browse the repository at this point in the history
  • Loading branch information
devchenyan committed Jul 14, 2023
1 parent 6b8c697 commit 3b80c0c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
10 changes: 1 addition & 9 deletions packages/neuron-ui/src/components/SUDTSend/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@ import { DEFAULT_SUDT_FIELDS } from 'utils/const'
import { generateChequeTransaction, generateSUDTTransaction, getHoldSUDTCellCapacity } from 'services/remote'
import { AppActions, useDispatch } from 'states'
import { ControllerResponse } from 'services/remote/remoteApiWrapper'

export enum SendType {
secp256Cheque = 'cheque',
secp256NewCell = 'secp256NewCell',
acpExistCell = 'acpExistCell',
acpNewCell = 'acpNewCell',
unknowNewCell = 'unknowNewCell',
sendCKB = 'sendCKB',
}
import { SendType } from 'utils/enums'

export enum AddressLockType {
secp256 = 'secp256',
Expand Down
11 changes: 2 additions & 9 deletions packages/neuron-ui/src/components/SUDTSend/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,10 @@ import {
validateAmountRange,
CONSTANTS,
} from 'utils'
import { SendType } from 'utils/enums'
import { AmountNotEnoughException, isErrorWithI18n } from 'exceptions'
import { getDisplayName, getDisplaySymbol } from 'components/UANDisplay'
import {
AddressLockType,
SendType,
getGenerator,
useAddressLockType,
useOnSubmit,
useOptions,
useSendType,
} from './hooks'
import { AddressLockType, getGenerator, useAddressLockType, useOnSubmit, useOptions, useSendType } from './hooks'
import styles from './sUDTSend.module.scss'

const { INIT_SEND_PRICE, DEFAULT_SUDT_FIELDS, HIDE_BALANCE } = CONSTANTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@

.sendItem {
& > div {
width: 228px;
input {
width: 125px !important;
height: 56px !important;
Expand Down
9 changes: 9 additions & 0 deletions packages/neuron-ui/src/utils/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,12 @@ export enum AccountType {
CKB,
SUDT,
}

export enum SendType {
secp256Cheque = 'cheque',
secp256NewCell = 'secp256NewCell',
acpExistCell = 'acpExistCell',
acpNewCell = 'acpNewCell',
unknowNewCell = 'unknowNewCell',
sendCKB = 'sendCKB',
}

0 comments on commit 3b80c0c

Please sign in to comment.