mirror of
https://github.com/discourse/discourse.git
synced 2025-01-09 18:13:54 +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"
/>
```
|
||
---|---|---|
.. | ||
about.rb | ||
activate_account.rb | ||
admin_about_config_area.rb | ||
admin_customize_themes.rb | ||
admin_dashboard.rb | ||
admin_flag_form.rb | ||
admin_flags.rb | ||
admin_new_features.rb | ||
admin_objects_theme_setting_editor.rb | ||
admin_permalink_form.rb | ||
admin_permalinks.rb | ||
admin_plugins_list.rb | ||
admin_site_settings.rb | ||
admin_site_texts.rb | ||
admin_staff_action_logs.rb | ||
admin_user_fields.rb | ||
admin_user.rb | ||
admin_users.rb | ||
admin_watched_words.rb | ||
admin_web_hook_events.rb | ||
base.rb | ||
category.rb | ||
csv_export_pm.rb | ||
discovery.rb | ||
form_template.rb | ||
group_activity_posts.rb | ||
group.rb | ||
header.rb | ||
invite_form.rb | ||
login.rb | ||
review.rb | ||
search.rb | ||
signup.rb | ||
tag.rb | ||
topic.rb | ||
user_activity_bookmarks.rb | ||
user_invited_pending.rb | ||
user_notifications.rb | ||
user_preferences_account.rb | ||
user_preferences_interface.rb | ||
user_preferences_navigation_menu.rb | ||
user_preferences_profile.rb | ||
user_preferences_security.rb | ||
user_preferences.rb | ||
user_private_messages.rb | ||
user_reset_password.rb | ||
user.rb | ||
wizard.rb |