feat: provide api to register actions in contacts menu
Signed-off-by: Kent Delante <kent.delante@proton.me>pull/54474/head
parent
18da10fd01
commit
9f3da00aac
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import type { IContactsMenuAction } from '../types/contactsMenuAction.ts'
|
||||
|
||||
export default class ContactsMenuService {
|
||||
|
||||
private _actions: IContactsMenuAction[]
|
||||
|
||||
constructor() {
|
||||
this._actions = []
|
||||
}
|
||||
|
||||
get actions(): IContactsMenuAction[] {
|
||||
return this._actions
|
||||
}
|
||||
|
||||
/*
|
||||
* Register an action for the contacts menu
|
||||
* Actions use NcButton
|
||||
*/
|
||||
addAction(action: IContactsMenuAction): void {
|
||||
this._actions.push(action)
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
/*!
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
export interface IContactsMenuAction {
|
||||
id: string
|
||||
icon: string
|
||||
label: string
|
||||
onClick: () => void | Promise<void>
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue