1.3.1 • Published 2 years ago

burgos-confirm v1.3.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years 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

2 years ago

1.3.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago