├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public ├── favicon.ico ├── index.html ├── logo192.png ├── logo512.png ├── manifest.json └── robots.txt ├── src ├── App.css ├── App.js ├── Header.js ├── components │ ├── buttons │ │ └── Compose.js │ ├── emailItem │ │ └── EmailItem.js │ └── layout │ │ ├── EmailsView.js │ │ ├── Header.js │ │ ├── Main.js │ │ ├── SideIcons.js │ │ └── Sidebar.js ├── data │ ├── BottomIconsData.js │ └── SidebarButtonItems.js ├── index.css ├── index.js ├── reportWebVitals.js └── temp │ └── EmailData.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `yarn start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will also see any lint errors in the console. 16 | 17 | ### `yarn test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `yarn build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `yarn eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 35 | 36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 39 | 40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `yarn build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gmail-clone-live", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@material-ui/core": "^4.11.3", 7 | "@material-ui/icons": "^4.11.2", 8 | "@testing-library/jest-dom": "^5.11.4", 9 | "@testing-library/react": "^11.1.0", 10 | "@testing-library/user-event": "^12.1.10", 11 | "react": "^17.0.1", 12 | "react-dom": "^17.0.1", 13 | "react-scripts": "4.0.2", 14 | "styled-components": "^5.2.1", 15 | "web-vitals": "^1.0.1" 16 | }, 17 | "scripts": { 18 | "start": "react-scripts start", 19 | "build": "react-scripts build", 20 | "test": "react-scripts test", 21 | "eject": "react-scripts eject" 22 | }, 23 | "eslintConfig": { 24 | "extends": [ 25 | "react-app", 26 | "react-app/jest" 27 | ] 28 | }, 29 | "browserslist": { 30 | "production": [ 31 | ">0.2%", 32 | "not dead", 33 | "not op_mini all" 34 | ], 35 | "development": [ 36 | "last 1 chrome version", 37 | "last 1 firefox version", 38 | "last 1 safari version" 39 | ] 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CleverProgrammers/cp-live-gmail-clone/62c311bb291e7dfdc42d09db92d54e1368cdad4b/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CleverProgrammers/cp-live-gmail-clone/62c311bb291e7dfdc42d09db92d54e1368cdad4b/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CleverProgrammers/cp-live-gmail-clone/62c311bb291e7dfdc42d09db92d54e1368cdad4b/public/logo512.png -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | } -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import './App.css'; 2 | import Header from './components/layout/Header' 3 | import Main from './components/layout/Main' 4 | function App() { 5 | return ( 6 |
7 |
8 |
9 |
10 | ); 11 | } 12 | 13 | export default App; 14 | -------------------------------------------------------------------------------- /src/Header.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | function Header() { 4 | return ( 5 |
6 | 7 |
8 | ) 9 | } 10 | 11 | export default Header 12 | -------------------------------------------------------------------------------- /src/components/buttons/Compose.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | 4 | import AddIcon from '@material-ui/icons/Add'; 5 | 6 | const Compose = () => { 7 | return ( 8 | 9 | 10 |

Compose

11 |
12 | ) 13 | } 14 | 15 | export default Compose 16 | 17 | const Wrapper = styled.div` 18 | display: grid; 19 | grid-template-columns: 35% auto; 20 | width: auto; 21 | align-items: center; 22 | padding: 6px 32px 6px 8px; 23 | border-radius: 50px; 24 | box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.302), 0 1px 3px 1px rgba(60, 64, 67, 0.149); 25 | cursor: pointer; 26 | color: #3c4043; 27 | font-weight: 500; 28 | font-size: 0.875rem; 29 | transition: box-shadow .08s linear,min-width .15s cubic-bezier(0.4,0.0,0.2,1); 30 | 31 | :hover { 32 | box-shadow: 0 1px 3px 0 rgb(60 64 67 / 30%), 0 4px 8px 3px rgb(60 64 67 / 15%); 33 | background-color: #fafafb; 34 | } 35 | ` 36 | -------------------------------------------------------------------------------- /src/components/emailItem/EmailItem.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react' 2 | import styled from 'styled-components' 3 | 4 | import { Checkbox } from '@material-ui/core' 5 | 6 | import StarBorderIcon from '@material-ui/icons/StarBorder'; 7 | import StarIcon from '@material-ui/icons/Star'; 8 | import IconButton from '@material-ui/core/IconButton'; 9 | 10 | const EmailItem = ({ starred, from, subject, message, received, read }) => { 11 | 12 | const [ star, setStar ] = useState(starred); 13 | 14 | return ( 15 | 16 | 17 | star ? setStar(false) : setStar(true)}> 18 | { star ? ( 19 | 20 | ) : ( 21 | 22 | ) 23 | } 24 | 25 | 26 |

