Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
16,719 changes: 16,719 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "fullstack-frontend",
"version": "1.0.0",
"description": "Projeto Fullstack - Frontend",
"main": "index.js",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"keywords": [],
"author": "Bruno Silva",
"license": "ISC",
"dependencies": {
"@testing-library/jest-dom": "^5.12.0",
"@testing-library/react": "^11.2.6",
"@testing-library/user-event": "^13.1.8",
"axios": "^0.21.1",
"core-js": "^3.12.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.3",
"styled-components": "^5.3.0"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
13 changes: 13 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Projeto Fullstack - Frontend</title>
</head>

<body>
<div id="root"></div>
</body>
</html>
13 changes: 13 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import GlobalState from './global/GlobalState';
import Router from './routes/Router';

function App() {
return (
<GlobalState>
<Router />
</GlobalState>
)
}

export default App
12 changes: 12 additions & 0 deletions src/global/GlobalState.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from "react"
import GlobalStateContext from "./GlobalStateContext"

const GlobalState = (props) => {
return (
<GlobalStateContext.Provider>
{props.children}
</GlobalStateContext.Provider>
)
}

export default GlobalState
5 changes: 5 additions & 0 deletions src/global/GlobalStateContext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react'

const GlobalStateContext = React.createContext()

export default GlobalStateContext;
11 changes: 11 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
9 changes: 9 additions & 0 deletions src/pages/Home/HomeScreen.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react"

const HomeScreen = () =>{
return (
<div>HomeScreen</div>
)
}

export default HomeScreen
9 changes: 9 additions & 0 deletions src/pages/ImageDetails/ImageDetailsScreen.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react"

const ImageDetailsScreen = () =>{
return (
<div>ImageDetailsScreen</div>
)
}

export default ImageDetailsScreen
7 changes: 7 additions & 0 deletions src/routes/Coordinator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const goToHomeScreen = (history) => {
history.push("/")
}

export const goToImageDetails = (history, id) => {
history.push(`/image/${id}`)
}
17 changes: 17 additions & 0 deletions src/routes/Router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from "react"
import { BrowserRouter, Route, Switch } from "react-router-dom"
import HomeScreen from "../pages/Home/HomeScreen"
import ImageDetailsScreen from "../pages/ImageDetails/ImageDetailsScreen"

const Router = () => {
return (
<BrowserRouter>
<Switch>
<Route exact path={"/"} component={HomeScreen} />
<Route exact path={"/image/:id"} component={ImageDetailsScreen} />
</Switch>
</BrowserRouter>
)
}

export default Router