1
0
mirror of https://github.com/flarum/core.git synced 2025-10-11 23:14:29 +02:00

Clean up new post layout

This commit is contained in:
Toby Zerner
2015-09-15 12:42:03 +09:30
parent 5c98a08e0f
commit fa265152c7
3 changed files with 36 additions and 49 deletions

View File

@@ -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();
}
}