mirror of
https://github.com/wassname/talk.git
synced 2026-06-28 02:05:07 +08:00
5.3 KiB
5.3 KiB
title, permalink, toc, class
| title | permalink | toc | class |
|---|---|---|---|
| Client Plugin API | /api/client/ | true | configuration |
We created a set of utilities to make it easier to create and add functionality to plugins.
Feel free to check all the utilities here: talk/plugin-api.
Actions
Admin
viewUserDetail
Auth
setAuthTokenhandleSuccessfulLoginlogout
Notification
notify
Stream
setSortshowSignInDialog
Import
import {notify} 'plugin-api/beta/actions';
Usage
// Trigger a notification
notify('success', t('suspenduser.notify_suspend_until', username, timeago(until))
// mapDispatchToProps
const mapDispatchToProps = dispatch => ({
...bindActionCreators(
{
notify,
},
dispatch
),
});
Components
SlotYou probably won’t need to use the<Slot/>component in your plugin. But there’s a chance you might want to add a Slot so another plugin gets injected in your plugin.
Props
fill: <String | Array> Name of the slotdefaultComponent: <Element | Array> The default component if no plugin component is provided to the Slotsize: <Number | Array> - How many components this Slot should show - Slot size or an Array of slot sizepassthrough: