mirror of
https://github.com/flarum/core.git
synced 2025-06-25 20:24:56 +02:00
Restyle posts to be more compact, relocate controls
This commit is contained in:
@ -10,6 +10,8 @@ import Composer from 'flarum/components/Composer';
|
||||
import ItemList from 'flarum/utils/ItemList';
|
||||
import listItems from 'flarum/helpers/listItems';
|
||||
import Button from 'flarum/components/Button';
|
||||
import Dropdown from 'flarum/components/Dropdown';
|
||||
import PostControls from 'flarum/utils/PostControls';
|
||||
|
||||
/**
|
||||
* The `CommentPost` component displays a standard `comment`-typed post. This
|
||||
@ -42,6 +44,8 @@ export default class CommentPost extends Post {
|
||||
}
|
||||
|
||||
content() {
|
||||
const controls = PostControls.controls(this.props.post, this).toArray();
|
||||
|
||||
return [
|
||||
<header className="Post-header"><ul>{listItems(this.headerItems().toArray())}</ul></header>,
|
||||
<div className="Post-body">
|
||||
@ -49,8 +53,17 @@ export default class CommentPost extends Post {
|
||||
? <div className="Post-preview" config={this.configPreview.bind(this)}/>
|
||||
: m.trust(this.props.post.contentHtml())}
|
||||
</div>,
|
||||
<footer className="Post-footer"><ul>{listItems(this.footerItems().toArray())}</ul></footer>,
|
||||
<aside className="Post-actions"><ul>{listItems(this.actionItems().toArray())}</ul></aside>
|
||||
<aside className="Post-actions"><ul>
|
||||
{controls.length ? Dropdown.component({
|
||||
children: controls,
|
||||
className: 'Post-controls',
|
||||
buttonClassName: 'Button Button--icon Button--flat',
|
||||
menuClassName: 'Dropdown-menu--right',
|
||||
icon: 'ellipsis-h'
|
||||
}) : ''}
|
||||
{listItems(this.actionItems().toArray())}
|
||||
</ul></aside>,
|
||||
<footer className="Post-footer"><ul>{listItems(this.footerItems().toArray())}</ul></footer>
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -45,13 +45,7 @@ export default class Post extends Component {
|
||||
|
||||
return (
|
||||
<div>
|
||||
{controls.length ? Dropdown.component({
|
||||
children: controls,
|
||||
className: 'Post-controls',
|
||||
buttonClassName: 'Button Button--icon Button--flat',
|
||||
menuClassName: 'Dropdown-menu--right',
|
||||
icon: 'ellipsis-v'
|
||||
}) : ''}
|
||||
|
||||
|
||||
{this.content()}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user