mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
Use class to add overflow ellipsis instead of directly styling component
This commit is contained in:
parent
6419a4e8e0
commit
d817b920b4
@ -35,27 +35,20 @@ const DetailProperty = React.createClass({
|
||||
const {
|
||||
children,
|
||||
className,
|
||||
ellipsis,
|
||||
label,
|
||||
labelClassName,
|
||||
separator,
|
||||
valueClassName,
|
||||
value } = this.props;
|
||||
|
||||
const styles = this.props.ellipsis ? {
|
||||
whiteSpace: 'nowrap',
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis'
|
||||
} : null;
|
||||
|
||||
return (
|
||||
<div className={classNames('row ascribe-detail-property', className)}>
|
||||
<div className="row-same-height">
|
||||
<div className={labelClassName}>
|
||||
{label} {separator}
|
||||
</div>
|
||||
<div
|
||||
className={valueClassName}
|
||||
style={styles}>
|
||||
<div className={classNames(valueClassName, {'add-overflow-ellipsis': ellipsis})}>
|
||||
{children || value}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -108,6 +108,12 @@ hr {
|
||||
color: $ascribe-dark-blue;
|
||||
}
|
||||
|
||||
.add-overflow-ellipsis {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.ascribe-subheader {
|
||||
padding-bottom: 10px;
|
||||
margin-top: -10px;
|
||||
|
Loading…
Reference in New Issue
Block a user