Skip to content

Commit ad5174a

Browse files
committed
Updates code and readme
1 parent c398704 commit ad5174a

28 files changed

+4374
-3591
lines changed

.eslintrc.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ module.exports = {
2222
'react/jsx-filename-extension': 0,
2323
'import/extensions': 0,
2424
'import/no-unresolved': 0,
25-
'array-callback-retur': 0,
26-
'@typescript-eslint/no-explicit-any': 0,
27-
'jsx-a11y/label-has-associated-control': 0,
28-
'camelcase': 0,
29-
'@typescript-eslint/explicit-module-boundary-types': 0,
30-
'jsx-a11y/interactive-supports-focus': 0,
31-
'jsx-a11y/click-events-have-key-events': 0
25+
camelcase: 0,
26+
'prettier/prettier': 0,
27+
'no-use-before-define': 0,
28+
'import/prefer-default-export': 0,
29+
'jsx-a11y/click-events-have-key-events': 0,
30+
'jsx-a11y/no-static-element-interactions': 0,
3231
},
3332
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ firebase.json
3030
/.firebase
3131

3232
*.psd
33+
.eslintcache

README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img src="src\assets\img\transparentBanner.png" width="70%"/>
2+
<img src="src\assets\img\transparentBanner.png" width="50%"/>
33
</p>
44

55
<br>
@@ -18,23 +18,18 @@
1818
<a href="#project-star2">Project</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
1919
<a href="#techs-rocket">Techs</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
2020
<a href="#installation-wrench">Installation</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
21-
<a href="#test-heavy_check_mark">Test</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
21+
<a href="#start-on">Start</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
2222
<a href="#contributing-">Contributing</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
2323
<a href="#license-memo">License</a>
2424
</p>
2525

2626

2727
##
2828

29-
<br>
30-
3129
<p align="center">
3230
<img src="src\assets\img\banner.png"/>
3331
</p>
3432

35-
36-
##
37-
3833
<br>
3934

4035
## Project :star2:
@@ -43,7 +38,7 @@ This repo contains an UI clone (partial) from GitHub application using it's publ
4338

4439
<br>
4540