{from}

27 | 28 |
29 |

{subject}

- {message} 30 |
31 | 32 |

{received}

33 | 34 | 35 |
36 | ) 37 | } 38 | 39 | export default EmailItem 40 | 41 | const Wrapper = styled.div` 42 | padding-left: 20px; 43 | border-top: 1px solid lightgray; 44 | display: grid; 45 | grid-template-columns: min-content min-content 120px auto min-content; 46 | align-items: center; 47 | cursor: pointer; 48 | padding-right: 20px; 49 | div { 50 | display: flex; 51 | 52 | span { 53 | color: darkgray; 54 | } 55 | } 56 | 57 | .unread{ 58 | color: black; 59 | font-weight: bolder; 60 | } 61 | ` 62 | -------------------------------------------------------------------------------- /src/components/layout/EmailsView.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | 4 | import Checkbox from '@material-ui/core/Checkbox' 5 | import RefreshIcon from '@material-ui/icons/Refresh'; 6 | import MoreVertIcon from '@material-ui/icons/MoreVert'; 7 | import IconButton from '@material-ui/core/IconButton'; 8 | 9 | import { emailData } from '../../temp/EmailData' 10 | 11 | import EmailItem from '../emailItem/EmailItem' 12 | 13 | const EmailsView = () => { 14 | return ( 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | { 30 | emailData.map(({starred, from, subject, message, received, read})=>( 31 | 39 | 40 | )) 41 | } 42 | 43 | 44 | 45 | ) 46 | } 47 | 48 | export default EmailsView 49 | 50 | const Wrapper = styled.div`` 51 | 52 | const TopWrapper = styled.div` 53 | padding-left: 20px; 54 | height: 48px; 55 | ` 56 | 57 | const EmailsContainer = styled.div` 58 | 59 | ` -------------------------------------------------------------------------------- /src/components/layout/Header.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | import MenuIcon from '@material-ui/icons/Menu'; 4 | 5 | import SearchIcon from '@material-ui/icons/Search'; 6 | import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; 7 | 8 | import HelpOutlineIcon from '@material-ui/icons/HelpOutline'; 9 | import SettingsIcon from '@material-ui/icons/Settings'; 10 | import AppsIcon from '@material-ui/icons/Apps'; 11 | import AccountCircleIcon from '@material-ui/icons/AccountCircle'; 12 | 13 | 14 | function Header() { 15 | return ( 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | ) 42 | } 43 | 44 | export default Header 45 | 46 | const Wrapper = styled.div` 47 | display: grid; 48 | grid-template-columns: 270px auto 170px; 49 | border-bottom: 1px solid lightgray; 50 | height: 70px; 51 | align-items: center; 52 | ` 53 | const LogoWrapper = styled.div` 54 | height: 45px; 55 | display: grid; 56 | grid-template-columns: 25% auto; 57 | ` 58 | 59 | const SearchIconWrapper = styled(SearchIcon)` 60 | color: #5f6368; 61 | ` 62 | 63 | const Menu = styled.div` 64 | display: grid; 65 | place-items: center; 66 | ` 67 | 68 | const Logo = styled.div` 69 | display: flex; 70 | height: 45px; 71 | ` 72 | 73 | const SearchWrapper = styled.div`` 74 | 75 | const SearchBarWrapper = styled.div` 76 | background-color: #f1f3f4; 77 | width: 100%; 78 | max-width: 750px; 79 | display: grid; 80 | grid-template-columns: 10% auto 7%; 81 | place-items: center; 82 | height: 45px; 83 | border-radius: 6px; 84 | 85 | .MuiSvgIcon-root{ 86 | color: #5f6368; 87 | } 88 | 89 | input { 90 | width: 100%; 91 | height: 30px; 92 | background: none; 93 | border: none; 94 | font-size: 18px; 95 | 96 | :focus{ 97 | outline: none; 98 | } 99 | } 100 | ` 101 | 102 | const IconsWrapper = styled.div` 103 | margin-left: 8px; 104 | display: grid; 105 | grid-template-columns: repeat(4, auto); 106 | 107 | .MuiSvgIcon-root{ 108 | color: #5f6368; 109 | } 110 | ` 111 | 112 | -------------------------------------------------------------------------------- /src/components/layout/Main.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | 4 | import Sidebar from './Sidebar' 5 | import EmailsView from './EmailsView' 6 | import SideIcons from './SideIcons' 7 | 8 | function Main() { 9 | return ( 10 | 11 | 12 | 13 | 14 | 15 | ) 16 | } 17 | 18 | export default Main 19 | 20 | const Wrapper = styled.div` 21 | display: grid; 22 | grid-template-columns: 270px auto 50px; 23 | ` 24 | -------------------------------------------------------------------------------- /src/components/layout/SideIcons.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | 4 | import AddIcon from '@material-ui/icons/Add'; 5 | 6 | const SideIcons = () => { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | ) 17 | } 18 | 19 | export default SideIcons 20 | 21 | const Wrapper = styled.div` 22 | display: grid; 23 | grid-template-rows: repeat(4, 50px) 1px 50px; 24 | place-items: center; 25 | border-left: 1px solid lightgray; 26 | 27 | img { 28 | width: 100%; 29 | max-height: 22px; 30 | object-fit: contain; 31 | } 32 | 33 | hr { 34 | width: 60%; 35 | } 36 | 37 | ` 38 | -------------------------------------------------------------------------------- /src/components/layout/Sidebar.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import styled from 'styled-components' 4 | import { sidebarButtonItems } from '../../data/SidebarButtonItems' 5 | 6 | import Compose from '../buttons/Compose' 7 | 8 | import VideocamIcon from '@material-ui/icons/Videocam'; 9 | import KeyboardIcon from '@material-ui/icons/Keyboard'; 10 | import AccountCircleIcon from '@material-ui/icons/AccountCircle'; 11 | 12 | import { bottomIcons } from '../../data/BottomIconsData' 13 | 14 | const Sidebar = () => { 15 | return ( 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | { 24 | sidebarButtonItems.map(item =>( 25 | {item.icon} {item.text} 26 | )) 27 | } 28 | 29 | 30 | 31 | 32 | 33 | Meet 34 |

New Meeting

35 |

Join Meeting

36 |
37 | 38 | 39 | Hangouts 40 |

David Rakosi

41 |
42 | 43 | 44 | { 45 | bottomIcons.map(icon => ( 46 | <> 47 | {icon} 48 | 49 | )) 50 | } 51 | 52 |
53 | 54 |
55 | ) 56 | } 57 | 58 | export default Sidebar 59 | 60 | const Wrapper = styled.div` 61 | border-right: 1px solid lightgray; 62 | height: calc(100vh - 70px); 63 | display: flex; 64 | flex-direction: column; 65 | justify-content: space-between; 66 | ` 67 | 68 | const BottomSectionWrapper = styled.div` 69 | margin-bottom: 30px; 70 | ` 71 | 72 | const TopSectionWrapper = styled.div`` 73 | 74 | const ComposeWrapper = styled.div` 75 | display: grid; 76 | place-items: start; 77 | padding: 10px 20px; 78 | ` 79 | 80 | const SideButtonsWrapper = styled.div`` 81 | 82 | const SidebarButtonItem = styled.div` 83 | display: grid; 84 | grid-template-columns: 14% auto; 85 | color: gray; 86 | padding: 5px 25px; 87 | border-radius: 0 100px 100px 0; 88 | cursor: pointer; 89 | margin-right: 8px; 90 | 91 | :hover{ 92 | background-color: #f5f7f7 93 | } 94 | ` 95 | 96 | const SidebarSectionWrapper = styled.div` 97 | border-top: 1px solid lightgray; 98 | 99 | p { 100 | color: gray; 101 | display: grid; 102 | grid-template-columns: 14% auto; 103 | height: 30px; 104 | align-items: center; 105 | padding-left: 25px; 106 | } 107 | ` 108 | 109 | const Title = styled.h4` 110 | padding-left: 25px; 111 | margin-bottom: 4px; 112 | margin-top: 8px; 113 | ` 114 | 115 | const BottomIconsWrapper = styled.div` 116 | display: flex; 117 | justify-content: center; 118 | color: gray; 119 | border-top: 1px solid lightgray; 120 | margin-top: 60px; 121 | 122 | .MuiSvgIcon-root{ 123 | padding: 2px; 124 | } 125 | 126 | ` 127 | 128 | -------------------------------------------------------------------------------- /src/data/BottomIconsData.js: -------------------------------------------------------------------------------- 1 | import PersonIcon from '@material-ui/icons/Person' 2 | import FormatQuoteIcon from '@material-ui/icons/FormatQuote'; 3 | import PhoneIcon from '@material-ui/icons/Phone'; 4 | 5 | export const bottomIcons = [ 6 | , 7 | , 8 | 9 | ] -------------------------------------------------------------------------------- /src/data/SidebarButtonItems.js: -------------------------------------------------------------------------------- 1 | import InboxIcon from '@material-ui/icons/Inbox'; 2 | import StarIcon from '@material-ui/icons/Star'; 3 | import WatchLaterIcon from '@material-ui/icons/WatchLater'; 4 | import SendIcon from '@material-ui/icons/Send'; 5 | import InsertDriveFileIcon from '@material-ui/icons/InsertDriveFile'; 6 | import LabelIcon from '@material-ui/icons/Label'; 7 | import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; 8 | 9 | export const sidebarButtonItems = [ 10 | { 11 | icon: , 12 | text: 'Inbox' 13 | },{ 14 | icon: , 15 | text: 'Starred' 16 | },{ 17 | icon: , 18 | text: 'Snoozed' 19 | },{ 20 | icon: , 21 | text: 'Sent' 22 | },{ 23 | icon: , 24 | text: 'Drafts' 25 | },{ 26 | icon: , 27 | text: 'Notes' 28 | },{ 29 | icon: , 30 | text: 'More' 31 | }, 32 | ] 33 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /src/temp/EmailData.js: -------------------------------------------------------------------------------- 1 | export const emailData = [ 2 | { 3 | starred: true, 4 | from: 'Naz', 5 | subject: 'Yoooo', 6 | message: 'sup bro', 7 | received: '08:20', 8 | read: true 9 | }, { 10 | starred: true, 11 | from: 'Qazi', 12 | subject: 'Yoooo', 13 | message: 'sup broooooo', 14 | received: '08:30', 15 | read: true 16 | }, { 17 | starred: false, 18 | from: 'Amaanath', 19 | subject: 'Yoooo', 20 | message: 'sup breh', 21 | received: '09:25', 22 | read: false 23 | }, 24 | ] --------------------------------------------------------------------------------