mirror of
https://github.com/discourse/discourse.git
synced 2025-01-10 16:53:47 +08:00
d886c55f63
This update adds a ✨ _new_ `<PostList />` component, along with it's child components (`<PostListItem/>` and `<PostListItemDetails />`). This new generic component can be used to show a list of posts.
It can be used like so:
```js
/**
* A component that renders a list of posts
*
* @component PostList
*
* @args {Array<Object>} posts - The array of post objects to display
* @args {Function} fetchMorePosts - A function that fetches more posts. Must return a Promise that resolves to an array of new posts.
* @args {String} emptyText (optional) - Custom text to display when there are no posts
* @args {String|Array} additionalItemClasses (optional) - Additional classes to add to each post list item
* @args {String} titleAriaLabel (optional) - Custom Aria label for the post title
*
*/
```
```hbs
<PostList
@posts={{this.posts}}
@fetchMorePosts={{this.loadMorePosts}}
@emptyText={{i18n "custom_identifier.empty"}}
@additionalItemClasses="custom-class"
/>
```
|
||
---|---|---|
.. | ||
sidebar/edit-navigation-menu | ||
_index.scss | ||
add-pm-participants.scss | ||
badges.scss | ||
banner.scss | ||
bookmark-list.scss | ||
bookmark-menu.scss | ||
bookmark-modal.scss | ||
buttons.scss | ||
calendar-date-time-input.scss | ||
char-counter.scss | ||
color-input.scss | ||
conditional-loading-section.scss | ||
convert-to-public-topic-modal.scss | ||
d-breadcrumbs.scss | ||
d-lightbox.scss | ||
d-page-header.scss | ||
d-select.scss | ||
d-stat-tiles.scss | ||
d-toggle-switch.scss | ||
date-input.scss | ||
date-picker.scss | ||
date-time-input-range.scss | ||
date-time-input.scss | ||
download-calendar.scss | ||
file-size-input.scss | ||
footer-nav.scss | ||
form-template-field.scss | ||
group-member-dropdown.scss | ||
groups-form-membership-fields.scss | ||
hashtag.scss | ||
horizontal-overflow-nav.scss | ||
iframed-html.scss | ||
ignored-user-list.scss | ||
keyboard_shortcuts.scss | ||
more-topics.scss | ||
navs.scss | ||
notifications-tracking.scss | ||
offline-indicator.scss | ||
pick-files-button.scss | ||
post-list.scss | ||
powered-by-discourse.scss | ||
relative-time-picker.scss | ||
signup-progress-bar.scss | ||
svg.scss | ||
tap-tile.scss | ||
theme-card.scss | ||
time-input.scss | ||
time-shortcut-picker.scss | ||
topic-map.scss | ||
topic-query-filter.scss | ||
user-card.scss | ||
user-info.scss | ||
user-status-message.scss | ||
user-status-picker.scss | ||
user-stream-item.scss | ||
user-stream.scss | ||
welcome-header.scss | ||
widget-dropdown.scss |