@material-ui/icons#PersonOutline JavaScript Examples

The following examples show how to use @material-ui/icons#PersonOutline. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TenantSelector.js    From generator-webapp-rocket with MIT License 6 votes vote down vote up
TenantSelector = ({ tenant, changeTenant, tenants, drawerOpen }) => {
    const classes = useStyles();
    const handleChange = useCallback(({ target: { value } }) => {
        const newTenant = tenants.find(t => t.code.toUpperCase() === value.toUpperCase())
        changeTenant(newTenant)
    }, [changeTenant, tenants])

    const iconComponent = !drawerOpen ? { IconComponent: EmptyElement } : {}

    return (
        <div className={classes.tenantSelectorContainer}>
            <Select className={classes.tenantSelector}
                classes={{ selectMenu: classes.tenantSelectMenu }}
                value={tenant?.code}
                onChange={handleChange}
                {...iconComponent}>
                {
                    tenants.map(t =>
                    (<ListItem button value={t.code} className={classes.tenantSelectorItem} key={t.externalId}>
                        <span className={classes.collapseItemMini}>
                            <PersonOutline />
                        </span>
                        <Typography className={classes.tenantSelectorText}>{t.name}</Typography>
                    </ListItem>))
                }
            </Select>
        </div >
    )
}