logo

SINGULARITY

DOCS

PurchaseReturn to the Dashboard

SingularityDialog

SingularityDialog is a straightforward dialog trigger designed to display dialog messages effortlessly using a Redux action. It should be integrated within the theme layouts.

Usage

You can display a dialog from any part of the application by dispatching the openDialog action. It leverages Material-UI's dialog component, allowing you to pass props within an object:

<Button
    onClick={()=> dispatch(openDialog({
        children: (
            <React.Fragment>
                <DialogTitle id="alert-dialog-title">Use Google's location service?</DialogTitle>
                <DialogContent>
                    <DialogContentText id="alert-dialog-description">
                        Let Google help apps determine location. This means sending anonymous location data to
                        Google, even when no apps are running.
                    </DialogContentText>
                </DialogContent>
                <DialogActions>
                    <Button onClick={()=> dispatch(closeDialog())} color="primary">
                        Disagree
                    </Button>
                    <Button onClick={()=> dispatch(closeDialog())} color="primary" autoFocus>
                        Agree
                    </Button>
                </DialogActions>
            </React.Fragment>
             )
         }))}
    variant="contained"
    color="secondary"
>
    Open Dialog
</Button>
Example