-
-
Save manidip/2a8e97b7df064f040c9aeb38dc0df175 to your computer and use it in GitHub Desktop.
MERN Auth Materials
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { makeStyles } from '@material-ui/core/styles'; | |
export default makeStyles((theme) => ({ | |
paper: { | |
marginTop: theme.spacing(8), | |
display: 'flex', | |
flexDirection: 'column', | |
alignItems: 'center', | |
padding: theme.spacing(2), | |
}, | |
root: { | |
'& .MuiTextField-root': { | |
margin: theme.spacing(1), | |
}, | |
}, | |
avatar: { | |
margin: theme.spacing(1), | |
backgroundColor: theme.palette.secondary.main, | |
}, | |
form: { | |
width: '100%', // Fix IE 11 issue. | |
marginTop: theme.spacing(3), | |
}, | |
submit: { | |
margin: theme.spacing(3, 0, 2), | |
}, | |
googleButton: { | |
marginBottom: theme.spacing(2), | |
}, | |
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
const icon = () => ( | |
<svg style={{ width: '20px', height: '20px' }} viewBox="0 0 24 24"> | |
<path | |
fill="currentColor" | |
d="M21.35,11.1H12.18V13.83H18.69C18.36,17.64 15.19,19.27 12.19,19.27C8.36,19.27 5,16.25 5,12C5,7.9 8.2,4.73 12.2,4.73C15.29,4.73 17.1,6.7 17.1,6.7L19,4.72C19,4.72 16.56,2 12.1,2C6.42,2 2.03,6.8 2.03,12C2.03,17.05 6.16,22 12.25,22C17.6,22 21.5,18.33 21.5,12.91C21.5,11.76 21.35,11.1 21.35,11.1V11.1Z" | |
/> | |
</svg> | |
); | |
export default icon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Likes = () => { | |
if (post.likes.length > 0) { | |
return post.likes.find((like) => like === (user?.result?.googleId || user?.result?._id)) | |
? ( | |
<><ThumbUpAltIcon fontSize="small" /> {post.likes.length > 2 ? `You and ${post.likes.length - 1} others` : `${post.likes.length} like${post.likes.length > 1 ? 's' : ''}` }</> | |
) : ( | |
<><ThumbUpAltOutlined fontSize="small" /> {post.likes.length} {post.likes.length === 1 ? 'Like' : 'Likes'}</> | |
); | |
} | |
return <><ThumbUpAltOutlined fontSize="small" /> Like</>; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment