-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "[CE-396] Add chain info page"
- Loading branch information
Showing
20 changed files
with
1,151 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
user-dashboard/src/app/assets/src/components/EditableLinkGroup/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React, { PureComponent, createElement } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Button } from 'antd'; | ||
import styles from './index.less'; | ||
|
||
// TODO: 添加逻辑 | ||
|
||
class EditableLinkGroup extends PureComponent { | ||
static propTypes = { | ||
links: PropTypes.array, | ||
onAdd: PropTypes.func, | ||
linkElement: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), | ||
}; | ||
|
||
static defaultProps = { | ||
links: [], | ||
onAdd: () => {}, | ||
linkElement: 'a', | ||
}; | ||
render() { | ||
const { links, linkElement, onAdd } = this.props; | ||
return ( | ||
<div className={styles.linkGroup}> | ||
{links.map(link => | ||
createElement( | ||
linkElement, | ||
{ | ||
key: `linkGroup-item-${link.id || link.title}`, | ||
to: link.href, | ||
href: link.href, | ||
}, | ||
link.title | ||
) | ||
)} | ||
{ | ||
<Button size="small" type="primary" ghost onClick={onAdd} icon="plus"> | ||
添加 | ||
</Button> | ||
} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default EditableLinkGroup; |
16 changes: 16 additions & 0 deletions
16
user-dashboard/src/app/assets/src/components/EditableLinkGroup/index.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@import '~antd/lib/style/themes/default.less'; | ||
|
||
.linkGroup { | ||
padding: 20px 0 8px 24px; | ||
font-size: 0; | ||
& > a { | ||
color: @text-color; | ||
display: inline-block; | ||
font-size: @font-size-base; | ||
margin-bottom: 13px; | ||
width: 25%; | ||
&:hover { | ||
color: @primary-color; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.