@material-ui/icons#FavoriteBorderOutlined JavaScript Examples
The following examples show how to use
@material-ui/icons#FavoriteBorderOutlined.
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: Post.js From clone-instagram-ui with MIT License | 6 votes |
Post = ({ post, onCommentChange, onLike }) => {
const firstCharacter = post.userName[0].toUpperCase();
return (
<Card className="ins-post">
<Link
to={`/profile/${post.userName}`}
className="profile-navigation-link"
>
<CardHeader
avatar={
<Avatar style={{ background: getBackgroundColor(firstCharacter) }}>
{firstCharacter || '-'}
</Avatar>
}
title={post.userName}
/>
</Link>
<img
className="ins-post-media"
src={post.media}
title={post.content}
alt={post.title}
/>
<CardActions disableSpacing>
<IconButton aria-label="add to favorites" onClick={onLike}>
<FavoriteBorderOutlined />
</IconButton>
</CardActions>
<CardContent className="comments-section">
<b>{`${post.likes || 0} Likes`}</b>
{post.comment.map((c) => (
<Comment {...c} />
))}
</CardContent>
<AddComment onCommentChange={onCommentChange} />
</Card>
);
}
Example #2
Source File: wishlist-header.js From horondi_client_fe with MIT License | 6 votes |
WishlistHeader = () => {
const styles = useStyles();
const { wishlistItems } = useSelector(({ CommonStore }) => ({
wishlistItems: CommonStore.wishlist
}));
return (
<>
<Link to={pathToWishlist}>
<IconButton className={styles.root} aria-label={WISHLIST_KEY} tabIndex={-1} disableRipple>
<Badge badgeContent={wishlistItems.length} color='secondary'>
<FavoriteBorderOutlined className={styles.svg} />
</Badge>
</IconButton>
</Link>
</>
);
}
Example #3
Source File: Navigators.js From clone-instagram-ui with MIT License | 5 votes |
Navigators = ({ className, username, onNavigationClick }) => {
const [anchorEl, setAnchorEl] = React.useState(null);
const handleClick = (event) => {
setAnchorEl(event.currentTarget);
};
const handleClose = (type) => {
setAnchorEl(null);
if (type === 'log-out') {
removeUserInformation();
window.location.reload();
}
};
return (
<Toolbar className={className}>
{username && (
<React.Fragment>
<Link to={`/home`} className="navigation-link">
<IconButton edge="start" color="inherit" aria-label="menu">
<Home />
</IconButton>
</Link>
<IconButton color="inherit" aria-label="menu">
<FavoriteBorderOutlined />
</IconButton>
<IconButton
onClick={onNavigationClick.bind(null, 'add-media')}
color="inherit"
aria-label="menu"
>
<Add />
</IconButton>
{/* <Link to={`/profile/${username}`} className="navigation-link"></Link> */}
<IconButton
color="inherit"
aria-label="menu"
aria-controls="simple-menu"
aria-haspopup="true"
onClick={handleClick}
>
<Profile username={username} />
</IconButton>
<Menu
id="simple-menu"
anchorEl={anchorEl}
keepMounted
open={Boolean(anchorEl)}
>
<Link to={`/profile/${username}`} className="navigation-link">
<MenuItem onClick={handleClose.bind(null, 'profile')}>
Profile
</MenuItem>
</Link>
<MenuItem onClick={handleClose.bind(null, 'log-out')}>
Logout
</MenuItem>
</Menu>
</React.Fragment>
)}
{!username && (
<Link to="/start">
<span>Login / Signup</span>
</Link>
)}
</Toolbar>
);
}