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
Binary file added 27d8ebd8-1903-478f-b9a1-30fe1b0931c2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 4f2e9808-cf3c-4711-86f3-eeb1221d2f32.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Sejam bem vindos ao Labe-commerce, esse repositório contém um esqueleto de app React e um .gitignore.

Surge: complete-camp.surge.sh
13,951 changes: 13,951 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"@testing-library/user-event": "^7.1.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1"
"react-scripts": "3.4.1",
"styled-components": "^5.2.1"
},
"scripts": {
"start": "react-scripts start",
Expand Down
50 changes: 20 additions & 30 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
.App {
h1 {
margin-top: 0;
text-align: center;
height: 70vh;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
.bottom-bar,
.top-bar{
flex: 1;
background-color: cornflowerblue;
}
}

.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;
div{
height: 50%;
width: 100%;
flex-direction: column;
justify-content: center;
text-align: center;
}

.App-link {
color: #61dafb;
img{
width: 40%;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.carrinho{
background: url('./Componentes/Img/Carrinho.png') no-repeat;
width: 1%;
border: none;
}
222 changes: 201 additions & 21 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,206 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import styled from 'styled-components'
import ListaDeProdutos from './Componentes/Produto/ListaDeProdutos'
import CarrinhoCompras from './Componentes/Carrinho/CarrinhoCompras'
import FiltroPodutos from './Componentes/FiltroPrecos/FiltroPodutos'
import img1 from './Componentes/Img/creme-1.png'
import img2 from './Componentes/Img/creme-2.png'
import img3 from './Componentes/Img/creme-3.png'
import img4 from './Componentes/Img/creme-4.png'
import img5 from './Componentes/Img/creme-5.png'
import img6 from './Componentes/Img/creme-6.png'

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
}

const Botaoabrir = styled.button`
width: 45px;
height:40px;
position: fixed;
outline: none;
margin: 0% 0% 0% 94.5%;
z-index:1000;
&:hover {
background-color: #E8E5DA;
};
`;
const Filtro = styled.section`
display: flex;
margin: 0% 2% 0% 1%;
flex-direction:column;
justify-content: center;
align-items: center;
background-color: #E8E5DA;
position: relative;
grid-row: 2;
grid-column: 1;
`
const ContainerPrincipal = styled.div`
display: grid;
grid-template-columns: 17% 83%;
grid-template-rows: 5% 90% 5%;
position: relative;
height:100vh;
width: 100vw;
`;
const Header = styled.section`
display: flex;
justify-content: center;
align-items: center;
background-color: #9EB7E5;
position: relative;
max-height:100vh;
max-width: 100vw;
grid-row: 1;
grid-column: 1/4;
`;
const Footer = styled.section`
display: flex;
justify-content: center;
align-items: center;
background-color: #9EB7E5;
position: relative;
max-height:100vh;
max-width: 100vw;
grid-row: 3;
grid-column: 1/4;
`;

const produtosLista = [
{
id: 1,
nome: 'Channel',
preco: 390,
imagem: img1,
quantidade: 1,
},
{
id: 2,
nome: 'Cartier',
preco: 189,
imagem: img2,
quantidade: 1,
},
{
id: 3,
nome: 'Roja Parfum',
preco: 998,
imagem: img3,
quantidade: 1,
},
{
id: 4,
nome: 'Christian Dior',
preco: 673,
imagem: img4,
quantidade: 1,
},
{
id: 5,
nome: 'Eau du Soir',
preco: 348,
imagem: img5,
quantidade: 1,
},
{
id: 6,
nome: 'Paco Rabanne',
preco: 1020,
imagem: img6,
quantidade: 1,
},
{
id: 7,
nome: 'Paco Rabanne',
preco: 880,
imagem: img2,
quantidade: 1,
},
{
id: 8,
nome: 'Paco Rabanne',
preco: 599,
imagem: img4,
quantidade: 1,
},
{
id: 9,
nome: 'Paco Rabanne',
preco: 1210,
imagem: img1,
quantidade: 1,
},
];

class App extends React.Component {
state = {
VisorAtivo: false,
ValorMin: 0,
ValorMax: 0,
NomeProduto: '',
}

AbrirVisor = () => {
this.setState({
VisorAtivo: !this.state.VisorAtivo
})
}
CarregarTela = () => {
if (this.state.VisorAtivo) {
return (
<CarrinhoCompras>

</CarrinhoCompras>
)
} else
return (
null

)
}

onChangemin = (e) => {
this.setState({
ValorMin: e.target.value
});
}
onChangemax = (e) => {
this.setState({
ValorMax: e.target.value
});
}
onChangename = (e) => {
this.setState({
NomeProduto: e.target.value
});
}



render() {
return (
<ContainerPrincipal>
<Botaoabrir className='carrinho'
onClick={this.AbrirVisor}>
</Botaoabrir>
{this.CarregarTela()}
<Header>
header
</Header>
<FiltroPodutos lista={produtosLista} min={this.state.ValorMin} max={this.state.ValorMax} nome={this.state.NomeProduto} />
<Filtro>
<h2>FiltroPreços</h2>
<ul>
<input type='number' placeholder="Valor Min" onChange={this.onChangemin}></input>
<input type='number' placeholder='Valor Max' onChange={this.onChangemax}></input>
<input type='string' placeholder='Nome' onChange={this.onChangename}></input>
</ul>

</Filtro>
<Footer>
footer
</Footer>
</ContainerPrincipal>
);
}
}
export default App;
48 changes: 48 additions & 0 deletions src/Componentes/Carrinho/CarrinhoCompras.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React from 'react'
import styled from 'styled-components'


const Carrinho = styled.section`
display: grid;
background-color: #CDC392;
width: 30%;
height:40%;
text-align:center;
justify-content: center;
align-items: center;
grid-row: 2;
position: absolute;
border-radius: 0% 0% 10% 10%;
margin: 0% 0% 0% 70%;
z-index:1000;
`
const ProdutoList = styled.ul`
padding: 0;
width: 200px;
`
const ProdutoItem = styled.li`
text-align: center;
width:50px;
`

class CarrinhoCompras extends React.Component{


render(){


return(
<Carrinho>
<ProdutoList>
<ProdutoItem>1</ProdutoItem>
<ProdutoItem>2</ProdutoItem>
<ProdutoItem>3</ProdutoItem>
</ProdutoList>
</Carrinho>
)

}

}

export default CarrinhoCompras
20 changes: 20 additions & 0 deletions src/Componentes/FiltroPrecos/FiltroPodutos.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import ListaDeProdutos from '../Produto/ListaDeProdutos'


function FiltroPodutos(props) {
const ListaFiltrada = props.lista.filter((produtos) => {
if (produtos.preco >= props.min) {
return true
} else {
return false
}
})

console.log(ListaFiltrada)
console.log(props)

return (<ListaDeProdutos produtos={ListaFiltrada} />)
}

export default FiltroPodutos
Binary file added src/Componentes/Img/Carrinho.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Componentes/Img/creme-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Componentes/Img/creme-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Componentes/Img/creme-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Componentes/Img/creme-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Componentes/Img/creme-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Componentes/Img/creme-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading