1.3.1 • Published 8 months ago

burgos-confirm v1.3.1

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

Confirm dialog

A hook, context and component for rendering @mui/material dialog globally with variable title, text content, button name and on confirm callback

Preparation

wrap your app in and place the component:

<ConfirmDialogProvider>
    <App />
    <ConfirmDialog />
<ConfirmDialogProvider/>

Usage

Use the useConfirmDialog hook to retrieve the method and call it passing the title, content and onConfirm as an object:

import { useConfirmDialog } from 'burgos-confirm'

export const App = () => {
    const { confirm } = useConfirmDialog()

    const handleClick = () => {
        confirm({
            title: 'Confirmation',
            content: 'Are you sure you want to delete this object?',
            onConfirm: () => console.log(' object deleted')
        })
    }
}
1.3.1

8 months ago

1.3.0

8 months ago

1.2.2

11 months ago

1.2.1

11 months ago

1.2.0

11 months ago

1.1.3

12 months ago

1.1.2

12 months ago

1.1.1

12 months ago

1.1.0

12 months ago

1.0.1

12 months ago