@material-ui/icons APIs
- ExpandMore
- Delete
- Close
- Visibility
- VisibilityOff
- Check
- Add
- Edit
- Search
- ExpandLess
- Settings
- Person
- Info
- Clear
- ExitToApp
- ArrowDropDown
- Home
- GitHub
- Warning
- ArrowBack
- SearchOutlined
- Done
- LocationOn
- PlayArrow
- Apps
- Brightness4
- Brightness7
- Description
- KeyboardArrowDown
- KeyboardArrowLeft
- KeyboardArrowRight
- MoreVert
- LocationCity
- Map
- Image
- AccountCircle
- InfoOutlined
- Create
- Block
- Replay
- AddCircle
- HomeRounded
- GetApp
- ChevronLeft
- ChevronRight
- CloudDownload
- CheckCircleOutline
- Send
- LockOpen
- Cancel
- NavigateNext
- AccountBox
- DragIndicator
- FavoriteBorderOutlined
- AccessTime
- DoneAll
- CheckCircle
- CropFree
- LockOutlined
- Undo
- Dashboard
- People
- PhotoLibrary
- HomeOutlined
- Group
- ArrowDropUp
- Remove
- ArrowUpward
- Save
- ArrowForward
- AttachFile
- Headset
- SignalCellularAlt
- ArrowForwardIos
- PlayCircleFilled
- AccessAlarm
- Adjust
- BarChart
- CloseRounded
- PlayArrowOutlined
- ImageRounded
- MenuBookRounded
- RefreshRounded
- HourglassEmptyOutlined
- Announcement
- Ballot
- QuestionAnswerOutlined
- CloudUpload
- SkipNext
- ArrowRightAlt
- MoreHoriz
- FileCopy
- MenuBook
- Language
- AlternateEmail
- FolderOpen
- Lock
- Pets
- AddCircleRounded
- ExploreRounded
- WbSunnyRounded
- Brightness2Rounded
- DonutLargeRounded
- AssistantRounded
- AccountCircleRounded
- ExitToAppRounded
- VpnKey
- MailOutline
- Smartphone
- DeleteForever
- LanguageOutlined
- Colorize
- SignalCellularConnectedNoInternet2Bar
- SignalCellularConnectedNoInternet0Bar
- SignalCellular4Bar
- DeleteOutline
- NewReleases
- LocalOffer
- Assessment
- Place
- TrendingDown
- ShoppingCart
- Stop
- RotateLeft
- Menu
- Flag
- Forum
- GroupSharp
- InsertEmoticon
- NotificationsActive
- PhoneIphone
- AllInbox
- Comment
- Photo
- PlaylistAddCheck
- CloudUploadRounded
- ExpandMoreOutlined
- History
- PersonOutlineOutlined
- ArrowForwardIosRounded
- ArrowBackIosRounded
- AssignmentOutlined
- VerticalAlignCenterOutlined
- CalendarTodayOutlined
- Error
- PlaylistPlay
- MusicNoteTwoTone
- Portrait
- ExploreOutlined
- DeleteRounded
- EditRounded
- SaveRounded
- CreateNewFolder
- MeetingRoom
- MenuOpenRounded
- MenuRounded
- DateRange
- CallEnd
- Assignment
- KeyboardBackspace
- BluetoothSearching
- CameraAlt
- PlaylistAdd
- Favorite
- Bluetooth
- OpenInBrowser
- Loop
- FileCopyOutlined
- NavigateBefore
- MergeType
- Dvr
- PersonOutline
- PlayCircleFilledWhiteOutlined
- StoreMallDirectoryOutlined
- SupervisedUserCircleOutlined
- MonetizationOn
- OpenInNew
- ArrowDownward
- AddBox
- FilterList
- FirstPage
- LastPage
- ViewColumn
- Notifications
- DriveEta
- LocalTaxi
- Redo
- AccountTree
- TextFields
- SaveAlt
- ThumbDown
- ThumbUp
- LocalPhone
- VolumeUp
- VolumeDown
- Translate
- AddCircleOutlined
- RemoveCircleOutlined
- Router
- RemoveRedEye
- Chat
- Mood
- Mic
OtherRelated APIs
- react#useState
- react#useEffect
- react-router-dom#useHistory
- react-router-dom#Link
- @material-ui/core/styles#makeStyles
- @material-ui/core#Button
- @material-ui/core#IconButton
- @material-ui/core#Avatar
- @material-ui/core#Grid
- @material-ui/core#Hidden
- @material-ui/icons#HomeRounded
- @material-ui/icons#AddCircleRounded
- @material-ui/icons#ExploreRounded
- @material-ui/icons#AssistantRounded
- @material-ui/icons#AccountCircleRounded
@material-ui/icons#ExitToAppRounded JavaScript Examples
The following examples show how to use
@material-ui/icons#ExitToAppRounded.
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: index.js From Recess with MIT License | 4 votes |
function Sidebar({
user,
isLightTheme,
setIsLightTheme,
setOpenSignIn,
setOpenSignUp,
}) {
const classes = useStyles();
const history = useHistory();
const [pageSelected, setPageSelected] = useState({
home: false,
about: false,
upload: false,
explore: false,
profile: false,
});
const getSelectedStyle = (selected) => {
if (isLightTheme)
return selected
? lightTheme.palette.text.primary
: lightTheme.palette.text.secondary;
else
return selected
? darkTheme.palette.text.primary
: darkTheme.palette.text.secondary;
};
const setSelected = () => {
const tempSelected = pageSelected;
for (let i in tempSelected) tempSelected[i] = false;
switch (window.location.pathname) {
case "/home":
tempSelected.home = true;
break;
case "/about":
tempSelected.about = true;
break;
case "/upload":
tempSelected.upload = true;
break;
case "/explore":
tempSelected.explore = true;
break;
case "/profile":
tempSelected.profile = true;
break;
default:
console.log("404");
}
setPageSelected({ ...tempSelected });
};
useEffect(() => {
setSelected();
return history.listen(() => {
setSelected();
});
}, []);
return (
<Grid item xs={0} sm={4} className={classes.sidebar}>
<Hidden xsDown>
<div
className={classes.navLinks}
style={{ height: window.innerHeight - 110 }}
>
<Link
to="/home"
className={classes.link}
style={{ color: getSelectedStyle(pageSelected.home) }}
>
<HomeRounded />
<span>Home</span>
</Link>
<Link
to="/about"
className={classes.link}
style={{ color: getSelectedStyle(pageSelected.about) }}
>
<AssistantRounded />
<span>About</span>
</Link>
{user?.displayName ? (
<Link
to="/upload"
className={classes.link}
style={{ color: getSelectedStyle(pageSelected.upload) }}
>
<AddCircleRounded />
<span>Upload</span>
</Link>
) : null}
<Link
to="/explore"
className={classes.link}
style={{ color: getSelectedStyle(pageSelected.explore) }}
>
<ExploreRounded />
<span>Explore</span>
</Link>
{user?.displayName ? (
<Link
to="/profile"
className={classes.link}
style={{ color: getSelectedStyle(pageSelected.profile) }}
>
<AccountCircleRounded />
<span>Profile</span>
</Link>
) : null}
</div>
{user?.displayName ? (
<div className={classes.account}>
<Avatar src="" alt="User" className={classes.userPhoto} />
<span className={classes.username}>{user?.displayName}</span>
<IconButton
className={classes.logOutBtn}
onClick={() => {auth.signOut(); localStorage?.removeItem('lightThemeStatus');}}
>
<ExitToAppRounded color="error" className={classes.logOutIcon} />
</IconButton>
</div>
) : (
<div className={classes.authBox}>
<Button
className={classes.signInBtn}
onClick={() => setOpenSignIn(true)}
>
Sign In
</Button>
<Button
className={classes.signUpBtn}
onClick={() => setOpenSignUp(true)}
>
Sign Up
</Button>
</div>
)}
</Hidden>
</Grid>
);
}