46-
Deployed [here](https://github-ui-clone.web.app).
41+
Deployed [here](https://github.ui-clone.ronne.dev).
4742

4843
<br>
4944

@@ -57,11 +52,13 @@ Deployed [here](https://github-ui-clone.web.app).
5752

5853
## Installation :wrench:
5954

55+
First you need to clone the project using `git clone https://github.com/leoronne/github-ui-clone.git`.
56+
6057
You can install the application using `npm install` or `yarn install` on the root dir.
6158

6259
<br>
6360

64-
## Test :heavy_check_mark:
61+
## Start :on:
6562

6663
To start the application interface just run `npm start` or `yarn start` on the root dir.
6764

package.json

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
{
22
"name": "github-ui-clone",
3-
"version": "1.0.0",
43
"description": "This app contains an UI clone (partial) from GitHub application",
4+
"version": "1.0.0",
5+
"main": "index.tsx",
56
"repository": "https://github.com/leoronne/github-ui-clone",
6-
"author": "Leonardo Ronne",
7+
"author": "Leonardo Ronne <leoronne@gmail.com>",
78
"license": "MIT",
89
"dependencies": {
9-
"@testing-library/jest-dom": "^4.2.4",
10-
"@testing-library/react": "^9.3.2",
11-
"@testing-library/user-event": "^7.1.2",
12-
"@types/jest": "^24.0.0",
13-
"@types/node": "^12.0.0",
14-
"@types/react": "^16.9.0",
15-
"@types/react-dom": "^16.9.0",
16-
"axios": "^0.19.2",
17-
"date-fns": "^2.15.0",
10+
"@material-ui/core": "^4.11.2",
11+
"@testing-library/jest-dom": "^5.11.6",
12+
"@testing-library/react": "^11.2.2",
13+
"@testing-library/user-event": "^12.6.0",
14+
"@types/jest": "^26.0.19",
15+
"@types/node": "^14.14.14",
16+
"@types/react": "^17.0.0",
17+
"@types/react-dom": "^17.0.0",
18+
"axios": "^0.21.1",
19+
"date-fns": "^2.16.1",
1820
"history": "^5.0.0",
19-
"react": "^16.13.1",
21+
"react": "^17.0.1",
2022
"react-calendar-heatmap": "^1.8.1",
21-
"react-dom": "^16.13.1",
22-
"react-icons": "^3.10.0",
23+
"react-dom": "^17.0.1",
24+
"react-icons": "^4.1.0",
2325
"react-router": "^5.2.0",
2426
"react-router-dom": "^6.0.0-beta.0",
25-
"react-scripts": "3.4.1",
26-
"react-spinners": "^0.9.0",
27-
"react-toastify": "^6.0.8",
28-
"react-tooltip": "^4.2.7",
29-
"react-use": "^15.3.3",
30-
"styled-components": "^5.1.1",
31-
"typescript": "^3.7.2"
27+
"react-scripts": "^4.0.1",
28+
"react-toastify": "^6.2.0",
29+
"react-use": "^15.3.4",
30+
"styled-components": "^5.2.1",
31+
"typescript": "^4.1.3"
3232
},
3333
"scripts": {
3434
"start": "react-app-rewired start",
@@ -54,26 +54,26 @@
5454
"devDependencies": {
5555
"@types/react-calendar-heatmap": "^1.6.2",
5656
"@types/react-icons": "^3.0.0",
57-
"@types/react-router-dom": "^5.1.5",
58-
"@types/styled-components": "^5.1.2",
59-
"@typescript-eslint/eslint-plugin": "^3.6.0",
60-
"@typescript-eslint/parser": "^3.6.0",
57+
"@types/react-router-dom": "^5.1.6",
58+
"@types/styled-components": "^5.1.7",
59+
"@typescript-eslint/eslint-plugin": "^4.11.0",
60+
"@typescript-eslint/parser": "^4.11.0",
6161
"babel-eslint": "^10.0.3",
62-
"babel-plugin-root-import": "^6.4.1",
63-
"customize-cra": "^0.9.1",
62+
"babel-plugin-root-import": "^6.6.0",
63+
"customize-cra": "^1.0.0",
6464
"enzyme": "^3.11.0",
65-
"enzyme-adapter-react-16": "^1.15.2",
66-
"eslint": "^6.8.0",
67-
"eslint-config-airbnb": "^18.1.0",
68-
"eslint-config-prettier": "^6.11.0",
65+
"enzyme-adapter-react-16": "^1.15.5",
66+
"eslint": "^7.16.0",
67+
"eslint-config-airbnb": "^18.2.1",
68+
"eslint-config-prettier": "^7.1.0",
6969
"eslint-import-resolver-babel-plugin-root-import": "^1.1.1",
70-
"eslint-plugin-import": "^2.20.2",
70+
"eslint-plugin-import": "^2.22.1",
7171
"eslint-plugin-import-helpers": "^1.0.2",
72-
"eslint-plugin-jsx-a11y": "^6.2.3",
73-
"eslint-plugin-prettier": "^3.1.4",
74-
"eslint-plugin-react": "^7.19.0",
75-
"eslint-plugin-react-hooks": "^2.5.1",
76-
"prettier": "^2.0.5",
77-
"react-app-rewired": "^2.1.6"
72+
"eslint-plugin-jsx-a11y": "^6.4.1",
73+
"eslint-plugin-prettier": "^3.3.0",
74+
"eslint-plugin-react": "^7.21.5",
75+
"eslint-plugin-react-hooks": "^4.2.0",
76+
"prettier": "^2.2.1",
77+
"react-app-rewired": "^2.1.8"
7878
}
7979
}

public/.htaccess

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Options -MultiViews
2+
RewriteEngine On
3+
RewriteCond %{REQUEST_FILENAME} !-f
4+
RewriteRule ^ index.html [QSA,L]

public/index.html

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,38 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<link rel="manifest" href="./manifest.json" />
6-
<meta name="msapplication-TileColor" content="#ffffff" />
5+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
6+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet" />
7+
<link rel="shortcut icon" type="image/x-icon" href="%PUBLIC_URL%/favicon.ico" />
8+
9+
<meta name="language" content="EN" />
10+
11+
<meta name="theme-color" content="#1D1D1D" />
12+
<meta name="msapplication-TileColor" content="#1D1D1D" />
13+
<meta name="apple-mobile-web-app-status-bar-style" content="#1D1D1D" />
14+
<meta name="msapplication-navbutton-color" content="#1D1D1D" />
15+
716
<meta name="msapplication-TileImage" content="./logo512.png" />
817
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
9-
<meta name="theme-color" content="#1D1D1D" />
18+
1019
<meta name="description" content="This app contains an UI clone (partial) from GitHub application using it's public APIs" />
11-
<meta name="author" content="Leonardo Ronne" />
20+
<meta name="subject" content="This is an UI clone (partial) from GitHub website." />
21+
1222
<meta name="keywords" content="GitHub, GitHub-UI-Clone, Leonardo Ronne, Next Level Weel, NLW, OmniStack, Rocketseat, Guilherme Rodz, Diego Fernandes, Reactjs, Nodejs" />
23+
24+
<meta name="author" content="Leonardo Ronne, leoronne@gmail.com" />
25+
<meta name="owner" content="Leonardo Ronne" />
26+
<meta name="reply-to" content="leoronne@gmail.com" />
27+
28+
<meta name="designer" content="Leonardo Ronne" />
29+
<meta name="copyright" content="Leonardo Ronne" />
30+
31+
<meta name="url" content="https://github.ui-clone.ronne.dev" />
32+
<meta name="identifier-URL" content="https://github.ui-clone.ronne.dev" />
33+
1334
<meta name="robots" content="index,follow" />
1435
<meta name="googlebot" content="index,follow" />
15-
<link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" />
36+
1637
<title>GitHub UI Clone</title>
1738
</head>
1839
<body>

public/logo1024.png

178 KB
Loading

public/logo256.png

27 KB
Loading

public/manifest.json

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,38 @@
11
{
2-
"short_name": "github-ui-clone",
2+
"short_name": "github-homepage-ui-clone",
33
"name": "GitHub UI Clone",
4+
"author": "Leonardo Ronne",
5+
"description": "This application contains an UI clone from GitHub (partial) website.",
6+
"developer": {
7+
"name": "Leonardo Ronne",
8+
"url": "https://github.com/leoronne"
9+
},
10+
"homepage_url": "https://github.ui-clone.ronne.dev",
411
"icons": [
512
{
613
"src": "favicon.ico",
7-
"sizes": "32x32",
14+
"sizes": "256x256",
815
"type": "image/x-icon"
916
},
1017
{
1118
"src": "logo192.png",
1219
"type": "image/png",
1320
"sizes": "192x192"
1421
},
22+
{
23+
"src": "logo256.png",
24+
"type": "image/png",
25+
"sizes": "256x256"
26+
},
1527
{
1628
"src": "logo512.png",
1729
"type": "image/png",
1830
"sizes": "512x512"
31+
},
32+
{
33+
"src": "logo1024.png",
34+
"type": "image/png",
35+
"sizes": "1024x1024"
1936
}
2037
],
2138
"start_url": "/",

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import './styles/ReactToastify.css';
1313

1414
import { ThemeName, themes } from './styles/themes';
1515

16-
function App() {
16+
const App: React.FC = () => {
1717
const [themeName, setThemeName] = useState<ThemeName>(localStorage.getItem('@Github:theme') === 'dark' ? 'dark' : 'light');
1818
const currentTheme = themes[themeName];
1919

src/components/Header/index.tsx

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/* eslint-disable react/button-has-type */
22
import React, { useState } from 'react';
33
import { useNavigate } from 'react-router-dom';
4+
import { Tooltip } from '@material-ui/core';
45

6+
import { useStyles } from '../../styles/MaterialUI';
57
import { Container, GithubLogo, SearchForm, MoonIcon, SunIcon, SearchIcon } from './styles';
68

79
import { ThemeName } from '../../styles/themes';
@@ -12,6 +14,8 @@ interface Props {
1214
}
1315

1416
const Header: React.FC<Props> = ({ themeName, setThemeName }) => {
17+
const classes = useStyles();
18+
1519
const [search, setSearch] = useState('');
1620
const navigate = useNavigate();
1721

@@ -28,18 +32,24 @@ const Header: React.FC<Props> = ({ themeName, setThemeName }) => {
2832

2933
return (
3034
<Container>
31-
<a href="/">
32-
<GithubLogo data-tip="Go to homepage" />
33-
</a>
35+
<Tooltip title="Go to homepage" placement="bottom" arrow classes={{ tooltip: classes.tooltip }}>
36+
<a href="/">
37+
<GithubLogo />
38+
</a>
39+
</Tooltip>
3440
<SearchForm onSubmit={handleSubmit}>
35-
<input placeholder="Search username" value={search} onChange={e => setSearch(e.currentTarget.value)} data-tip="Inform an username and press enter" />
36-
<button type={search ? 'submit' : 'button'} data-tip="Search username on GitHub">
37-
<SearchIcon />
38-
</button>
41+
<Tooltip title="Inform an username and press enter" placement="bottom" arrow classes={{ tooltip: classes.tooltip }}>
42+
<input placeholder="Search username" value={search} onChange={e => setSearch(e.currentTarget.value)} />
43+
</Tooltip>
44+
<Tooltip title="Search username on GitHub" placement="bottom" arrow classes={{ tooltip: classes.tooltip }}>
45+
<button type={search ? 'submit' : 'button'}>
46+
<SearchIcon />
47+
</button>
48+
</Tooltip>
3949
</SearchForm>
40-
<div className="theme" data-tip={`Activate ${themeName === 'light' ? 'Dark' : 'Light'} Mode`}>
41-
{themeName === 'light' ? <MoonIcon onClick={toggleTheme} /> : <SunIcon onClick={toggleTheme} />}
42-
</div>
50+
<Tooltip title={`Activate ${themeName === 'light' ? 'Dark' : 'Light'} Mode`} placement="bottom" arrow classes={{ tooltip: classes.tooltip }}>
51+
<div className="theme">{themeName === 'light' ? <MoonIcon onClick={toggleTheme} /> : <SunIcon onClick={toggleTheme} />}</div>
52+
</Tooltip>
4353
</Container>
4454
);
4555
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react';
2+
import { CircularProgress } from '@material-ui/core';
3+
4+
import { Container } from './styles';
5+
6+
const Loader: React.FC<{ color: string }> = ({ color = '#1D1D1D' }) => {
7+
return (
8+
<Container className="loader-container">
9+
<CircularProgress size={15} style={{ color }} />
10+
</Container>
11+
);
12+
};
13+
export default Loader;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* eslint-disable import/prefer-default-export */
2+
import styled from 'styled-components';
3+
4+
export const Container = styled.div`
5+
display: flex;
6+
justify-content: center;
7+
align-items: center;
8+
height: calc(100vh - 18px);
9+
overflow: hidden;
10+
`;

0 commit comments

Comments
 (0)