dashboard of Bytom
Revision | b058557016fb731065c6d0b3261b8fd4135a61d1 (tree) |
---|---|
Time | 2019-12-19 11:19:53 |
Author | Zhiting Lin <zlin035@uott...> |
Commiter | Zhiting Lin |
Revert "update tripple tags"
This reverts commit dfa21b5a76cc6e274ec5b9edd5e0995327c4d04c.
@@ -13,9 +13,6 @@ class Navigation extends React.Component { | ||
13 | 13 | super(props) |
14 | 14 | |
15 | 15 | this.openTutorial = this.openTutorial.bind(this) |
16 | - this.state={ | |
17 | - transaction:0 | |
18 | - } | |
19 | 16 | } |
20 | 17 | |
21 | 18 | openTutorial(event) { |
@@ -35,35 +32,10 @@ class Navigation extends React.Component { | ||
35 | 32 | </div>} |
36 | 33 | <ul className={styles.navigation}> |
37 | 34 | <li className={styles.navigationTitle}>{t('crumbName.coreData')}</li> |
38 | - <li > | |
39 | - <Link to='/transactions' | |
40 | - onClick={() =>{this.setState({transaction:0})}} | |
41 | - activeClassName={this.state.transaction ==0 && styles.active}> | |
42 | - {navIcon('transaction', styles)} | |
43 | - {capitalize(t('crumbName.transaction'))} | |
44 | - </Link> | |
45 | - </li> | |
46 | 35 | <li> |
47 | - <Link to={{ | |
48 | - pathname: '/transactions', | |
49 | - state: { title: '"营业执照" 存证'} | |
50 | - }} | |
51 | - onClick={() =>{this.setState({transaction:1})}} | |
52 | - activeClassName={this.state.transaction ==1 && styles.active} | |
53 | - > | |
36 | + <Link to='/transactions' activeClassName={styles.active}> | |
54 | 37 | {navIcon('transaction', styles)} |
55 | - {'"营业执照" 存证'} | |
56 | - </Link> | |
57 | - </li> | |
58 | - <li> | |
59 | - <Link activeClassName={this.state.transaction ==2 && styles.active} to={{ | |
60 | - pathname: '/transactions', | |
61 | - state: { title: '"不动产证明" 存证' } | |
62 | - }} | |
63 | - onClick={() =>{this.setState({transaction:2})}} | |
64 | - > | |
65 | - {navIcon('transaction', styles)} | |
66 | - {'"不动产证明" 存证'} | |
38 | + {capitalize(t('crumbName.transaction'))} | |
67 | 39 | </Link> |
68 | 40 | </li> |
69 | 41 | <li> |
@@ -1,4 +1,3 @@ | ||
1 | - | |
2 | 1 | .border { |
3 | 2 | padding-top: $gutter-size; |
4 | 3 | border-top: 1px solid $border-inverse-color; |
@@ -10,14 +10,7 @@ export default function(type, options = {}) { | ||
10 | 10 | const created = (param) => ({ type: `CREATED_${type.toUpperCase()}`, param }) |
11 | 11 | |
12 | 12 | return { |
13 | - showCreate: (title) => | |
14 | - title? push({ | |
15 | - pathname: createPath, | |
16 | - state: { | |
17 | - title | |
18 | - } | |
19 | - }) | |
20 | - :push(createPath), | |
13 | + showCreate: push(createPath), | |
21 | 14 | created, |
22 | 15 | submitForm: (data) => { |
23 | 16 | const clientApi = options.clientApi ? options.clientApi() : chainClient()[`${type}s`] |
@@ -17,9 +17,9 @@ class ItemList extends React.Component { | ||
17 | 17 | const t = this.props.t |
18 | 18 | |
19 | 19 | const objectName = humanize(t(`crumbName.${type.toLowerCase()}` )) |
20 | - const title = this.props.title || capitalize(t(`crumbName.${type.toLowerCase()}` ) || label) | |
20 | + const title = capitalize(t(`crumbName.${type.toLowerCase()}` ) || label) | |
21 | 21 | |
22 | - const newButton = <button key='showCreate' className='btn btn-primary' onClick={() =>this.props.showCreate(this.props.title)}> | |
22 | + const newButton = <button key='showCreate' className='btn btn-primary' onClick={this.props.showCreate}> | |
23 | 23 | + { this.props.createLabel || t('crumbName.new')} |
24 | 24 | </button> |
25 | 25 | if (!this.props.skipCreate) { |
@@ -64,7 +64,6 @@ class ItemList extends React.Component { | ||
64 | 64 | <this.props.listItemComponent |
65 | 65 | key={item.id} |
66 | 66 | item={item} |
67 | - title={this.props.title} | |
68 | 67 | btmAmountUnit={this.props.btmAmountUnit} |
69 | 68 | {...this.props.itemActions}/>) |
70 | 69 |
@@ -137,7 +136,7 @@ export const mapStateToProps = (type, itemComponent, additionalProps = {}) => (s | ||
137 | 136 | export const mapDispatchToProps = (type) => (dispatch) => { |
138 | 137 | return { |
139 | 138 | pushList: (query, pageNumber) => dispatch(actions[type].pushList(query, pageNumber)), |
140 | - showCreate: (title) => dispatch(actions[type].showCreate(title)), | |
139 | + showCreate: () => dispatch(actions[type].showCreate), | |
141 | 140 | } |
142 | 141 | } |
143 | 142 |
@@ -22,10 +22,7 @@ class PageTitle extends React.Component { | ||
22 | 22 | <ul className={styles.crumbs}> |
23 | 23 | {this.props.breadcrumbs.map(crumb => |
24 | 24 | <li className={styles.crumb} key={crumb.name}> |
25 | - {!crumb.last && <Link to={{ | |
26 | - pathname: '/' + crumb.path, | |
27 | - state: { title: this.props.changedTitle } | |
28 | - }}> | |
25 | + {!crumb.last && <Link to={'/' + crumb.path}> | |
29 | 26 | {capitalize(crumb.name)} |
30 | 27 | <img src={chevron} className={styles.chevron} /> |
31 | 28 | </Link>} |
@@ -61,8 +58,6 @@ const mapStateToProps = (state, ownProps) => { | ||
61 | 58 | const pathname = state.routing.locationBeforeTransitions.pathname |
62 | 59 | const breadcrumbs = [] |
63 | 60 | |
64 | - const title = state.routing.locationBeforeTransitions.state && state.routing.locationBeforeTransitions.state.title | |
65 | - | |
66 | 61 | let currentRoutes = routes.childRoutes |
67 | 62 | let currentPath = [] |
68 | 63 | pathname.split('/').forEach(component => { |
@@ -85,11 +80,7 @@ const mapStateToProps = (state, ownProps) => { | ||
85 | 80 | |
86 | 81 | breadcrumbs[breadcrumbs.length - 1].last = true |
87 | 82 | |
88 | - if(title){ | |
89 | - breadcrumbs[0].name = title | |
90 | - } | |
91 | 83 | return { |
92 | - changedTitle: title, | |
93 | 84 | breadcrumbs, |
94 | 85 | flashMessages: state.app.flashMessages, |
95 | 86 | } |
@@ -15,9 +15,8 @@ class List extends React.Component { | ||
15 | 15 | } |
16 | 16 | } |
17 | 17 | render() { |
18 | - const title = this.props.location.state && this.props.location.state.title | |
19 | 18 | const ItemList = BaseList.ItemList |
20 | - return (<ItemList title={ title} { ...this.props} />) | |
19 | + return (<ItemList {...this.props} />) | |
21 | 20 | } |
22 | 21 | } |
23 | 22 |
@@ -54,12 +54,7 @@ class ListItem extends React.Component { | ||
54 | 54 | <RelativeTime timestamp={item.timestamp} /> |
55 | 55 | </span>} |
56 | 56 | |
57 | - <Link className={styles.viewLink} | |
58 | - to={{ | |
59 | - pathname: `/transactions/${item.id}`, | |
60 | - state: { title: this.props.title} | |
61 | - }} | |
62 | - > | |
57 | + <Link className={styles.viewLink} to={`/transactions/${item.id}`}> | |
63 | 58 | {t('commonWords.viewDetails')} |
64 | 59 | </Link> |
65 | 60 | </div> |