@material-ui/icons APIs
- Close
- ExpandMore
- Add
- ExpandLess
- ArrowDropDown
- GitHub
- Check
- ArrowUpward
- ArrowDownward
- MoreVert
- Launch
- Info
- ChevronRight
- Edit
- Clear
- HelpOutline
- Delete
- Search
- Visibility
- VisibilityOff
- Settings
- ExitToApp
- Error
- InfoOutlined
- ArrowDropUp
- Brightness3
- CheckCircle
- KeyboardArrowRight
- KeyboardArrowDown
- KeyboardArrowUp
- Schedule
- ImageRounded
- Refresh
- KeyboardArrowLeft
- ArrowForward
- WarningRounded
- CloudDownload
- FullscreenExit
- Notifications
- ChevronLeft
- VolumeUp
- ArrowBack
- Work
- Person
- Favorite
- SearchOutlined
- AccountCircle
- Send
- Warning
- FirstPage
- LastPage
- Brightness5
- Telegram
- AccountBalanceWallet
- NotificationsNone
- AddCircle
- SwapHoriz
- AccessTime
- DoneOutlined
- ChevronRightRounded
- List
- ViewModule
- ThumbDownOutlined
- ThumbUpOutlined
- Forum
- CallMade
- PlayCircleOutline
- Cancel
- CancelRounded
- ArrowForwardIos
- LiveHelp
- AllInbox
- Face
- People
- SettingsPower
- NavigateNext
- NavigateBefore
- Save
- LayersClear
- Collections
- ThumbDown
- ThumbUp
- ZoomIn
- ZoomOut
- Fullscreen
- BarChart
- Image
- CenterFocusWeak
- VolumeDown
- Copyright
- DirectionsBoatRounded
- Create
- DeleteOutline
- DeleteOutlineOutlined
- CloudUploadOutlined
- PlayArrow
- Stop
- Done
- Undo
- FileCopy
- Menu
- Home
- Accessibility
- NotificationsActive
- Today
- Gavel
- AddAPhoto
- Dashboard
- Devices
- Event
- FitnessCenter
- Remove
- PinDrop
- Toc
- Group
- MenuBook
- NotListedLocation
- LocationOff
- Alarm
- BrightnessMedium
- Cloud
- ListAlt
- Pets
- GetApp
- ControlPoint
- FiberManualRecordRounded
- Flag
- FileCopyOutlined
- ExitToAppOutlined
- OpenInNew
- CheckCircleOutlined
- CancelOutlined
- PauseCircleOutline
- RemoveCircleOutline
- PlayCircleOutlineOutlined
- ArrowDownwardOutlined
- Brightness7
- OpenInNewSharp
- FilterCenterFocusSharp
- Web
- CheckRounded
- DeleteRounded
- FileCopyRounded
- MoreVertRounded
- SendRounded
- Cached
- CalendarToday
- FlashOn
- PictureAsPdf
- GridOn
- ArrowBackRounded
- PersonAddRounded
- KeyboardArrowUpRounded
- KeyboardArrowDownRounded
- KeyboardArrowLeftRounded
- KeyboardArrowRightRounded
- IndeterminateCheckBoxRounded
- FilterList
- Subject
- ExitToAppRounded
- CachedRounded
- FaceRounded
- Language
- SvgIconComponent
- MoreHoriz
- YouTube
- RestorePage
- NoteAdd
- ArrowBackIos
- Equalizer
- ImportExportRounded
- CloudDownloadRounded
- HelpOutlineRounded
- Star
- Business
- HouseOutlined
- ArrowRight
- ErrorOutline
- Lock
- FavoriteBorder
- MeetingRoom
- Mic
- MicOff
- Videocam
- VideocamOff
- VolumeOff
- ScreenShare
- Receipt
- Title
- ViewComfy
- ViewCompact
- FiberManualRecord
- RadioButtonUnchecked
Other Related APIs
- react#FunctionComponent
- react-router-dom#Link
- @material-ui/core#IconButton
- @material-ui/core#Toolbar
- @material-ui/core#AppBar
- @material-ui/core#Avatar
- @material-ui/core#Grid
- @material-ui/core#MenuItem
- @material-ui/core#Menu
- @material-ui/icons#GitHub
- @material-ui/icons#AllInbox
- @material-ui/icons#Face
- @material-ui/icons#HelpOutline
- @material-ui/icons#People
@material-ui/icons#SettingsPower TypeScript Examples
The following examples show how to use
@material-ui/icons#SettingsPower.
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: Header.tsx From frontend with Apache License 2.0 | 4 votes |
Header: FunctionComponent = () => {
const [avatarMenuRef, setAvatarMenuRef] = React.useState<null | HTMLElement>(null);
const [helpMenuRef, setHelpMenuRef] = React.useState<null | HTMLElement>(null);
const { loggedIn, user } = useUserState();
const authDispatch = useUserDispatch();
const styleMenuItem = {
display: "flex",
alignItems: "center",
};
const handleMenuClose = () => {
setAvatarMenuRef(null);
setHelpMenuRef(null);
};
const closeMenuAndOpenLink = () => {
handleMenuClose();
window.open("https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker/issues/new", "_blank");
};
const getVRTVersion = (): string => {
//For cypress tests, window._env_ variable may be undefined, so return a dummy value.
return window._env_ ? window._env_.VRT_VERSION : "5.0.0";
};
const renderHelpMenu = (
<Menu
anchorEl={helpMenuRef}
anchorOrigin={{ vertical: "top", horizontal: "right" }}
id="headerHelpMenu"
keepMounted
transformOrigin={{ vertical: "top", horizontal: "right" }}
open={!!helpMenuRef}
onClose={handleMenuClose}
>
<MenuItem onClick={handleMenuClose} >
<GuidedTour />
</MenuItem>
<MenuItem onClick={closeMenuAndOpenLink} style={styleMenuItem}>
<IconButton size="small">
<GitHub />
</IconButton>
Open an issue in GitHub
</MenuItem>
<hr />
<MenuItem style={{
justifyContent: "center"
}}>
VRT Version : {getVRTVersion()}
</MenuItem>
</Menu >
);
const renderAvatarMenu = (
<Menu
anchorEl={avatarMenuRef}
anchorOrigin={{ vertical: "top", horizontal: "right" }}
id="headerAvatarMenu"
keepMounted
transformOrigin={{ vertical: "top", horizontal: "right" }}
open={!!avatarMenuRef}
onClose={handleMenuClose}
>
{user?.role === "admin" && (
<MenuItem
component={Link}
to={routes.USER_LIST_PAGE}
onClick={handleMenuClose}
style={styleMenuItem}
>
<IconButton size="small">
<People />
</IconButton>
Users
</MenuItem>
)}
<MenuItem
component={Link}
to={routes.PROJECT_LIST_PAGE}
onClick={handleMenuClose}
style={styleMenuItem}
>
<IconButton size="small">
<AllInbox />
</IconButton>
Projects
</MenuItem>
<MenuItem
component={Link}
to={routes.PROFILE_PAGE}
onClick={handleMenuClose}
style={styleMenuItem}
>
<IconButton size="small">
<Face />
</IconButton>
Profile
</MenuItem>
<MenuItem
onClick={() => {
handleMenuClose();
logout(authDispatch);
}}
data-testid="logoutBtn"
>
<IconButton size="small">
<SettingsPower />
</IconButton>
Logout
</MenuItem>
</Menu>
);
return (
<React.Fragment>
<AppBar position="static" color="default">
<Toolbar>
<Grid container justifyContent="space-between" alignItems="center">
<Grid item>
<Link to="/">
<img src={logo} width="60" height="60" alt="logo" />
</Link>
</Grid>
<Grid item>
<Grid
container
justifyContent="space-between"
alignItems="center"
>
<IconButton onClick={(event: React.MouseEvent<HTMLElement>) =>
setHelpMenuRef(event.currentTarget)
}>
<Avatar>
<HelpOutline />
</Avatar>
</IconButton>
{loggedIn && (
<IconButton
onClick={(event: React.MouseEvent<HTMLElement>) =>
setAvatarMenuRef(event.currentTarget)
}
>
<Avatar>{`${user?.firstName[0]}${user?.lastName[0]}`}</Avatar>
</IconButton>
)}
</Grid>
</Grid>
</Grid>
</Toolbar>
</AppBar>
{renderAvatarMenu}
{renderHelpMenu}
</React.Fragment>
);
}