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
72 changes: 11 additions & 61 deletions semana23/brainn-front-end-challenge/README.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,20 @@
# Getting Started with Create React App
# Brainn

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## O case escolhido foi o [Brainn](https://github.com/brainnco-exs/readme-frontend)

## Available Scripts
### O que funciona

In the project directory, you can run:
- Ao selecionar um jogo, os números sorteados aparecem na tela
- Responsividade

### `npm start`
### Link Surge

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
[Brainn App](https://ten-rub.surge.sh/)

The page will reload when you make changes.\
You may also see any lint errors in the console.
### Imagens

### `npm test`
<img width="1440" alt="Screen Shot 2022-02-05 at 11 26 11" src="https://user-images.githubusercontent.com/35894743/152645832-cc267cce-0b8f-4980-9bf6-fa8fa896121f.png">

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.
<img width="1440" alt="Screen Shot 2022-02-05 at 11 26 21" src="https://user-images.githubusercontent.com/35894743/152645838-85a0c9d0-d2a1-47f6-bd4e-66ac72da6553.png">

### `npm run 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.

### `npm run 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)

### `npm run 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)
<img width="341" alt="Screen Shot 2022-02-05 at 11 26 54" src="https://user-images.githubusercontent.com/35894743/152645844-9c520386-ed25-43e0-bbd7-92489742b576.png">

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,67 +1,52 @@
const Dropdown = () => {
import { Sidebar } from "./styled";

const Dropdown = ({ selected, setMostraConcurso, mostraConcurso }) => {
const onChangeValue = (mostraConcurso) => {
setMostraConcurso(mostraConcurso);
};

return (
<div className="w-50 p-3 h-100 d-flex flex-column justify-content-between">
<div className="dropdown ">
<Sidebar>
<div className="dropdown mb-3">
<button
className="btn btn-secondary dropdown-toggle"
className="btn dropdown-toggle bg-light "
type="button"
id="dropdownMenuButton1"
data-bs-toggle="dropdown"
aria-expanded="false"
>
Selecione uma opção
{mostraConcurso.nome || "Selecione uma opção"}
</button>

<ul
className="dropdown-menu"
aria-labelledby="dropdownMenuButton1"
>
<li>
<a className="dropdown-item" href="#">
Mega-sena
</a>
</li>

<li>
<a className="dropdown-item" href="#">
Quina
</a>
</li>

<li>
<a className="dropdown-item" href="#">
Lotofácil
</a>
</li>

<li>
<a className="dropdown-item" href="#">
Lotomania
</a>
</li>

<li>
<a className="dropdown-item" href="#">
Timemania
</a>
</li>

<li>
<a className="dropdown-item" href="#">
Dia de sorte
</a>
</li>
{selected &&
selected.map((item, index) => {
return (
<li
key={index}
onClick={() => onChangeValue(item)}
value={item}
>
<a className="dropdown-item" href="#">
{item.nome}
</a>
</li>
);
})}
</ul>
</div>

<div>
<h2>Mega-sena</h2>
<div className="mb-3">
<h2>{mostraConcurso.nome}</h2>
</div>

<div>
<p>Concurso número 000</p>
</div>
</div>
</Sidebar>
);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import styled from "styled-components";

export const Sidebar = styled.div`
background-color: #6befa3;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
width: 40%;
color: white;
padding: 2em 1em;

@media screen and (max-width: 824px) {
width: 100%;
height: 45%;
}
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Circle, ContainerCircle, Span } from "./styled";

const Lottery = ({ concursoSelecionado }) => {
return (
<ContainerCircle>
{concursoSelecionado.numeros &&
concursoSelecionado.numeros.map((item, index) => {
return (
<Circle key={index}>
<Span>{item}</Span>
</Circle>
);
})}
</ContainerCircle>
);
};

export default Lottery;
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import styled from "styled-components";

export const ContainerCircle = styled.div`
background-color: #f2f2f2;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: 20px;
width: 100%;
height: 100vh;
padding: 1em;
`;

export const Circle = styled.div`
background-color: #fff;
width: 100px;
height: 100px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
`;

export const Span = styled.span`
font-size: 2rem;
`;

This file was deleted.

This file was deleted.

8 changes: 8 additions & 0 deletions semana23/brainn-front-end-challenge/src/constants/urls.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const BASE_URL =
"https://brainn-api-loterias.herokuapp.com/api/v1/loterias";

export const LOTERIA_CONCURSOS_URL =
"https://brainn-api-loterias.herokuapp.com/api/v1/loterias-concursos";

export const CONCURSO_URL =
"https://brainn-api-loterias.herokuapp.com/api/v1/concursos/";
Loading