mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-05 00:52:28 +03:00
Manage sticker packs link and add comments
This commit is contained in:
parent
23bef68a8f
commit
0441487e97
2 changed files with 19 additions and 3 deletions
|
@ -115,7 +115,7 @@ export default class Stickerpack extends React.Component {
|
|||
padding: '5px',
|
||||
borderTop: '1px solid #999',
|
||||
}}>
|
||||
<span className='mx_Stickers_addLink' onClick={this._launchManageIntegrations} >Add sticker packs</span>
|
||||
<span className='mx_Stickers_addLink' onClick={this._launchManageIntegrations} > { _t("Manage sticker packs") } </span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -126,6 +126,11 @@ export default class Stickerpack extends React.Component {
|
|||
this.setState({stickersContent});
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the sticker picker overlay
|
||||
* If no stickerpacks have been added, show a link to the integration manager add sticker packs page.
|
||||
* @param {Event} e Event that triggered the function
|
||||
*/
|
||||
onShowStickersClick(e) {
|
||||
const GenericElementContextMenu = sdk.getComponent('context_menus.GenericElementContextMenu');
|
||||
const buttonRect = e.target.getBoundingClientRect();
|
||||
|
@ -149,23 +154,33 @@ export default class Stickerpack extends React.Component {
|
|||
this.setState({showStickers: true});
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger hiding of the sticker picker overlay
|
||||
* @param {Event} ev Event that triggered the function call
|
||||
*/
|
||||
onHideStickersClick(ev) {
|
||||
this.stickersMenu.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* The stickers picker was hidden
|
||||
*/
|
||||
onFinished() {
|
||||
this.setState({showStickers: false});
|
||||
this.stickersMenu = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch the integrations manager on the stickers integration page
|
||||
*/
|
||||
_launchManageIntegrations() {
|
||||
this.onFinished();
|
||||
const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager");
|
||||
const src = (this.scalarClient !== null && this.scalarClient.hasCredentials()) ?
|
||||
this.scalarClient.getScalarInterfaceUrlForRoom(
|
||||
this.props.room.roomId,
|
||||
'add_integ',
|
||||
// this.widgetId,
|
||||
'type_stickerpack',
|
||||
this.widgetId,
|
||||
) :
|
||||
null;
|
||||
Modal.createTrackedDialog('Integrations Manager', '', IntegrationsManager, {
|
||||
|
|
|
@ -555,6 +555,7 @@
|
|||
"NOTE: Apps are not end-to-end encrypted": "NOTE: Apps are not end-to-end encrypted",
|
||||
"Do you want to load widget from URL:": "Do you want to load widget from URL:",
|
||||
"Allow": "Allow",
|
||||
"Manage sticker packs": "Manage sticker packs",
|
||||
"Delete Widget": "Delete Widget",
|
||||
"Deleting a widget removes it for all users in this room. Are you sure you want to delete this widget?": "Deleting a widget removes it for all users in this room. Are you sure you want to delete this widget?",
|
||||
"Delete widget": "Delete widget",
|
||||
|
|
Loading…
Reference in a new issue