Skip to content

Commit a64595b

Browse files
committed
feat(ActionsItems): Add webviewIntent in actions
1 parent 351595e commit a64595b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

react/ActionsMenu/ActionsItems.jsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ import React, { forwardRef, useMemo } from 'react'
22
import PropTypes from 'prop-types'
33

44
import { useClient } from 'cozy-client'
5+
import { useWebviewIntent } from 'cozy-intent'
6+
57
import { useI18n } from '../providers/I18n'
68
import { getActionName, getOnlyNeededActions } from './Actions/helpers'
79

810
const ActionsItems = forwardRef(
911
({ doc, actions, actionOptions, onClick: overridedClick, ...props }, ref) => {
1012
const client = useClient()
13+
const webviewIntent = useWebviewIntent()
14+
1115
const { t } = useI18n()
1216
const cleanedActions = useMemo(() => getOnlyNeededActions(actions, doc), [
1317
actions,
@@ -21,7 +25,14 @@ const ActionsItems = forwardRef(
2125
const { Component: ActionComponent, action, disabled } = actionDefinition
2226

2327
const handleClick = clickProps => {
24-
action && action(doc, { client, t, ...actionOptions, ...clickProps })
28+
action &&
29+
action(doc, {
30+
client,
31+
t,
32+
webviewIntent,
33+
...actionOptions,
34+
...clickProps
35+
})
2536
overridedClick && overridedClick()
2637
}
2738

0 commit comments

Comments
 (0)