Skip to content

Commit

Permalink
fix(plugins/ITO): if no token selected, info that with placeholder (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleBill authored Jun 6, 2021
1 parent c95dd33 commit 6bde5af
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/maskbook/src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
"plugin_wallet_transaction_rejected": "Transaction was rejected!",
"plugin_wallet_transaction_server_error": "Transaction was failed due to an internal JSON-RPC server error.",
"plugin_wallet_view_on_explorer": "View on Explorer",
"plugin_ito_placeholder_when_token_unselected": "Please Select a Token first",
"plugin_wallet_wrong_network_tip": "Please connect to an appropriate network.",
"plugin_wallet_recent_transaction": "Recent Transactions",
"plugin_wallet_clear_all": "Clear All",
Expand Down
1 change: 1 addition & 0 deletions packages/maskbook/src/_locales/ja/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
"plugin_wallet_transaction_rejected": "取引は拒否されました。",
"plugin_wallet_transaction_server_error": "取引は内部の JSON-RPC サーバーのエラーにより失敗しました。",
"plugin_wallet_view_on_explorer": "Explorer で見る",
"plugin_ito_placeholder_when_token_unselected": "",
"plugin_wallet_wrong_network_tip": "正しい Ethereum ネットワークを選択してください。",
"plugin_wallet_recent_transaction": "",
"plugin_wallet_clear_all": "",
Expand Down
1 change: 1 addition & 0 deletions packages/maskbook/src/_locales/ko/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
"plugin_wallet_transaction_rejected": "해당 거래는 이미 거부되었습니다.",
"plugin_wallet_transaction_server_error": "JSON-RPC 오류 때문에 거래가 실패했습니다.",
"plugin_wallet_view_on_explorer": "Explorer에서 보기",
"plugin_ito_placeholder_when_token_unselected": "",
"plugin_wallet_wrong_network_tip": "정확한 이더리움 네트워크를 연결하세요.",
"plugin_wallet_recent_transaction": "",
"plugin_wallet_clear_all": "",
Expand Down
1 change: 1 addition & 0 deletions packages/maskbook/src/_locales/zh/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
"plugin_wallet_transaction_rejected": "交易被拒絕!",
"plugin_wallet_transaction_server_error": "交易由於內部 JSON-RPC 伺服器錯誤而失敗。",
"plugin_wallet_view_on_explorer": "在區塊鏈瀏覽器上查看",
"plugin_ito_placeholder_when_token_unselected": "",
"plugin_wallet_wrong_network_tip": "請連接到適當的乙太坊網絡。",
"plugin_wallet_recent_transaction": "",
"plugin_wallet_clear_all": "",
Expand Down
4 changes: 3 additions & 1 deletion packages/maskbook/src/plugins/ITO/UI/ExchangeTokenPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AddIcon from '@material-ui/icons/AddOutlined'
import RemoveIcon from '@material-ui/icons/RemoveOutlined'
import { useCallback, useEffect, useState } from 'react'
import { v4 as uuid } from 'uuid'
import { useRemoteControlledDialog } from '../../../utils/hooks/useRemoteControlledDialog'
import { useI18N, useRemoteControlledDialog } from '../../../utils'
import type { TokenAmountPanelProps } from '../../../web3/UI/TokenAmountPanel'
import { TokenAmountPanel } from '../../../web3/UI/TokenAmountPanel'
import { SelectTokenDialogEvent, WalletMessages } from '../../Wallet/messages'
Expand Down Expand Up @@ -71,6 +71,7 @@ export function ExchangeTokenPanel(props: ExchangetokenPanelProps) {
onRemove,
onAdd,
} = props
const { t } = useI18N()

const classes = useStyles()

Expand Down Expand Up @@ -137,6 +138,7 @@ export function ExchangeTokenPanel(props: ExchangetokenPanelProps) {
}}
TextFieldProps={{
disabled: !exchangeToken,
placeholder: !exchangeToken ? t('plugin_ito_placeholder_when_token_unselected') : '0.0',
}}
{...props.TokenAmountPanelProps}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/maskbook/src/web3/UI/TokenAmountPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export function TokenAmountPanel(props: TokenAmountPanelProps) {
value={amount}
variant="outlined"
onChange={onChange}
placeholder="0.0"
InputProps={{
inputProps: {
autoComplete: 'off',
Expand All @@ -111,7 +112,6 @@ export function TokenAmountPanel(props: TokenAmountPanelProps) {
minLength: MIN_AMOUNT_LENGTH,
maxLength: MAX_AMOUNT_LENGTH,
pattern: '^[0-9]*[.,]?[0-9]*$',
placeholder: '0.0',
spellCheck: false,
className: classes.input,
},
Expand Down

0 comments on commit 6bde5af

Please sign in to comment.