-
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-389] Add smart contract info page"
- Loading branch information
Showing
51 changed files
with
1,857 additions
and
314 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
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
27 changes: 27 additions & 0 deletions
27
user-dashboard/src/app/assets/src/components/DescriptionList/Description.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,27 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import classNames from 'classnames'; | ||
import { Col } from 'antd'; | ||
import styles from './index.less'; | ||
import responsive from './responsive'; | ||
|
||
const Description = ({ term, column, className, children, ...restProps }) => { | ||
const clsString = classNames(styles.description, className); | ||
return ( | ||
<Col className={clsString} {...responsive[column]} {...restProps}> | ||
{term && <div className={styles.term}>{term}</div>} | ||
{children !== null && children !== undefined && | ||
<div className={styles.detail}>{children}</div>} | ||
</Col> | ||
); | ||
}; | ||
|
||
Description.defaultProps = { | ||
term: '', | ||
}; | ||
|
||
Description.propTypes = { | ||
term: PropTypes.node, | ||
}; | ||
|
||
export default Description; |
31 changes: 31 additions & 0 deletions
31
user-dashboard/src/app/assets/src/components/DescriptionList/DescriptionList.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,31 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
import { Row } from 'antd'; | ||
import styles from './index.less'; | ||
|
||
const DescriptionList = ({ | ||
className, | ||
title, | ||
col = 3, | ||
layout = 'horizontal', | ||
gutter = 32, | ||
children, | ||
size, | ||
...restProps | ||
}) => { | ||
const clsString = classNames(styles.descriptionList, styles[layout], className, { | ||
[styles.small]: size === 'small', | ||
[styles.large]: size === 'large', | ||
}); | ||
const column = col > 4 ? 4 : col; | ||
return ( | ||
<div className={clsString} {...restProps}> | ||
{title ? <div className={styles.title}>{title}</div> : null} | ||
<Row gutter={gutter}> | ||
{React.Children.map(children, child => child ? React.cloneElement(child, { column }) : child)} | ||
</Row> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DescriptionList; |
5 changes: 5 additions & 0 deletions
5
user-dashboard/src/app/assets/src/components/DescriptionList/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,5 @@ | ||
import DescriptionList from './DescriptionList'; | ||
import Description from './Description'; | ||
|
||
DescriptionList.Description = Description; | ||
export default DescriptionList; |
77 changes: 77 additions & 0 deletions
77
user-dashboard/src/app/assets/src/components/DescriptionList/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,77 @@ | ||
@import '~antd/lib/style/themes/default.less'; | ||
|
||
.descriptionList { | ||
// offset the padding-bottom of last row | ||
:global { | ||
.ant-row { | ||
margin-bottom: -16px; | ||
overflow: hidden; | ||
} | ||
} | ||
|
||
.title { | ||
font-size: 14px; | ||
color: @heading-color; | ||
font-weight: 500; | ||
margin-bottom: 16px; | ||
} | ||
|
||
.term { | ||
// Line-height is 22px IE dom height will calculate error | ||
line-height: 20px; | ||
padding-bottom: 16px; | ||
margin-right: 8px; | ||
color: @heading-color; | ||
white-space: nowrap; | ||
display: table-cell; | ||
|
||
&:after { | ||
content: ':'; | ||
margin: 0 8px 0 2px; | ||
position: relative; | ||
top: -0.5px; | ||
} | ||
} | ||
|
||
.detail { | ||
line-height: 22px; | ||
width: 100%; | ||
padding-bottom: 16px; | ||
color: @text-color; | ||
display: table-cell; | ||
} | ||
|
||
&.small { | ||
// offset the padding-bottom of last row | ||
:global { | ||
.ant-row { | ||
margin-bottom: -8px; | ||
} | ||
} | ||
.title { | ||
margin-bottom: 12px; | ||
color: @text-color; | ||
} | ||
.term, | ||
.detail { | ||
padding-bottom: 8px; | ||
} | ||
} | ||
|
||
&.large { | ||
.title { | ||
font-size: 16px; | ||
} | ||
} | ||
|
||
&.vertical { | ||
.term { | ||
padding-bottom: 8px; | ||
display: block; | ||
} | ||
|
||
.detail { | ||
display: block; | ||
} | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
user-dashboard/src/app/assets/src/components/DescriptionList/responsive.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,6 @@ | ||
export default { | ||
1: { xs: 24 }, | ||
2: { xs: 24, sm: 12 }, | ||
3: { xs: 24, sm: 12, md: 8 }, | ||
4: { xs: 24, sm: 12, md: 6 }, | ||
}; |
Oops, something went wrong.