Sha256: 6aaed50908b0f7b45db343987d2bfe5b7b2e8ffd949b013b40f84c5ccbe3fd05

Contents?: true

Size: 1.75 KB

Versions: 1781

Compression:

Stored size: 1.75 KB

Contents

import React, { useState } from 'react'

import Button from '../../pb_button/_button'
import FixedConfirmationToast from '../_fixed_confirmation_toast'

const FixedConfirmationToastAutoClose = (props) => {

    const [open, setOpen] = useState(false)
    const [openCloseable, setOpenCloseable] = useState(false)

    const handleClick = () => {
        setOpen(true)
    }
    const handleClickCloseable = () => {
        setOpenCloseable(true)
    }

    const handleClose = () => {
        setOpen(false)
    }

    const handleCloseCloseable = () => {
        setOpenCloseable(false)
    }

    return (
        <>
            <Button
                onClick={handleClick}
                text="Show Auto Close Toast"
                variant="secondary"
                {...props}
            />
            {' '}
            <Button
                onClick={handleClickCloseable}
                text="Show Closeable Auto Close Toast"
                variant="secondary"
                {...props}
            />

            <FixedConfirmationToast
                autoClose={3000}
                horizontal='center'
                onClose={handleClose}
                open={open}
                status='tip'
                text='I will disappear in 3 seconds.'
                vertical='top'
                {...props}
            />

            <FixedConfirmationToast
                autoClose={10000}
                closeable
                horizontal='center'
                onClose={handleCloseCloseable}
                open={openCloseable}
                status='tip'
                text='I will disappear in 10 seconds.'
                vertical='top'
                {...props}
            />
        </>
    )
}

export default FixedConfirmationToastAutoClose

Version data entries

1,781 entries across 1,781 versions & 2 rubygems

Version Path
playbook_ui_docs-14.12.0.pre.alpha.testingwithfas5689 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui-14.12.0.pre.alpha.testingwithfas5689 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui_docs-14.12.0.pre.alpha.testingwithfas5686 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui-14.12.0.pre.alpha.testingwithfas5686 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui_docs-14.12.0.pre.alpha.play1828updateviteversion5680 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui-14.12.0.pre.alpha.play1828updateviteversion5680 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui_docs-14.12.0.pre.alpha.PBNTR456fixedconftoastrailsautoclose5673 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui-14.12.0.pre.alpha.PBNTR456fixedconftoastrailsautoclose5673 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui_docs-14.12.0.pre.alpha.PLAY1602lightboxoverlapnitrobug5655 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui-14.12.0.pre.alpha.PLAY1602lightboxoverlapnitrobug5655 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui_docs-14.12.0.pre.alpha.PBNTR720railscarddraggable5649 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui-14.12.0.pre.alpha.PBNTR720railscarddraggable5649 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui_docs-14.12.0.pre.alpha.PLAY1602lightboxoverlapnitrobug5646 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui-14.12.0.pre.alpha.PLAY1602lightboxoverlapnitrobug5646 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui_docs-14.11.1.pre.alpha.PBNTR440enableglobalpropspbformwith5624 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui-14.11.1.pre.alpha.PBNTR440enableglobalpropspbformwith5624 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui-14.12.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui_docs-14.12.0.pre.rc.12 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui-14.12.0.pre.rc.12 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
playbook_ui_docs-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx