beginEditing: this.props.beginEditing,
delete: this.props.delete,
}
- const tokenList = <TableList titles={['Token Name', 'Token']}>
- {(this.props.tokens).map(item => <GrantListItem key={item.id} item={item} {...itemProps} />)}
- </TableList>
const lang = this.props.lang
+ const tokenList = <TableList titles={ lang==='zh'? ['令牌名称', '令牌']: ['Token Name', 'Token']}>
+ {(this.props.tokens).map(item => <GrantListItem key={item.id} item={item} lang={lang} {...itemProps} />)}
+ </TableList>
// const certList = <TableList titles={['Certificate', 'Policies']}>
// {this.props.certs.map(item => <GrantListItem key={item.id} item={item} {...itemProps} />)}
class GrantListItem extends React.Component {
render() {
const item = this.props.item
+ const lang = this.props.lang
// let desc
// if (isAccessToken(item)) {
{/*</button>*/}
<button className='btn btn-link' onClick={this.props.delete.bind(this, item)}>
- Delete
+ { lang==='zh'? '删除' : 'Delete' }
</button>
</td>}
{/*{item.isEditing && <td colSpan='2'>*/}
import { BaseList, TableList } from 'features/shared/components'
+
import ListItem from './ListItem'
const type = 'account'
+const mapStateToProps = (state) => {
+ let titles
+ if(state.core.lang === 'zh'){
+ titles = ['账户别名','账户ID']
+ }else{
+ titles = ['Account Alias', 'Account ID']
+ }
+
+ return {
+ ...BaseList.mapStateToProps(type, ListItem, {
+ wrapperComponent: TableList,
+ wrapperProps: {
+ titles: titles
+ }
+ })(state)
+ }
+}
export default BaseList.connect(
- BaseList.mapStateToProps(type, ListItem, {
- wrapperComponent: TableList,
- wrapperProps: {
- titles: ['Account Alias', 'Account ID']
- }
- }),
+ mapStateToProps,
BaseList.mapDispatchToProps(type)
)
const type = 'asset'
+const mapStateToProps = (state) => {
+ let titles
+ if(state.core.lang === 'zh'){
+ titles = ['资产别名','资产ID']
+ }else{
+ titles = ['Asset Alias', 'Asset ID']
+ }
+
+ return {
+ ...BaseList.mapStateToProps(type, ListItem, {
+ wrapperComponent: TableList,
+ wrapperProps: {
+ titles: titles
+ }
+ })(state)
+ }
+}
+
export default BaseList.connect(
- BaseList.mapStateToProps(type, ListItem, {
- wrapperComponent: TableList,
- wrapperProps: {
- titles: ['Asset Alias', 'Asset ID']
- }
- }),
+ mapStateToProps,
BaseList.mapDispatchToProps(type)
)
}
}
+const mapStateToProps = (state) => {
+ let titles
+ if(state.core.lang === 'zh'){
+ titles = ['别名','扩展公钥']
+ }else{
+ titles = ['Alias', 'xpub']
+ }
+
+ return {
+ ...BaseList.mapStateToProps(type, ListItem, {
+ skipQuery: true,
+ label: 'Keys',
+ wrapperComponent: TableList,
+ wrapperProps: {
+ titles: titles
+ }
+ })(state)
+ }
+}
+
export default BaseList.connect(
- BaseList.mapStateToProps(type, ListItem, {
- skipQuery: true,
- label: 'Keys',
- wrapperComponent: TableList,
- wrapperProps: {
- titles: ['Alias', 'xpub']
- }
- }),
+ mapStateToProps,
BaseList.mapDispatchToProps(type),
KeyList
)