ReadOnly mode display tweaks

This commit is contained in:
Rainer Simon 2020-05-29 18:54:47 +02:00
parent 3f4e6a85ec
commit ef3e467963
4 changed files with 34 additions and 29 deletions

View File

@ -27,12 +27,20 @@ const Comment = props => {
props.onUpdate(props.body, { ...props.body, value: evt.target.value }); props.onUpdate(props.body, { ...props.body, value: evt.target.value });
} }
const creatorInfo = props.body.creator &&
<div className="lastmodified">
<span className="lastmodified-by">{props.body.creator.name}</span>
{ props.body.created &&
<span className="lastmodified-at">
<TimeAgo datetime={Environment.toClientTime(props.body.created)} />
</span>
}
</div>
return props.readOnly ? ( return props.readOnly ? (
<div className="r6o-widget comment"> <div className="r6o-widget comment">
<div className="value">{props.body.value}</div> <div className="value">{props.body.value}</div>
<div className="lastmodified"> { creatorInfo }
<div className="lastmodified-by">{props.body.creator?.name}</div>
</div>
</div> </div>
) : ( ) : (
<div className={ isEditable ? "r6o-widget comment editable" : "r6o-widget comment"}> <div className={ isEditable ? "r6o-widget comment editable" : "r6o-widget comment"}>
@ -43,16 +51,7 @@ const Comment = props => {
onSaveAndClose={props.onSaveAndClose} onSaveAndClose={props.onSaveAndClose}
/> />
{ props.body.creator && { creatorInfo }
<div className="lastmodified">
<span className="lastmodified-by">{props.body.creator.name}</span>
{ props.body.created &&
<span className="lastmodified-at">
<TimeAgo datetime={Environment.toClientTime(props.body.created)} />
</span>
}
</div>
}
<div <div
className={isMenuVisible ? "icon arrow-down menu-open" : "icon arrow-down"} className={isMenuVisible ? "icon arrow-down menu-open" : "icon arrow-down"}

View File

@ -35,23 +35,25 @@ const TagWidget = props => {
return ( return (
<div className="tags"> <div className="tags">
<ul> { tagBodies.length > 0 &&
{ tagBodies.map(tag => <ul>
<li key={tag.value} onClick={toggle(tag.value)}> { tagBodies.map(tag =>
<span className="label">{tag.value}</span> <li key={tag.value} onClick={toggle(tag.value)}>
<span className="label">{tag.value}</span>
{!props.readOnly && {!props.readOnly &&
<CSSTransition in={showDelete === tag.value} timeout={200} classNames="delete"> <CSSTransition in={showDelete === tag.value} timeout={200} classNames="delete">
<span className="delete-wrapper" onClick={onDelete(tag)}> <span className="delete-wrapper" onClick={onDelete(tag)}>
<span className="delete"> <span className="delete">
<CloseIcon width={12} /> <CloseIcon width={12} />
</span>
</span> </span>
</span> </CSSTransition>
</CSSTransition> }
} </li>
</li> )}
)} </ul>
</ul> }
{ !props.readOnly && { !props.readOnly &&
<input <input

View File

@ -49,7 +49,7 @@
} }
.r6o-widget { .r6o-widget {
border-bottom:1px solid $lightgrey-border-darker; border-bottom:1px solid $lightgrey-border;
} }
} }

View File

@ -1,3 +1,7 @@
.tags:empty {
display:none;
}
.tags { .tags {
background-color:$blueish-white; background-color:$blueish-white;
border-bottom:1px solid $lightgrey-border; border-bottom:1px solid $lightgrey-border;