mirror of
https://github.com/flarum/core.git
synced 2025-07-24 18:21:33 +02:00
Clean up new post layout
This commit is contained in:
@@ -10,8 +10,6 @@ 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
|
||||
@@ -44,8 +42,6 @@ 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">
|
||||
@@ -53,16 +49,6 @@ export default class CommentPost extends Post {
|
||||
? <div className="Post-preview" config={this.configPreview.bind(this)}/>
|
||||
: m.trust(this.props.post.contentHtml())}
|
||||
</div>,
|
||||
<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>
|
||||
];
|
||||
}
|
||||
@@ -198,13 +184,4 @@ export default class CommentPost extends Post {
|
||||
footerItems() {
|
||||
return new ItemList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build an item list for the post's actions.
|
||||
*
|
||||
* @return {ItemList}
|
||||
*/
|
||||
actionItems() {
|
||||
return new ItemList();
|
||||
}
|
||||
}
|
||||
|
@@ -2,6 +2,8 @@ import Component from 'flarum/Component';
|
||||
import SubtreeRetainer from 'flarum/utils/SubtreeRetainer';
|
||||
import Dropdown from 'flarum/components/Dropdown';
|
||||
import PostControls from 'flarum/utils/PostControls';
|
||||
import listItems from 'flarum/helpers/listItems';
|
||||
import ItemList from 'flarum/utils/ItemList';
|
||||
|
||||
/**
|
||||
* The `Post` component displays a single post. The basic post template just
|
||||
@@ -45,9 +47,21 @@ export default class Post extends Component {
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
|
||||
{this.content()}
|
||||
<aside className="Post-actions">
|
||||
<ul>
|
||||
{listItems(this.actionItems().toArray())}
|
||||
{controls.length ? <li>
|
||||
<Dropdown
|
||||
className="Post-controls"
|
||||
buttonClassName="Button Button--icon Button--flat"
|
||||
menuClassName="Dropdown-menu--right"
|
||||
icon="ellipsis-h">
|
||||
{controls}
|
||||
</Dropdown>
|
||||
</li> : ''}
|
||||
</ul>
|
||||
</aside>
|
||||
</div>
|
||||
);
|
||||
})()}
|
||||
@@ -72,4 +86,13 @@ export default class Post extends Component {
|
||||
content() {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Build an item list for the post's actions.
|
||||
*
|
||||
* @return {ItemList}
|
||||
*/
|
||||
actionItems() {
|
||||
return new ItemList();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user