-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
1,837 additions
and
169 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/reportWebVitals.jsx |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"extends": "airbnb" | ||
"env": { | ||
"browser": true, | ||
"jest": true, | ||
} | ||
"rules": { | ||
"allowShortCircuit": 0, | ||
"allowTernary": 0, | ||
"no-unused-expressions": "off", | ||
"no-mixed-operators": "off" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
- name: git config | ||
run: | | ||
git config user.name github-pages-deploy-action | ||
git config user.email github-pages-deploy-action@@users.noreply.github.com | ||
git remote set-url origin https://${{github.actor}}:${{github.token}}@github.com/${{github.repository}}.git | ||
- run: yarn install | ||
- run: yarn build | ||
env: | ||
REACT_APP_GITHUB_PAT: ${{ secrets.REACT_APP_GITHUB_PAT }} | ||
- run: yarn deploy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
- run: yarn install | ||
- run: yarn test | ||
env: | ||
REACT_APP_GITHUB_PAT: ${{ secrets.REACT_APP_GITHUB_PAT }} | ||
- run: yarn lint | ||
- uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Change Log | ||
|
||
## [2020.12.10] | ||
- Initial UI release |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,30 @@ | ||
# Getting Started with Create React App | ||
# GitPop3 | ||
|
||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). | ||
[![Tests](https://github.com/AndreMiras/gitpop3/workflows/Tests/badge.svg?branch=develop)](https://github.com/AndreMiras/gitpop3/actions?query=workflow%3ATests) | ||
[![Coverage Status](https://coveralls.io/repos/github/AndreMiras/gitpop3/badge.svg?branch=develop)](https://coveralls.io/github/AndreMiras/gitpop3?branch=develop) | ||
[![Deploy](https://github.com/AndreMiras/gitpop3/workflows/Deploy/badge.svg?branch=develop)](https://github.com/AndreMiras/gitpop3/actions?query=workflow%3ADeploy) | ||
|
||
## Available Scripts | ||
Find the most popular fork on GitHub. | ||
|
||
In the project directory, you can run: | ||
<https://andremiras.github.io/gitpop3/> | ||
|
||
### `yarn start` | ||
This is a rewrite of [GitPop2](https://github.com/AndreMiras/gitpop2) using only frontend tech. | ||
|
||
Runs the app in the development mode.\ | ||
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. | ||
## Run | ||
```sh | ||
yarn start | ||
``` | ||
|
||
The page will reload if you make edits.\ | ||
You will also see any lint errors in the console. | ||
## Test | ||
```sh | ||
yarn lint | ||
yarn test | ||
``` | ||
|
||
### `yarn test` | ||
|
||
Launches the test runner in the interactive watch mode.\ | ||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. | ||
|
||
### `yarn build` | ||
|
||
Builds the app for production to the `build` folder.\ | ||
It correctly bundles React in production mode and optimizes the build for the best performance. | ||
|
||
The build is minified and the filenames include the hashes.\ | ||
Your app is ready to be deployed! | ||
|
||
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. | ||
|
||
### `yarn eject` | ||
|
||
**Note: this is a one-way operation. Once you `eject`, you can’t go back!** | ||
|
||
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. | ||
|
||
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. | ||
|
||
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. | ||
|
||
## Learn More | ||
|
||
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). | ||
|
||
To learn React, check out the [React documentation](https://reactjs.org/). | ||
|
||
### Code Splitting | ||
|
||
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) | ||
|
||
### Analyzing the Bundle Size | ||
|
||
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) | ||
|
||
### Making a Progressive Web App | ||
|
||
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) | ||
|
||
### Advanced Configuration | ||
|
||
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) | ||
|
||
### Deployment | ||
|
||
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) | ||
|
||
### `yarn build` fails to minify | ||
|
||
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) | ||
## Deployment | ||
The app can be deployed on GitHub pages when releasing via: | ||
```sh | ||
yarn deploy | ||
``` | ||
Note a [Personal Access Token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) should be generated and set to its base64 form to the `REACT_APP_GITHUB_PAT` environment variable. | ||
This is required for [Authenticating with GraphQL](https://docs.github.com/en/free-pro-team@latest/graphql/guides/forming-calls-with-graphql#authenticating-with-graphql). |
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
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +0,0 @@ | ||
.App { | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
} | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import './App.css'; | ||
import 'bootstrap/dist/css/bootstrap.min.css'; | ||
import { library } from '@fortawesome/fontawesome-svg-core'; | ||
import { fab } from '@fortawesome/free-brands-svg-icons'; | ||
import { fas } from '@fortawesome/free-solid-svg-icons'; | ||
import Container from './components/Container'; | ||
import Footer from './components/Footer'; | ||
import Navigation from './components/Navigation'; | ||
|
||
library.add(fab, fas); | ||
|
||
function App() { | ||
return ( | ||
<div className="App"> | ||
<Navigation /> | ||
<Container /> | ||
<Footer /> | ||
</div> | ||
); | ||
} | ||
|
||
export default App; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import App from './App'; | ||
|
||
test('renders learn react link', () => { | ||
test('renders title', () => { | ||
render(<App />); | ||
const linkElement = screen.getByText(/learn react/i); | ||
const linkElement = screen.getByText(/GitPop3/); | ||
expect(linkElement).toBeInTheDocument(); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React, { useState } from 'react'; | ||
import { Container as ReactContainer } from 'react-bootstrap'; | ||
import PopForm from './PopForm'; | ||
import ResultTable from './ResultTable'; | ||
import searchPopularForks from '../utils/search'; | ||
|
||
const Container = () => { | ||
const [forks, setForks] = useState(); | ||
const [activePage, setActivePage] = useState(1); | ||
const [loading, setLoading] = useState(false); | ||
const onResult = (result) => { | ||
setForks(result.data.repository.forks.nodes); | ||
setLoading(false); | ||
}; | ||
const onSubmit = (url) => { | ||
setLoading(true); | ||
searchPopularForks(url, onResult); | ||
}; | ||
const resultTable = ( | ||
forks | ||
? ( | ||
<ResultTable | ||
forks={forks} | ||
activePage={activePage} | ||
itemsCountPerPage={10} | ||
onPageChange={setActivePage} | ||
/> | ||
) | ||
: null | ||
); | ||
return ( | ||
<ReactContainer> | ||
<PopForm onSubmit={onSubmit} loading={loading} /> | ||
{resultTable} | ||
</ReactContainer> | ||
); | ||
}; | ||
|
||
export default Container; |
Oops, something went wrong.