├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public └── index.html └── src ├── Components ├── App │ ├── App.css │ └── App.jsx ├── Display │ ├── Display.css │ └── Display.jsx ├── Footer │ ├── Footer.css │ └── Footer.jsx ├── Header │ └── Header.jsx └── SearchBar │ ├── SearchBar.css │ └── SearchBar.jsx ├── index.css └── index.js /.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 | ### `npm 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 | ### `npm 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 | ### `npm run 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 | ### `npm run 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 | ### `npm run 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": "github-profile-retriever", 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.10", 9 | "@testing-library/react": "^11.2.6", 10 | "@testing-library/user-event": "^12.8.3", 11 | "axios": "^0.21.1", 12 | "react": "^17.0.2", 13 | "react-dom": "^17.0.2", 14 | "react-scripts": "4.0.3", 15 | "web-vitals": "^1.1.1", 16 | "postcss": "^8.4.21", 17 | "postcss-safe-parser": "^6.0.0", 18 | "cross-env": "^7.0.3" 19 | }, 20 | "scripts": { 21 | "start": "react-scripts start", 22 | "build": "react-scripts build", 23 | "test": "react-scripts test", 24 | "eject": "react-scripts eject", 25 | "start:legacy": "cross-env NODE_OPTIONS=--openssl-legacy-provider react-scripts start", 26 | "build:legacy": "cross-env NODE_OPTIONS=--openssl-legacy-provider react-scripts build" 27 | }, 28 | "eslintConfig": { 29 | "extends": [ 30 | "react-app", 31 | "react-app/jest" 32 | ] 33 | }, 34 | "browserslist": { 35 | "production": [ 36 | ">0.2%", 37 | "not dead", 38 | "not op_mini all" 39 | ], 40 | "development": [ 41 | "last 1 chrome version", 42 | "last 1 firefox version", 43 | "last 1 safari version" 44 | ] 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | Github Profile 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Components/App/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Components/App/App.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import Display from "../Display/Display"; 3 | import Footer from '../Footer/Footer'; 4 | import Header from "../Header/Header"; 5 | import SearchBar from "../SearchBar/SearchBar"; 6 | import "./App.css"; 7 | 8 | 9 | function App() { 10 | 11 | const[input, setInput] = useState('') 12 | 13 | return ( 14 |
15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 |
25 | ); 26 | } 27 | 28 | export default App; 29 | -------------------------------------------------------------------------------- /src/Components/Display/Display.css: -------------------------------------------------------------------------------- 1 | .display-container 2 | { 3 | margin-top: 10px; 4 | 5 | } 6 | 7 | .searchbtn 8 | { 9 | margin-bottom: 20px; 10 | 11 | } 12 | 13 | .userdata{ 14 | font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; 15 | } 16 | 17 | .username{ 18 | font-size: larger; 19 | font-weight: 900; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /src/Components/Display/Display.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | 3 | import "./Display.css"; 4 | import { makeStyles } from "@material-ui/core/styles"; 5 | import Card from "@material-ui/core/Card"; 6 | import CardContent from "@material-ui/core/CardContent"; 7 | import Typography from "@material-ui/core/Typography"; 8 | import Button from "@material-ui/core/Button"; 9 | import Avatar from "@material-ui/core/Avatar"; 10 | import Grid from "@material-ui/core/Grid"; 11 | 12 | const useStyles = makeStyles((theme) => ({ 13 | root: { 14 | minWidth: 275, 15 | }, 16 | bullet: { 17 | display: "inline-block", 18 | margin: "0 2px", 19 | transform: "scale(0.8)", 20 | }, 21 | title: { 22 | flexGrow: 1, 23 | }, 24 | pos: { 25 | marginBottom: 12, 26 | }, 27 | large: { 28 | width: theme.spacing(17), 29 | height: theme.spacing(17), 30 | }, 31 | })); 32 | 33 | const Display = ({ input }) => { 34 | const classes = useStyles(); 35 | const [userdata, setUserdata] = useState({}); 36 | const [checkdata, setCheckdata] = useState(false); 37 | 38 | const handleClick = (input) => { 39 | const username = input.input; 40 | 41 | fetch(`https://api.github.com/users/${username}`) 42 | .then((res) => res.json()) 43 | .then((data) => { 44 | setUserdata(data); 45 | setCheckdata(true); 46 | if(data.message){ 47 | setCheckdata(false); 48 | } 49 | }); 50 | }; 51 | 52 | return ( 53 |
54 |
55 | 64 |
65 | 66 |
67 | 68 | {(() => { 69 | if (checkdata) { 70 | return ( 71 | 72 | 73 | 79 | 80 | Profile Details 81 | 82 | 86 | 87 |

{userdata.login}

88 |
89 |

{userdata.bio}

90 |
91 | 92 | 98 | 99 |

100 | {userdata.followers} 101 |
102 |
103 | Followers 104 |

105 |
106 | 107 |

108 | {userdata.following} 109 |
110 |
111 | Following 112 |

113 |
114 |
115 |
116 |
117 | ); 118 | }else if(!checkdata && userdata.message){ 119 | return ( 120 | 121 |

Error Message: {userdata.message}

122 | ) 123 | 124 | } 125 | })()} 126 |
127 |
128 | ); 129 | }; 130 | 131 | export default Display; 132 | -------------------------------------------------------------------------------- /src/Components/Footer/Footer.css: -------------------------------------------------------------------------------- 1 | a { 2 | color: inherit; 3 | text-decoration: none; 4 | } 5 | 6 | .Footer { 7 | position: fixed; 8 | left: 0; 9 | bottom: 0; 10 | width: 100%; 11 | color: white; 12 | text-align: center; 13 | } 14 | -------------------------------------------------------------------------------- /src/Components/Footer/Footer.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { makeStyles } from "@material-ui/core/styles"; 3 | import AppBar from "@material-ui/core/AppBar"; 4 | import Toolbar from "@material-ui/core/Toolbar"; 5 | import Typography from "@material-ui/core/Typography"; 6 | import './Footer.css'; 7 | 8 | const useStyles = makeStyles((theme) => ({ 9 | root: { 10 | flexGrow: 1, 11 | }, 12 | menuButton: { 13 | marginRight: theme.spacing(2), 14 | }, 15 | title: { 16 | flexGrow: 1, 17 | }, 18 | })); 19 | 20 | const Footer = () => { 21 | const classes = useStyles(); 22 | return ( 23 |
24 | 25 | 26 | 27 | 28 | Made with Passion 💙 by Aswin Asok 29 |

Star 🌟 on GitHub
30 |
31 | 32 |
33 |
34 |
35 | ); 36 | }; 37 | 38 | export default Footer; 39 | -------------------------------------------------------------------------------- /src/Components/Header/Header.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { makeStyles } from "@material-ui/core/styles"; 3 | import AppBar from "@material-ui/core/AppBar"; 4 | import Toolbar from "@material-ui/core/Toolbar"; 5 | import Typography from "@material-ui/core/Typography"; 6 | 7 | 8 | const useStyles = makeStyles((theme) => ({ 9 | root: { 10 | flexGrow: 1, 11 | }, 12 | menuButton: { 13 | marginRight: theme.spacing(2), 14 | }, 15 | title: { 16 | flexGrow: 1, 17 | }, 18 | })); 19 | 20 | const Header = () => { 21 | 22 | const classes = useStyles(); 23 | 24 | return ( 25 |
26 | 27 | 28 | 29 | GitHub Profile Retriever 30 | 31 | 32 | 33 | 34 |
35 | ); 36 | }; 37 | 38 | export default Header; 39 | -------------------------------------------------------------------------------- /src/Components/SearchBar/SearchBar.css: -------------------------------------------------------------------------------- 1 | .searchbar-container{ 2 | margin-top: 30px; 3 | 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Components/SearchBar/SearchBar.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import "./SearchBar.css"; 3 | import TextField from "@material-ui/core/TextField"; 4 | 5 | const SearchBar = ({ setInput, input }) => { 6 | return ( 7 |
8 |
9 | setInput(event.target.value)} 16 | /> 17 |
18 | 19 |
20 |
21 | ); 22 | }; 23 | 24 | export default SearchBar; 25 | -------------------------------------------------------------------------------- /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 './Components/App/App'; 5 | 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | --------------------------------------------------------------------------------