From feacb7882136b5c76f05e0e2d908eab7f2fbcf1b Mon Sep 17 00:00:00 2001 From: Paulo Date: Sat, 21 Jan 2023 17:03:54 -0300 Subject: [PATCH 1/2] wip --- .gitignore | 1 + README.md => back-end/README.md | 0 back-end/index.js | 145 ++++ back-end/package.json | 12 + back-end/yarn.lock | 418 ++++++++++++ front-end/.gitignore | 24 + front-end/index.html | 17 + front-end/package.json | 29 + front-end/public/img_10303-3781000848 | Bin 0 -> 13415 bytes front-end/public/vite.svg | 1 + front-end/src/App.css | 41 ++ front-end/src/App.tsx | 137 ++++ front-end/src/AppStyles.tsx | 35 + front-end/src/CarDetailsModal.tsx | 101 +++ front-end/src/Card.tsx | 101 +++ front-end/src/EditCarModal.tsx | 186 +++++ front-end/src/Filtros.tsx | 26 + front-end/src/Header.tsx | 46 ++ front-end/src/NewCarModal.tsx | 199 ++++++ front-end/src/Service/Api.ts | 55 ++ front-end/src/Service/Http.ts | 10 + front-end/src/assets/react.svg | 1 + front-end/src/index.css | 92 +++ front-end/src/main.tsx | 10 + front-end/src/vite-env.d.ts | 1 + front-end/tsconfig.json | 21 + front-end/tsconfig.node.json | 9 + front-end/vite.config.ts | 7 + front-end/yarn.lock | 942 ++++++++++++++++++++++++++ 29 files changed, 2667 insertions(+) create mode 100644 .gitignore rename README.md => back-end/README.md (100%) create mode 100644 back-end/index.js create mode 100644 back-end/package.json create mode 100644 back-end/yarn.lock create mode 100644 front-end/.gitignore create mode 100644 front-end/index.html create mode 100644 front-end/package.json create mode 100644 front-end/public/img_10303-3781000848 create mode 100644 front-end/public/vite.svg create mode 100644 front-end/src/App.css create mode 100644 front-end/src/App.tsx create mode 100644 front-end/src/AppStyles.tsx create mode 100644 front-end/src/CarDetailsModal.tsx create mode 100644 front-end/src/Card.tsx create mode 100644 front-end/src/EditCarModal.tsx create mode 100644 front-end/src/Filtros.tsx create mode 100644 front-end/src/Header.tsx create mode 100644 front-end/src/NewCarModal.tsx create mode 100644 front-end/src/Service/Api.ts create mode 100644 front-end/src/Service/Http.ts create mode 100644 front-end/src/assets/react.svg create mode 100644 front-end/src/index.css create mode 100644 front-end/src/main.tsx create mode 100644 front-end/src/vite-env.d.ts create mode 100644 front-end/tsconfig.json create mode 100644 front-end/tsconfig.node.json create mode 100644 front-end/vite.config.ts create mode 100644 front-end/yarn.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/README.md b/back-end/README.md similarity index 100% rename from README.md rename to back-end/README.md diff --git a/back-end/index.js b/back-end/index.js new file mode 100644 index 00000000..c83b7853 --- /dev/null +++ b/back-end/index.js @@ -0,0 +1,145 @@ +const express = require("express"); +const cors = require("cors"); + +const server = express(); + +server.use(cors()); +server.use(express.json()); +let carros = [ + { + id: 1, + nome: "Gol", + marca: "Volkswagen", + anoDeFabricacao: 2016, + desc: "", + imagem: + "https://images.kavak.services/images/25650/volkswagen-gol-hatch-back-cl2016-frontal-lateral-piloto-cercana-1604970955144.jpg", + proprietario: { + nome: "Paulo", + email: "paulo@gmail.com", + telefone: "2515144151", + }, + }, + { + id: 2, + nome: "Onix", + marca: "Chevrolet", + anoDeFabricacao: 2018, + desc: "", + imagem: + "http://www.listadecarros.com/wp-content/uploads/2016/02/Chevrolet-Onix-2016-6.jpg", + proprietario: { + nome: "Carlos", + email: "carlos@gmail.com", + telefone: "2515144151", + }, + }, + { + id: 3, + nome: "Mobi", + marca: "Fiat", + anoDeFabricacao: 2022, + desc: "", + imagem: "https://i.ytimg.com/vi/AHdB26vhiuk/maxresdefault.jpg", + proprietario: { + nome: "João", + email: "joao@gmail.com", + telefone: "2515144151", + }, + }, + { + id: 4, + nome: "S10", + marca: "Chevrolet", + anoDeFabricacao: 2015, + desc: "", + imagem: + "https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fs1.cdn.autoevolution.com%2Fimages%2Fnews%2Fgallery%2F2021-chevrolet-s10-pickup-truck-revealed-its-the-colorados-brazilian-brother_3.jpg&f=1&nofb=1&ipt=fa7e1a7d2246196942085764002b1a22e96bd71a7da41d22e8f8fc4114c0ffbe&ipo=images", + proprietario: { + nome: "Carlos", + email: "carlos@gmail.com", + telefone: "2515144151", + }, + }, +]; + +server.get("/carros", (req, res) => { + return res.json(carros); +}); + +server.get("/carros/:index", (req, res) => { + const { index } = req.params; + const carro = carros.find((carro) => carro.id === +index); + if (!!carro) { + return res.json(carro); + } else { + return res.status(404).json("Carro não encontrado."); + } +}); + +server.post("/carros", (req, res) => { + const carroInput = req.body; + const carro = { + id: carros.length + 1, + nome: carroInput.nome, + marca: carroInput.marca, + imagem: carroInput.imagem, + anoDeFabricacao: carroInput.anoDeFabricacao, + desc: carroInput.desc, + proprietario: carroInput.proprietario, + }; + + carros.push(carro); + return res.json(carro); +}); + +server.put("/carro/:index", (req, res) => { + const { index } = req.params; + const carroInput = req.body; + + const carroExiste = carros.some((carro) => carro.id === +index); + + if (!carroExiste) return res.status(404).json("Carro não encontrado."); + const carro = carros.find((carro) => carro.id === +index); + + console.log(carro); + + carro.nome = !!carroInput?.nome ? carroInput?.nome : carro.nome; + carro.anoDeFabricacao = carroInput?.anoDeFabricacao + ? carroInput?.anoDeFabricacao + : carro.anoDeFabricacao; + carro.marca = carroInput?.marca || carro.marca; + carro.imagem = carroInput?.imagem || carro.imagem; + carro.proprietario.nome = + carroInput?.proprietario?.nome || carro.proprietario.nome; + carro.proprietario.email = + carroInput?.proprietario?.email || carro.proprietario.email; + carro.proprietario.telefone = + carroInput?.proprietario?.telefone || carro.proprietario.telefone; + + const carroEdicao = { + id: +index, + nome: carroInput?.nome, + marca: carroInput?.marca, + imagem: carroInput?.imagem, + anoDeFabricacao: carroInput?.anoDeFabricacao, + desc: carroInput?.desc, + proprietario: carroInput?.proprietario, + }; + + carros.splice(index - 1, 1, carro); + return res.json(carro); +}); + +server.delete("/carro/:index", (req, res) => { + const { index } = req.params; + // const carroDeletado = carros.splice(index - 1, 1); + if (carros.some((carro) => carro.id === +index)) { + carros = carros?.filter((carro) => carro?.id !== +index); + return res.json(`Carro com id: ${index} deletado!`); + } else { + return res.status(404).json("Carro não encontrado."); + } +}); + +server.listen(3000); diff --git a/back-end/package.json b/back-end/package.json new file mode 100644 index 00000000..0de12623 --- /dev/null +++ b/back-end/package.json @@ -0,0 +1,12 @@ +{ + "name": "desafio-dev-junior-b2u", + "version": "1.0.0", + "main": "index.js", + "repository": "git@github.com:pvpmartins/desafio-dev-junior-b2u.git", + "author": "Paulo ", + "license": "MIT", + "dependencies": { + "cors": "^2.8.5", + "express": "^4.18.2" + } +} diff --git a/back-end/yarn.lock b/back-end/yarn.lock new file mode 100644 index 00000000..bd0cf4cb --- /dev/null +++ b/back-end/yarn.lock @@ -0,0 +1,418 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +accepts@~1.3.8: + version "1.3.8" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" + integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== + dependencies: + mime-types "~2.1.34" + negotiator "0.6.3" + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== + +body-parser@1.20.1: + version "1.20.1" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" + integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== + dependencies: + bytes "3.1.2" + content-type "~1.0.4" + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" + iconv-lite "0.4.24" + on-finished "2.4.1" + qs "6.11.0" + raw-body "2.5.1" + type-is "~1.6.18" + unpipe "1.0.0" + +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== + +call-bind@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +content-disposition@0.5.4: + version "0.5.4" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" + integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== + dependencies: + safe-buffer "5.2.1" + +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== + +cookie@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" + integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== + +cors@^2.8.5: + version "2.8.5" + resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" + integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== + dependencies: + object-assign "^4" + vary "^1" + +debug@2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +depd@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + +destroy@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" + integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== + +encodeurl@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== + +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== + +express@^4.18.2: + version "4.18.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" + integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== + dependencies: + accepts "~1.3.8" + array-flatten "1.1.1" + body-parser "1.20.1" + content-disposition "0.5.4" + content-type "~1.0.4" + cookie "0.5.0" + cookie-signature "1.0.6" + debug "2.6.9" + depd "2.0.0" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "1.2.0" + fresh "0.5.2" + http-errors "2.0.0" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "2.4.1" + parseurl "~1.3.3" + path-to-regexp "0.1.7" + proxy-addr "~2.0.7" + qs "6.11.0" + range-parser "~1.2.1" + safe-buffer "5.2.1" + send "0.18.0" + serve-static "1.15.0" + setprototypeof "1.2.0" + statuses "2.0.1" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + +finalhandler@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" + integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "2.4.1" + parseurl "~1.3.3" + statuses "2.0.1" + unpipe "~1.0.0" + +forwarded@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" + integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== + +fresh@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +get-intrinsic@^1.0.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" + integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + +has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +http-errors@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== + dependencies: + depd "2.0.0" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses "2.0.1" + toidentifier "1.0.1" + +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +inherits@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@~2.1.24, mime-types@~2.1.34: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +mime@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== + +ms@2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +negotiator@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" + integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== + +object-assign@^4: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + +object-inspect@^1.9.0: + version "1.12.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" + integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== + +on-finished@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" + integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== + dependencies: + ee-first "1.1.1" + +parseurl@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== + +proxy-addr@~2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" + integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== + dependencies: + forwarded "0.2.0" + ipaddr.js "1.9.1" + +qs@6.11.0: + version "6.11.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" + integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== + dependencies: + side-channel "^1.0.4" + +range-parser@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + +raw-body@2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" + integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + +safe-buffer@5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +send@0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" + integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== + dependencies: + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "2.0.0" + mime "1.6.0" + ms "2.1.3" + on-finished "2.4.1" + range-parser "~1.2.1" + statuses "2.0.1" + +serve-static@1.15.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" + integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.18.0" + +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + +statuses@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== + +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== + +type-is@~1.6.18: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== + +vary@^1, vary@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== diff --git a/front-end/.gitignore b/front-end/.gitignore new file mode 100644 index 00000000..a547bf36 --- /dev/null +++ b/front-end/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/front-end/index.html b/front-end/index.html new file mode 100644 index 00000000..443b9b2e --- /dev/null +++ b/front-end/index.html @@ -0,0 +1,17 @@ + + + + + + + + AutoCars + + +
+ + + diff --git a/front-end/package.json b/front-end/package.json new file mode 100644 index 00000000..b7ac3f4d --- /dev/null +++ b/front-end/package.json @@ -0,0 +1,29 @@ +{ + "name": "front-end", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview" + }, + "dependencies": { + "@fortawesome/fontawesome-svg-core": "^6.2.1", + "@fortawesome/free-regular-svg-icons": "^6.2.1", + "@fortawesome/free-solid-svg-icons": "^6.2.1", + "@fortawesome/react-fontawesome": "^0.2.0", + "@types/styled-components": "^5.1.26", + "axios": "^1.2.3", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "styled-components": "^5.3.6" + }, + "devDependencies": { + "@types/react": "^18.0.26", + "@types/react-dom": "^18.0.9", + "@vitejs/plugin-react": "^3.0.0", + "typescript": "^4.9.3", + "vite": "^4.0.0" + } +} diff --git a/front-end/public/img_10303-3781000848 b/front-end/public/img_10303-3781000848 new file m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UmZF#q<|$3Zdjy3%cH8BiO79q$w8M z#-5^ry=0n`i>u8e&CQ{v5%APmcoa@-Ig31;CwZO6o5`?it62W|I06HDzuRf+@;iW2 zE#^;!1n?IE(0kSu{L;L<*+TrCAWz!sCzVu^N=v3f6XuUOS@WbrCVv{fFlSk&GZf4_ zT6)KwDop>;zB~U+R)%=0S{=z-pCB^(S2|=7Uo^0wIdr;IM!!v!peC6K8|coRP6zIq zf@~ktb(>aA1aN}%6swLCSAdc6<=UI?vsOhFc^Ph0_LN5rKyRAU>-ciCfH(1F@Ss4H zg2ynNS_0K&FPwg5RRqe+AT%n3c8)Eo_{BR=QC8FfaIEn&I;AE++0mlMVJI(gwy@_l zN-D{6>IhXkbZx~Q<7}Br@EJm9P?7B6OOW=qNqmdTzYw66o1xr}>*Y`DAv&Bs8_p{f zOasWzm{Yb7{?l{(?8yXGkL8J$LhK{l-72MWq}WiFn75i<#2T6SS0)fOmse~cRcAcV zDI7xA`tHd`1zXLC*C<{!Gj;cva_^|@b4OEt9gVr6l6 zgAjHv|2}wG9@OdGOA=T4$J|*X`>m1%L`wH}oLkjIWdJA&UUUH48lx2 zp2q)p{DGAk(B7EC9d0S9H#_>CBbEhsS8UpFsUndigMz%OAQb2?yL;*5&3SU|P%r}g z@rKDoTF1r2$i-9y=41*yuz0w5xH-6ZIe7Rrc(_Ek1Vy;H*|~r(Tt3_MRsSD?t-Xn* qnFoNtEx^IW$H6V20YLKziSP^jKZH+ClivXZtPj%4kka>tzW)aVuXF+c literal 0 HcmV?d00001 diff --git a/front-end/public/vite.svg b/front-end/public/vite.svg new file mode 100644 index 00000000..e7b8dfb1 --- /dev/null +++ b/front-end/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/src/App.css b/front-end/src/App.css new file mode 100644 index 00000000..6adb808a --- /dev/null +++ b/front-end/src/App.css @@ -0,0 +1,41 @@ +#root { + /* max-width: 1280px; */ + margin: 0 auto; + /* padding: 2rem; */ + text-align: center; +} + +.logo { + height: 6em; + padding: 1.5em; + will-change: filter; +} +.logo:hover { + filter: drop-shadow(0 0 2em #646cffaa); +} +.logo.react:hover { + filter: drop-shadow(0 0 2em #61dafbaa); +} + +@keyframes logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} + +@media (prefers-reduced-motion: no-preference) { + a:nth-of-type(2) .logo { + animation: logo-spin infinite 20s linear; + } +} + +.card { + padding: 2em; +} + +.read-the-docs { + color: #888; +} diff --git a/front-end/src/App.tsx b/front-end/src/App.tsx new file mode 100644 index 00000000..aa7bf7b1 --- /dev/null +++ b/front-end/src/App.tsx @@ -0,0 +1,137 @@ +import { useEffect, useState } from "react"; +import reactLogo from "./assets/react.svg"; +import "./App.css"; +import Header from "./Header"; +import { + deleteCarro, + getCarros, + ICarro, + postCarro, + putCarro, +} from "./Service/Api"; +import Card from "./Card"; +import styled from "styled-components"; +import AppStyles from "./AppStyles"; +import NewCarModal from "./NewCarModal"; +import CarDetailsModal from "./CarDetailsModal"; +import EditCarModal from "./EditCarModal"; +import Filtros from "./Filtros"; + +const ListaCarros = styled.div` + display: grid; + grid-auto-flow: column; + grid-template-rows: auto; + justify-items: center; + /* grid-auto-columns: 25%; */ + gap: 5.1rem; + padding-inline: 5rem; + padding-block: 3rem; + overflow-x: auto; + overscroll-behavior-inline: contain; +`; + +function App() { + const [listaCarros, setListaCarros] = useState() as any[]; + const [listaCarrosFilter, setListaCarrosFilter] = useState() as any[]; + const [showNewCar, setShowNewCar] = useState(false); + const [showCarDetails, setShowCarDetails] = useState(false); + const [showCarEdition, setShowCarEdition] = useState(false); + const [carro, setCarro] = useState(); + + const listarCarros = async () => { + const carros = await getCarros(); + setListaCarros(carros); + }; + + const deletarCarro = async (id: number) => { + const carro = await deleteCarro(id); + listarCarros(); + }; + + const inserirCarro = async (car: ICarro) => { + const carro = await postCarro(car); + listarCarros(); + }; + + const exibirCarroDetalhes = (car: ICarro) => { + setCarro(car); + if (!!car) { + setShowCarDetails(true); + } + }; + + const editarCarro = async (id: number, newCar: ICarro) => { + const car = putCarro(id, newCar); + console.log({ id }); + + listarCarros(); + }; + + const filtrarMarca = (marca: string) => { + if (marca === "Todas") { + listarCarros(); + setListaCarrosFilter(listaCarros); + return; + } + const filteredByMarca = listaCarros.filter( + (carro: ICarro) => carro.marca === marca + ); + setListaCarrosFilter(filteredByMarca); + }; + + useEffect(() => { + listarCarros(); + }, []); + + useEffect(() => { + setListaCarrosFilter(listaCarros); + }, [listaCarros]); + + return ( + <> + +
+ + + {!!listaCarrosFilter && + listaCarrosFilter.map((carro: any) => ( + + ))} + + +
setShowNewCar(true)} className="add-car"> +
+
+

Cadastrar novo veículo

+
+ {showNewCar && ( + + )} + {showCarDetails && ( + + )} + {showCarEdition && ( + + )} + + + ); +} + +export default App; diff --git a/front-end/src/AppStyles.tsx b/front-end/src/AppStyles.tsx new file mode 100644 index 00000000..dcf456f6 --- /dev/null +++ b/front-end/src/AppStyles.tsx @@ -0,0 +1,35 @@ +import styled from "styled-components"; + +const AppStyles = styled.div` + & .add-car { + position: relative; + transform: translateX(-50%); + padding-top: 2rem; + display: flex; + align-items: center; + justify-content: center; + width: max-content; + left: 50%; + &__btn { + display: flex; + align-items: center; + color: white; + justify-content: center; + font-size: 3rem; + position: relative; + width: 3rem; + height: 3rem; + background-color: orangered; + border-radius: 50rem; + transition: width 50ms ease-in-out, height 50ms ease-in-out; + } + &:hover { + & .add-car__btn { + width: 3.5rem; + height: 3.5rem; + } + } + } +`; + +export default AppStyles; diff --git a/front-end/src/CarDetailsModal.tsx b/front-end/src/CarDetailsModal.tsx new file mode 100644 index 00000000..759baaee --- /dev/null +++ b/front-end/src/CarDetailsModal.tsx @@ -0,0 +1,101 @@ +import styled from "styled-components"; +import { ICarro } from "./Service/Api"; + +const CarDetailsModal = ({ carro, setShowCarDetails }): any => { + const ModalDetailsStyles = styled.div` + display: flex; + justify-content: center; + align-items: center; + & .shadow { + position: fixed; + width: 100vw; + height: 100vh; + background-color: #00000036; + top: 0; + left: 0; + } + & .modal { + position: absolute; + display: flex; + background-color: white; + top: 50%; + transform: translateY(-50%); + padding: 2rem; + gap: 3rem; + } + & .carro-details { + display: flex; + flex-direction: column; + } + & .vendedor-details { + display: flex; + gap: 1rem; + flex-direction: column; + } + & .escape-btn { + position: absolute; + border-radius: 5rem; + width: 2rem; + height: 2rem; + right: -0.7rem; + top: -0.7rem; + background-color: white; + color: black; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 1px 1px 5px black; + opacity: 40%; + transition: opacity 50ms ease-in-out; + &:hover { + opacity: 100%; + } + & i { + font-size: 1.3rem; + } + } + & img { + width: max-content; + height: 200px; + } + `; + return ( + +
+
+
setShowCarDetails(false)} className="escape-btn"> + {" "} + +
+ +
+ + + + +

+ Descrição:
{carro.desc ? carro.desc : "Sem descrição"} +

+
+
+ + + + +
+
+
+ ); +}; + +export default CarDetailsModal; diff --git a/front-end/src/Card.tsx b/front-end/src/Card.tsx new file mode 100644 index 00000000..11fe9ccd --- /dev/null +++ b/front-end/src/Card.tsx @@ -0,0 +1,101 @@ +import React from "react"; +import styled from "styled-components"; +import CarDetailsModal from "./CarDetailsModal"; + +const CardStyles = styled.div` + position: relative; + width: 15rem; + height: 20rem; + background-color: #054caadc; + color: white; + border-radius: 0.7rem; + display: flex; + flex-direction: column; + justify-content: flex-start; + box-shadow: 3px 2px 7px black; + align-items: center; + padding: 0.5rem 0; + & img { + max-width: 14rem; + border-radius: 0.3rem; + } + & .delete { + position: absolute; + border-radius: 5rem; + width: 2rem; + height: 2rem; + right: -0.7rem; + top: -0.7rem; + background-color: white; + color: black; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 1px 1px 5px black; + opacity: 40%; + transition: opacity 50ms ease-in-out; + &:hover { + opacity: 100%; + } + & i { + font-size: 1.3rem; + } + } + & .edit-btn { + position: absolute; + left: 1rem; + & i { + cursor: pointer; + opacity: 30%; + transition: opacity 50ms ease-in-out; + font-size: 1.3rem; + &:hover { + opacity: 100%; + } + } + } + & .detalhes { + position: absolute; + bottom: 2rem; + } +`; + +const Card = ({ + carro, + deletarCarro, + exibirCarroDetalhes, + setShowCarEdition, + setCarro, +}: any) => { + return ( + +
deletarCarro(carro.id)} className="delete"> + +
+
{ + setShowCarEdition(true); + setCarro(carro); + }} + > + +
+ + + + {!!carro.anoDeFabricacao &&

Ano: {carro.anoDeFabricacao}

} + + +
+ ); +}; + +export default Card; diff --git a/front-end/src/EditCarModal.tsx b/front-end/src/EditCarModal.tsx new file mode 100644 index 00000000..40adab0b --- /dev/null +++ b/front-end/src/EditCarModal.tsx @@ -0,0 +1,186 @@ +import React, { useState } from "react"; +import styled from "styled-components"; + +const EditModalStyles = styled.div` + & .shadow { + position: fixed; + background-color: #0000004c; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + } + & .title { + position: relative; + font-weight: bold; + font-size: 1.4rem; + margin-top: -0.7rem; + bottom: 5px; + padding: 0.1rem 1rem; + color: black; + } + & form { + border-radius: 2rem; + padding: 2rem 1rem; + position: absolute; + display: flex; + flex-direction: column; + background-color: white; + padding: 1rem 2rem; + z-index: 4; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + align-items: center; + & input { + width: 20rem; + } + & .carro-edited { + margin-bottom: 2rem; + } + & .escape-btn { + position: absolute; + border-radius: 5rem; + width: 2rem; + height: 2rem; + right: -0.7rem; + top: -0.7rem; + background-color: white; + color: black; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 1px 1px 5px black; + opacity: 40%; + transition: opacity 50ms ease-in-out; + &:hover { + opacity: 100%; + } + & i { + font-size: 1.3rem; + } + } + & .vendedor { + display: flex; + flex-direction: column; + align-items: center; + width: 60%; + & input { + width: 15rem; + } + } + & button { + position: relative; + top: 7px; + background-color: orangered; + color: white; + } + } +`; + +const EditCarModal = ({ + setCarroEdition, + setShowCarEdition, + carro, + editarCarro, +}) => { + const [nome, setNome] = useState(""); + const [marca, setMarca] = useState(""); + const [ano, setAno] = useState(0); + const [img, setImg] = useState(""); + const [desc, setDesc] = useState(""); + const [nomeVendedor, setNomeVendedor] = useState(""); + const [email, setEmail] = useState(""); + const [phone, setPhone] = useState(""); + + const newCar = { + nome: nome, + marca: marca, + anoDeFabricacao: ano, + desc: desc, + imagem: img, + proprietario: { + nome: nomeVendedor, + email: email, + telefone: phone, + }, + }; + + return ( + +
+
{ + e.preventDefault(); + + editarCarro(carro.id, newCar); + }} + > + + +
setShowCarEdition(false)} className="escape-btn"> + +
+ + setNome(e.target.value)} type="text" /> + + setMarca(e.target.value)} + id="marca" + type="text" + /> + + setAno(+e.target.value)} + id="ano" + min="1900" + max="2099" + step="1" + type="number" + /> + + setImg(e.target.value)} type="text" id="link" /> + +