├── .gitignore ├── README.md ├── package.json ├── public ├── favicon.ico ├── index.html ├── logo192.png ├── logo512.png ├── manifest.json └── robots.txt ├── src ├── @types │ └── index.ts ├── App.tsx ├── components │ ├── Footer │ │ ├── index.tsx │ │ └── styles.ts │ ├── Header │ │ ├── index.tsx │ │ └── styles.ts │ ├── ProfileData │ │ ├── index.tsx │ │ └── styles.ts │ ├── RandomCalendar │ │ ├── index.tsx │ │ └── styles.ts │ └── RepoCard │ │ ├── index.tsx │ │ └── styles.ts ├── index.tsx ├── pages │ ├── Profile │ │ ├── index.tsx │ │ └── styles.ts │ └── Repo │ │ ├── index.tsx │ │ └── styles.ts ├── react-app-env.d.ts └── styles │ ├── GlobalStyles.ts │ └── themes.ts ├── tsconfig.json └── 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 |

2 | UI Clone - Github 3 |

4 | 5 |

Responsive Github UI Clone (partial) for study purposes.

6 |

Deployed here.

7 | 8 |

9 | 10 | Contributors 11 | 12 | 13 | License 14 | 15 |

16 | 17 |
18 | 19 | ## Participants 20 | 21 | [](https://github.com/guilhermerodz) 22 | 23 | [Guilherme Rodz](https://github.com/guilhermerodz) 24 | 25 | ## Techs 26 | 27 | - [x] Fetch API 28 | - [x] React.js 29 | - [x] Styled Components 30 | - [x] TypeScript 31 | 32 | ## Ideas to implement 33 | 34 | - [ ] Use [SWR](https://swr.vercel.app/) as cache invalidation strategy 35 | - [ ] Fetch data from [GitHub V4 API](https://docs.github.com/en/graphql) (GraphQL instead of REST). 36 | - [ ] Create new routes with [React Router](https://reactrouter.com/web/guides/quick-start) (e.g. Github Feed, complete Repo page) 37 | 38 | ## Starting Dev Environment 39 | 40 | 1. Run `npm install` or `yarn install`.
41 | 2. Run `yarn start` and access `http://localhost:3000`.
42 | 43 | ## Contributing 44 | 45 | Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests. 46 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "youtube-clone-github", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^4.2.4", 7 | "@testing-library/react": "^9.3.2", 8 | "@testing-library/user-event": "^7.1.2", 9 | "@types/jest": "^24.0.0", 10 | "@types/node": "^12.0.0", 11 | "@types/react": "^16.9.0", 12 | "@types/react-dom": "^16.9.0", 13 | "date-fns": "^2.15.0", 14 | "history": "^5.0.0", 15 | "react": "^16.13.1", 16 | "react-calendar-heatmap": "^1.8.1", 17 | "react-dom": "^16.13.1", 18 | "react-icons": "^3.10.0", 19 | "react-router-dom": "^6.0.0-beta.0", 20 | "react-scripts": "3.4.1", 21 | "styled-components": "^5.1.1", 22 | "typescript": "~3.7.2" 23 | }, 24 | "scripts": { 25 | "start": "react-scripts start", 26 | "build": "react-scripts build", 27 | "test": "react-scripts test", 28 | "eject": "react-scripts eject" 29 | }, 30 | "eslintConfig": { 31 | "extends": "react-app" 32 | }, 33 | "browserslist": { 34 | "production": [ 35 | ">0.2%", 36 | "not dead", 37 | "not op_mini all" 38 | ], 39 | "development": [ 40 | "last 1 chrome version", 41 | "last 1 firefox version", 42 | "last 1 safari version" 43 | ] 44 | }, 45 | "devDependencies": { 46 | "@types/react-calendar-heatmap": "^1.6.2", 47 | "@types/react-icons": "^3.0.0", 48 | "@types/react-router-dom": "^5.1.5", 49 | "@types/styled-components": "^5.1.2" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rocketseat-content/youtube-clone-github/ac60073d67ee71cd90f33cf6a6a83d4b62603912/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/rocketseat-content/youtube-clone-github/ac60073d67ee71cd90f33cf6a6a83d4b62603912/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rocketseat-content/youtube-clone-github/ac60073d67ee71cd90f33cf6a6a83d4b62603912/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/@types/index.ts: -------------------------------------------------------------------------------- 1 | export interface APIUser { 2 | login: string; 3 | name: string; 4 | followers: number; 5 | following: number; 6 | public_repos: number; 7 | avatar_url: string; 8 | blog?: string; 9 | company?: string; 10 | email?: string; 11 | location?: string; 12 | } 13 | 14 | export interface APIRepo { 15 | name: string; 16 | owner: { 17 | login: string; 18 | }; 19 | stargazers_count: number; 20 | forks: number; 21 | html_url: string; 22 | language?: string; 23 | description?: string; 24 | } 25 | -------------------------------------------------------------------------------- /src/App.tsx: -------------------------------------------------------------------------------- 1 | import 'react-calendar-heatmap/dist/styles.css'; 2 | 3 | import React, { useState } from 'react'; 4 | import { BrowserRouter, Routes, Route } from 'react-router-dom'; 5 | import { ThemeProvider } from 'styled-components'; 6 | 7 | import GlobalStyles from './styles/GlobalStyles'; 8 | import Header from './components/Header'; 9 | import Profile from './pages/Profile'; 10 | import Repo from './pages/Repo'; 11 | import Footer from './components/Footer'; 12 | 13 | import { ThemeName, themes } from './styles/themes'; 14 | 15 | function App() { 16 | const [themeName, setThemeName] = useState('light'); 17 | const currentTheme = themes[themeName]; 18 | 19 | return ( 20 | 21 | 22 |
23 | 24 | 25 | } /> 26 | } /> 27 | } /> 28 | 29 | 30 |