How to use the material-ui-popup-state/hooks.usePopupState function in material-ui-popup-state

To help you get started, we’ve selected a few material-ui-popup-state examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github the-rango / AntAlmanac / client / src / components / SectionTable / SectionTableBody.js View on Github external
const ScheduleAddCell = withStyles(styles)((props) => {
    const { classes, section, courseDetails, term } = props;
    const popupState = usePopupState({ variant: 'popover' });

    const closeAndAddCourse = (scheduleIndex) => {
        popupState.close();
        for (const meeting of section.meetings) {
            if (meeting.time === 'TBA') {
                openSnackbar('success', 'Online/TBA class added');
                // See Added Classes."
                break;
            }
        }

        if (scheduleIndex !== -1) {
            addCourse(section, courseDetails, term, scheduleIndex);
        }
    };
github Lightmatter / generic-django-conf / {{cookiecutter.repo_name}} / src / components / Header.jsx View on Github external
export default function MenuAppBar() {
    const classes = useStyles();
    const navMenuState = usePopupState({ variant: 'popover', popupId: 'navMenu' });
    const profileMenuState = usePopupState({ variant: 'popover', popupId: 'profileMenu' });
    const user = useCurrentUser();
    const logoutButtonClick = () => {
        logOut();
        profileMenuState.close();
    };
    const throwException = () => {
        throw new Error('Exception');
    };
    return (
github the-rango / AntAlmanac / client / src / components / SectionTable / SectionTableBody.js View on Github external
const SectionEnrollmentCell = withStyles(styles)((props) => {
    const {
        classes,
        numCurrentlyEnrolled,
        maxCapacity,
        numOnWaitlist,
        numNewOnlyReserved,
    } = props;
    const popupState = usePopupState({ variant: 'popover' });

    return (
        
            <div>
                <strong>
                    {`${numCurrentlyEnrolled.totalEnrolled}` +
                        ' / ' +
                        `${maxCapacity}` +
                        '\n'}
                </strong>
                {`WL: ${numOnWaitlist}` + '\n' + `NOR: ${numNewOnlyReserved}`}
            </div>
github the-rango / AntAlmanac / client / src / components / Calendar / Submenu.js View on Github external
const Submenu = (props) =&gt; {
    const popupState = usePopupState({ variant: 'popover' });

    return (
github Lightmatter / generic-django-conf / {{cookiecutter.repo_name}} / src / components / Header.jsx View on Github external
export default function MenuAppBar() {
    const classes = useStyles();
    const navMenuState = usePopupState({ variant: 'popover', popupId: 'navMenu' });
    const profileMenuState = usePopupState({ variant: 'popover', popupId: 'profileMenu' });
    const user = useCurrentUser();
    const logoutButtonClick = () =&gt; {
        logOut();
        profileMenuState.close();
    };
    const throwException = () =&gt; {
        throw new Error('Exception');
    };
    return (