From f173a4c326e15ecf7a8274fafaacaedda06bcfe2 Mon Sep 17 00:00:00 2001 From: Mateus Lopes <73197343+progmateus@users.noreply.github.com> Date: Sun, 15 Jan 2023 15:55:54 -0300 Subject: [PATCH 01/11] form search product --- next.config.js | 4 + package.json | 8 +- pages/index.js | 8 - src/components/formSearchProducts/index.jsx | 18 + src/components/formSearchProducts/style.js | 38 ++ src/components/header/index.jsx | 15 + src/components/header/style.js | 28 ++ {pages => src/pages}/_app.js | 0 src/pages/index.js | 13 + src/styles/global.js | 10 + yarn.lock | 497 ++++++++++++++++---- 11 files changed, 533 insertions(+), 106 deletions(-) delete mode 100644 pages/index.js create mode 100644 src/components/formSearchProducts/index.jsx create mode 100644 src/components/formSearchProducts/style.js create mode 100644 src/components/header/index.jsx create mode 100644 src/components/header/style.js rename {pages => src/pages}/_app.js (100%) create mode 100644 src/pages/index.js create mode 100644 src/styles/global.js diff --git a/next.config.js b/next.config.js index ae887958..fee3272f 100644 --- a/next.config.js +++ b/next.config.js @@ -2,6 +2,10 @@ const nextConfig = { reactStrictMode: true, swcMinify: true, + compiler: { + // ssr and displayName are configured by default + styledComponents: true, + }, } module.exports = nextConfig diff --git a/package.json b/package.json index d6d970b0..bccd97b2 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,11 @@ "lint": "next lint" }, "dependencies": { - "next": "13.0.6", - "react": "18.2.0", - "react-dom": "18.2.0" + "next": "^13.1.2", + "react": "^18.2.0", + "react-dom": "18.2.0", + "react-icons": "^4.7.1", + "styled-components": "^5.3.6" }, "devDependencies": { "eslint": "8.29.0", diff --git a/pages/index.js b/pages/index.js deleted file mode 100644 index f80b4ce2..00000000 --- a/pages/index.js +++ /dev/null @@ -1,8 +0,0 @@ - -export default function Home() { - return ( -
-

Hello, World!

-
- ) -} diff --git a/src/components/formSearchProducts/index.jsx b/src/components/formSearchProducts/index.jsx new file mode 100644 index 00000000..993477a9 --- /dev/null +++ b/src/components/formSearchProducts/index.jsx @@ -0,0 +1,18 @@ +import { Container } from "./style" +import { BsSearch } from "react-icons/bs"; + +const FormSearchProducts = () => { + return ( + +
+

Buscar produtos

+
+ + +
+
+
+ ) +} + +export { FormSearchProducts } \ No newline at end of file diff --git a/src/components/formSearchProducts/style.js b/src/components/formSearchProducts/style.js new file mode 100644 index 00000000..dcd321ef --- /dev/null +++ b/src/components/formSearchProducts/style.js @@ -0,0 +1,38 @@ +import styled from "styled-components"; + + +export const Container = styled.div` + margin-top: 1.5rem; + display: flex; + justify-content: center; + + div{ + + h1{ + color: black; + font-size: 36px; + text-align: center; + } + + div{ + display: flex; + width: 22rem; + height: 2.5rem; + margin-top: 0.6rem; + border-radius: 70px; + border: 0.5px solid #000; + align-items: center; + padding: 0.8rem; + + input{ + width: 20rem; + height: 1rem; + padding: 3px; + font-size: 14px; + outline: none; + border: none; + } + } + } + +`; \ No newline at end of file diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx new file mode 100644 index 00000000..0c6b882f --- /dev/null +++ b/src/components/header/index.jsx @@ -0,0 +1,15 @@ +import { Container } from "./style" + +const Header = () => { + return ( + + + + ) +} +export { Header } \ No newline at end of file diff --git a/src/components/header/style.js b/src/components/header/style.js new file mode 100644 index 00000000..63635fbe --- /dev/null +++ b/src/components/header/style.js @@ -0,0 +1,28 @@ +import styled from "styled-components" + + +export const Container = styled.header` + display: flex; + background-color: #3FAFBE; + height: 4rem; + width: 100%; + align-items: center; + justify-content: center; + font-size: 1.2rem; + + ul { + display: flex; + justify-content: space-between; + width: 10rem; + + li{ + list-style: none; + a{ + display: block; + text-decoration: none; + color: white; + } + } + } + +`; diff --git a/pages/_app.js b/src/pages/_app.js similarity index 100% rename from pages/_app.js rename to src/pages/_app.js diff --git a/src/pages/index.js b/src/pages/index.js new file mode 100644 index 00000000..bcefc4d8 --- /dev/null +++ b/src/pages/index.js @@ -0,0 +1,13 @@ +import { FormSearchProducts } from "../components/formSearchProducts"; +import { Header } from "../components/header"; +import { GlobalStyle } from "../styles/global"; + +export default function Home() { + return ( +
+ +
+ +
+ ) +} diff --git a/src/styles/global.js b/src/styles/global.js new file mode 100644 index 00000000..c8ce8709 --- /dev/null +++ b/src/styles/global.js @@ -0,0 +1,10 @@ +import { createGlobalStyle } from "styled-components"; + +export const GlobalStyle = createGlobalStyle` + *{ + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: Arial, Helvetica, sans-serif; + } +`; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 904d3d1c..a9f0b62c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,87 @@ # yarn lockfile v1 +"@babel/code-frame@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" + integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== + dependencies: + "@babel/highlight" "^7.18.6" + +"@babel/generator@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.7.tgz#f8ef57c8242665c5929fe2e8d82ba75460187b4a" + integrity sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw== + dependencies: + "@babel/types" "^7.20.7" + "@jridgewell/gen-mapping" "^0.3.2" + jsesc "^2.5.1" + +"@babel/helper-annotate-as-pure@^7.16.0": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" + integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-environment-visitor@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" + integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== + +"@babel/helper-function-name@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" + integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== + dependencies: + "@babel/template" "^7.18.10" + "@babel/types" "^7.19.0" + +"@babel/helper-hoist-variables@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" + integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.16.0": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" + integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-split-export-declaration@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" + integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-string-parser@^7.19.4": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" + integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== + +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" + integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== + +"@babel/highlight@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" + integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== + dependencies: + "@babel/helper-validator-identifier" "^7.18.6" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.7.tgz#66fe23b3c8569220817d5feb8b9dcdc95bb4f71b" + integrity sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg== + "@babel/runtime-corejs3@^7.10.2": version "7.20.6" resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.20.6.tgz#63dae945963539ab0ad578efbf3eff271e7067ae" @@ -17,6 +98,62 @@ dependencies: regenerator-runtime "^0.13.11" +"@babel/template@^7.18.10": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" + integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + +"@babel/traverse@^7.4.5": + version "7.20.12" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.12.tgz#7f0f787b3a67ca4475adef1f56cb94f6abd4a4b5" + integrity sha512-MsIbFN0u+raeja38qboyF8TIT7K0BFzz/Yd/77ta4MsUsmP2RAnidIlwq7d5HFQrH/OZJecGV6B71C4zAgpoSQ== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.20.7" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f" + integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg== + dependencies: + "@babel/helper-string-parser" "^7.19.4" + "@babel/helper-validator-identifier" "^7.19.1" + to-fast-properties "^2.0.0" + +"@emotion/is-prop-valid@^1.1.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-1.2.0.tgz#7f2d35c97891669f7e276eb71c83376a5dc44c83" + integrity sha512-3aDpDprjM0AwaxGE09bOPkNxHpBd+kA6jty3RnaEXdweX1DF1U3VQpPYb0g1IStAuK7SVQ1cy+bNBBKp4W3Fjg== + dependencies: + "@emotion/memoize" "^0.8.0" + +"@emotion/memoize@^0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.8.0.tgz#f580f9beb67176fa57aae70b08ed510e1b18980f" + integrity sha512-G/YwXTkv7Den9mXDO7AhLWkE3q+I92B+VqAE+dYG4NGPaHZGvt3G8Q0p9vmE+sq7rTGphUbAvmQ9YpbfMQGGlA== + +"@emotion/stylis@^0.8.4": + version "0.8.5" + resolved "https://registry.yarnpkg.com/@emotion/stylis/-/stylis-0.8.5.tgz#deacb389bd6ee77d1e7fcaccce9e16c5c7e78e04" + integrity sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ== + +"@emotion/unitless@^0.7.4": + version "0.7.5" + resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.7.5.tgz#77211291c1900a700b8a78cfafda3160d76949ed" + integrity sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg== + "@eslint/eslintrc@^1.3.3": version "1.3.3" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.3.tgz#2b044ab39fdfa75b4688184f9e573ce3c5b0ff95" @@ -51,82 +188,114 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== -"@next/env@13.0.6": - version "13.0.6" - resolved "https://registry.yarnpkg.com/@next/env/-/env-13.0.6.tgz#3fcab11ffbe95bff127827d9f7f3139bc5e6adff" - integrity sha512-yceT6DCHKqPRS1cAm8DHvDvK74DLIkDQdm5iV+GnIts8h0QbdHvkUIkdOvQoOODgpr6018skbmSQp12z5OWIQQ== - -"@next/eslint-plugin-next@13.0.6": - version "13.0.6" - resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-13.0.6.tgz#4d73774ede50183c5ae5bab01ec4a7dd2d11fed5" - integrity sha512-JUANdYNCddhmQBjQQPxEJYL7GMCqYtbfrdmtX7c013srig7waNCG69Aoql7CgAgjdy8jn1ovHVdcF/NB46XN3Q== +"@jridgewell/gen-mapping@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" + integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== dependencies: - glob "7.1.7" - -"@next/swc-android-arm-eabi@13.0.6": - version "13.0.6" - resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.0.6.tgz#c971e5a3f8aae875ac1d9fdb159b7e126d8d98d5" - integrity sha512-FGFSj3v2Bluw8fD/X+1eXIEB0PhoJE0zfutsAauRhmNpjjZshLDgoXMWm1jTRL/04K/o9gwwO2+A8+sPVCH1uw== - -"@next/swc-android-arm64@13.0.6": - version "13.0.6" - resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-13.0.6.tgz#ecacae60f1410136cc31f9e1e09e78e624ca2d68" - integrity sha512-7MgbtU7kimxuovVsd7jSJWMkIHBDBUsNLmmlkrBRHTvgzx5nDBXogP0hzZm7EImdOPwVMPpUHRQMBP9mbsiJYQ== - -"@next/swc-darwin-arm64@13.0.6": - version "13.0.6" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.0.6.tgz#266e9e0908024760eba0dfce17edc90ffcba5fdc" - integrity sha512-AUVEpVTxbP/fxdFsjVI9d5a0CFn6NVV7A/RXOb0Y+pXKIIZ1V5rFjPwpYfIfyOo2lrqgehMNQcyMRoTrhq04xg== - -"@next/swc-darwin-x64@13.0.6": - version "13.0.6" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.0.6.tgz#4be4ca7bc37f9c93d2e38be5ff313873ad758c09" - integrity sha512-SasCDJlshglsPnbzhWaIF6VEGkQy2NECcAOxPwaPr0cwbbt4aUlZ7QmskNzgolr5eAjFS/xTr7CEeKJtZpAAtQ== - -"@next/swc-freebsd-x64@13.0.6": - version "13.0.6" - resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.0.6.tgz#42eb9043ee65ea5927ba550f4b59827d7064c47b" - integrity sha512-6Lbxd9gAdXneTkwHyYW/qtX1Tdw7ND9UbiGsGz/SP43ZInNWnW6q0au4hEVPZ9bOWWRKzcVoeTBdoMpQk9Hx9w== - -"@next/swc-linux-arm-gnueabihf@13.0.6": - version "13.0.6" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.0.6.tgz#aab663282b5f15d12bf9de1120175f438a44c924" - integrity sha512-wNdi5A519e1P+ozEuYOhWPzzE6m1y7mkO6NFwn6watUwO0X9nZs7fT9THmnekvmFQpaZ6U+xf2MQ9poQoCh6jQ== + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" -"@next/swc-linux-arm64-gnu@13.0.6": - version "13.0.6" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.0.6.tgz#5e2b6df4636576a00befb7bd414820a12161a9af" - integrity sha512-e8KTRnleQY1KLk5PwGV5hrmvKksCc74QRpHl5ffWnEEAtL2FE0ave5aIkXqErsPdXkiKuA/owp3LjQrP+/AH7Q== +"@jridgewell/resolve-uri@3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== -"@next/swc-linux-arm64-musl@13.0.6": - version "13.0.6" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.0.6.tgz#4a5e91a36cf140cad974df602d647e64b1b9473f" - integrity sha512-/7RF03C3mhjYpHN+pqOolgME3guiHU5T3TsejuyteqyEyzdEyLHod+jcYH6ft7UZ71a6TdOewvmbLOtzHW2O8A== +"@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@next/swc-linux-x64-gnu@13.0.6": - version "13.0.6" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.0.6.tgz#accb8a721a99e704565b936f16e96fa0c67e8db1" - integrity sha512-kxyEXnYHpOEkFnmrlwB1QlzJtjC6sAJytKcceIyFUHbCaD3W/Qb5tnclcnHKTaFccizZRePXvV25Ok/eUSpKTw== +"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.14" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@next/swc-linux-x64-musl@13.0.6": - version "13.0.6" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.0.6.tgz#2affaa2f4f01bc190a539d895118a6ad1a477645" - integrity sha512-N0c6gubS3WW1oYYgo02xzZnNatfVQP/CiJq2ax+DJ55ePV62IACbRCU99TZNXXg+Kos6vNW4k+/qgvkvpGDeyA== +"@jridgewell/trace-mapping@^0.3.9": + version "0.3.17" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" + integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== + dependencies: + "@jridgewell/resolve-uri" "3.1.0" + "@jridgewell/sourcemap-codec" "1.4.14" -"@next/swc-win32-arm64-msvc@13.0.6": - version "13.0.6" - resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.0.6.tgz#28e5c042772865efd05197a8d1db5920156997fc" - integrity sha512-QjeMB2EBqBFPb/ac0CYr7GytbhUkrG4EwFWbcE0vsRp4H8grt25kYpFQckL4Jak3SUrp7vKfDwZ/SwO7QdO8vw== +"@next/env@13.1.2": + version "13.1.2" + resolved "https://registry.yarnpkg.com/@next/env/-/env-13.1.2.tgz#4f13e3e9d44bb17fdc1d4543827459097035f10f" + integrity sha512-PpT4UZIX66VMTqXt4HKEJ+/PwbS+tWmmhZlazaws1a+dbUA5pPdjntQ46Jvj616i3ZKN9doS9LHx3y50RLjAWg== -"@next/swc-win32-ia32-msvc@13.0.6": +"@next/eslint-plugin-next@13.0.6": version "13.0.6" - resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.0.6.tgz#30d91a6d847fa8bce9f8a0f9d2b469d574270be5" - integrity sha512-EQzXtdqRTcmhT/tCq81rIwE36Y3fNHPInaCuJzM/kftdXfa0F+64y7FAoMO13npX8EG1+SamXgp/emSusKrCXg== + resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-13.0.6.tgz#4d73774ede50183c5ae5bab01ec4a7dd2d11fed5" + integrity sha512-JUANdYNCddhmQBjQQPxEJYL7GMCqYtbfrdmtX7c013srig7waNCG69Aoql7CgAgjdy8jn1ovHVdcF/NB46XN3Q== + dependencies: + glob "7.1.7" -"@next/swc-win32-x64-msvc@13.0.6": - version "13.0.6" - resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.0.6.tgz#dfa28ddb335c16233d22cf39ec8cdf723e6587a1" - integrity sha512-pSkqZ//UP/f2sS9T7IvHLfEWDPTX0vRyXJnAUNisKvO3eF3e1xdhDX7dix/X3Z3lnN4UjSwOzclAI87JFbOwmQ== +"@next/swc-android-arm-eabi@13.1.2": + version "13.1.2" + resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.1.2.tgz#eacc7757b480a8150c1aea748bf7892a4fc62f64" + integrity sha512-7mRz1owoGsbfIcdOJA3kk7KEwPZ+OvVT1z9DkR/yru4QdVLF69h/1SHy0vlUNQMxDRllabhxCfkoZCB34GOGAg== + +"@next/swc-android-arm64@13.1.2": + version "13.1.2" + resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-13.1.2.tgz#f3d41339b4f15852a589fe11820408572a512a27" + integrity sha512-mgjZ2eJSayovQm1LcE54BLSI4jjnnnLtq5GY5g+DdPuUiCT644gKtjZ/w2BQvuIecCqqBO+Ph9yzo/wUTq7NLg== + +"@next/swc-darwin-arm64@13.1.2": + version "13.1.2" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.1.2.tgz#1a20a2262aa7a250517c9a7f2efd6ac6273f8c63" + integrity sha512-RikoQqy109r2222UJlyGs4dZw2BibkfPqpeFdW5JEGv+L2PStlHID8DwyVYbmHfQ0VIBGvbf/NAUtFakAWlhwg== + +"@next/swc-darwin-x64@13.1.2": + version "13.1.2" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.1.2.tgz#242bb321676bd88f4cffa7eae3283215cd1185ce" + integrity sha512-JbDZjaTvL8gyPC5TAH6OnD4jmXPkyUxRYPvu08ZmhT/XAFBb/Cso0BdXyDax/BPCG70mimP9d3hXNKNq+A0VtQ== + +"@next/swc-freebsd-x64@13.1.2": + version "13.1.2" + resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.1.2.tgz#9589f7f2bebfa43a744c9e41654e743b38a318b1" + integrity sha512-ax4j8VrdFQ/xc3W7Om0u1vnDxVApQHKsChBbAMynCrnycZmpbqK4MZu4ZkycT+mx2eccCiqZROpbzDbEdPosEw== + +"@next/swc-linux-arm-gnueabihf@13.1.2": + version "13.1.2" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.1.2.tgz#8935b0c8f232e36c3d88cd1e1023afa8d51f7260" + integrity sha512-NcRHTesnCxnUvSJa637PQJffBBkmqi5XS/xVWGY7dI6nyJ+pC96Oj7kd+mcjnFUQI5lHKbg39qBWKtOzbezc4w== + +"@next/swc-linux-arm64-gnu@13.1.2": + version "13.1.2" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.1.2.tgz#3482f72e580cdfc4bbec2e55dd55d5a9bdf7038b" + integrity sha512-AxJdjocLtPrsBY4P2COSBIc3crT5bpjgGenNuINoensOlXhBkYM0aRDYZdydwXOhG+kN2ngUvfgitop9pa204w== + +"@next/swc-linux-arm64-musl@13.1.2": + version "13.1.2" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.1.2.tgz#3b7ca70fd813c77f618ee34a150b977cc15af9a3" + integrity sha512-JmNimDkcCRq7P5zpkdqeaSZ69qKDntEPtyIaMNWqy5M0WUJxGim0Fs6Qzxayiyvuuh9Guxks4woQ/j/ZvX/c8Q== + +"@next/swc-linux-x64-gnu@13.1.2": + version "13.1.2" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.1.2.tgz#51a7a889e88eb87a5ce9658842f9e8422e037ead" + integrity sha512-TsLsjZwUlgmvI42neTuIoD6K9RlXCUzqPtvIClgXxVO0um0DiZwK+M+0zX/uVXhMVphfPY2c5YeR1zFSIONY4A== + +"@next/swc-linux-x64-musl@13.1.2": + version "13.1.2" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.1.2.tgz#4c0dd08a6f8a7e4881c3551de29259b3cfe86e27" + integrity sha512-eSkyXgCXydEFPTkcncQOGepafedPte6JT/OofB9uvruucrrMVBagCASOuPxodWEMrlfEKSXVnExMKIlfmQMD7A== + +"@next/swc-win32-arm64-msvc@13.1.2": + version "13.1.2" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.1.2.tgz#589fcce82f9f7224d2399d8d7bcba9097bb50dad" + integrity sha512-DmXFaRTgt2KrV9dmRLifDJE+cYiutHVFIw5/C9BtnwXH39uf3YbPxeD98vNrtqqqZVVLXY/1ySaSIwzYnqeY9g== + +"@next/swc-win32-ia32-msvc@13.1.2": + version "13.1.2" + resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.1.2.tgz#9be05202730530631b51d7753d447dfe86095c9f" + integrity sha512-3+nBkuFs/wT+lmRVQNH5SyDT7I4vUlNPntosEaEP63FuYQdPLaxz0GvcR66MdFSFh2fsvazpe4wciOwVS4FItQ== + +"@next/swc-win32-x64-msvc@13.1.2": + version "13.1.2" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.1.2.tgz#c7e75033e8b8f497768c7b462ac642830141bb00" + integrity sha512-avsyveEvcvH42PvKjR4Pb8JlLttuGURr2H3ZhS2b85pHOiZ7yjH3rMUoGnNzuLMApyxYaCvd4MedPrLhnNhkog== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -247,6 +416,13 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" @@ -329,6 +505,22 @@ axobject-query@^2.2.0: resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" integrity sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA== +"babel-plugin-styled-components@>= 1.12.0": + version "2.0.7" + resolved "https://registry.yarnpkg.com/babel-plugin-styled-components/-/babel-plugin-styled-components-2.0.7.tgz#c81ef34b713f9da2b7d3f5550df0d1e19e798086" + integrity sha512-i7YhvPgVqRKfoQ66toiZ06jPNA3p6ierpfUuEWxNF+fV27Uv5gxBkf8KZLHUCc1nFA9j6+80pYoIpqCeyW3/bA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.16.0" + "@babel/helper-module-imports" "^7.16.0" + babel-plugin-syntax-jsx "^6.18.0" + lodash "^4.17.11" + picomatch "^2.3.0" + +babel-plugin-syntax-jsx@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" + integrity sha512-qrPaCSo9c8RHNRHIotaufGbuOBN8rtdC4QrrFFc43vyWCCz7Kl7GL1PGaXtMGQZUXrkCjNEgxDfmAuAabr/rlw== + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -362,11 +554,25 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== +camelize@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.1.tgz#89b7e16884056331a35d6b5ad064332c91daa6c3" + integrity sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ== + caniuse-lite@^1.0.30001406: version "1.0.30001439" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001439.tgz#ab7371faeb4adff4b74dad1718a6fd122e45d9cb" integrity sha512-1MgUzEkoMO6gKfXflStpYgZDlFM7M/ck/bgfVCACO5vnAf0fXoNVHdWtqGU+MYca+4bL9Z5bpOVmR33cWW9G2A== +chalk@^2.0.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + chalk@^4.0.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" @@ -380,6 +586,13 @@ client-only@0.0.1: resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1" integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA== +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -387,6 +600,11 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" @@ -411,6 +629,20 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" +css-color-keywords@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/css-color-keywords/-/css-color-keywords-1.0.0.tgz#fea2616dc676b2962686b3af8dbdbe180b244e05" + integrity sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg== + +css-to-react-native@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-3.1.0.tgz#e783474149997608986afcff614405714a8fe1ac" + integrity sha512-AryfkFA29b4I3vG7N4kxFboq15DxwSXzhXM37XNEjwJMgjYIc8BcqfiprpAqX0zadI5PMByEIwAMzXxk5Vcc4g== + dependencies: + camelize "^1.0.0" + css-color-keywords "^1.0.0" + postcss-value-parser "^4.0.2" + damerau-levenshtein@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" @@ -430,7 +662,7 @@ debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: +debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -536,6 +768,11 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + escape-string-regexp@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" @@ -904,6 +1141,11 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + globals@^13.15.0: version "13.19.0" resolved "https://registry.yarnpkg.com/globals/-/globals-13.19.0.tgz#7a42de8e6ad4f7242fbcca27ea5b23aca367b5c8" @@ -966,6 +1208,11 @@ has-bigints@^1.0.1, has-bigints@^1.0.2: resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" @@ -997,6 +1244,13 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" +hoist-non-react-statics@^3.0.0: + version "3.3.2" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" + integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== + dependencies: + react-is "^16.7.0" + ignore@^5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.1.tgz#c2b1f76cb999ede1502f3a226a9310fdfe88d46c" @@ -1163,7 +1417,7 @@ js-sdsl@^4.1.4: resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.2.0.tgz#278e98b7bea589b8baaf048c20aeb19eb7ad09d0" integrity sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ== -"js-tokens@^3.0.0 || ^4.0.0": +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== @@ -1175,6 +1429,11 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -1232,6 +1491,11 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash@^4.17.11: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -1296,30 +1560,30 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== -next@13.0.6: - version "13.0.6" - resolved "https://registry.yarnpkg.com/next/-/next-13.0.6.tgz#f9a2e9e2df9ad60e1b6b716488c9ad501a383621" - integrity sha512-COvigvms2LRt1rrzfBQcMQ2GZd86Mvk1z+LOLY5pniFtL4VrTmhZ9salrbKfSiXbhsD01TrDdD68ec3ABDyscA== +next@^13.1.2: + version "13.1.2" + resolved "https://registry.yarnpkg.com/next/-/next-13.1.2.tgz#4105b0cf238bb2f58d5e12dbded8cabb9785f2d9" + integrity sha512-Rdnnb2YH///w78FEOR/IQ6TXga+qpth4OqFSem48ng1PYYKr6XBsIk1XVaRcIGM3o6iiHnun0nJvkJHDf+ICyQ== dependencies: - "@next/env" "13.0.6" + "@next/env" "13.1.2" "@swc/helpers" "0.4.14" caniuse-lite "^1.0.30001406" postcss "8.4.14" - styled-jsx "5.1.0" + styled-jsx "5.1.1" optionalDependencies: - "@next/swc-android-arm-eabi" "13.0.6" - "@next/swc-android-arm64" "13.0.6" - "@next/swc-darwin-arm64" "13.0.6" - "@next/swc-darwin-x64" "13.0.6" - "@next/swc-freebsd-x64" "13.0.6" - "@next/swc-linux-arm-gnueabihf" "13.0.6" - "@next/swc-linux-arm64-gnu" "13.0.6" - "@next/swc-linux-arm64-musl" "13.0.6" - "@next/swc-linux-x64-gnu" "13.0.6" - "@next/swc-linux-x64-musl" "13.0.6" - "@next/swc-win32-arm64-msvc" "13.0.6" - "@next/swc-win32-ia32-msvc" "13.0.6" - "@next/swc-win32-x64-msvc" "13.0.6" + "@next/swc-android-arm-eabi" "13.1.2" + "@next/swc-android-arm64" "13.1.2" + "@next/swc-darwin-arm64" "13.1.2" + "@next/swc-darwin-x64" "13.1.2" + "@next/swc-freebsd-x64" "13.1.2" + "@next/swc-linux-arm-gnueabihf" "13.1.2" + "@next/swc-linux-arm64-gnu" "13.1.2" + "@next/swc-linux-arm64-musl" "13.1.2" + "@next/swc-linux-x64-gnu" "13.1.2" + "@next/swc-linux-x64-musl" "13.1.2" + "@next/swc-win32-arm64-msvc" "13.1.2" + "@next/swc-win32-ia32-msvc" "13.1.2" + "@next/swc-win32-x64-msvc" "13.1.2" object-assign@^4.1.1: version "4.1.1" @@ -1460,11 +1724,16 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.3.1: +picomatch@^2.3.0, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +postcss-value-parser@^4.0.2: + version "4.2.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" + integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== + postcss@8.4.14: version "8.4.14" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" @@ -1506,12 +1775,17 @@ react-dom@18.2.0: loose-envify "^1.1.0" scheduler "^0.23.0" -react-is@^16.13.1: +react-icons@^4.7.1: + version "4.7.1" + resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.7.1.tgz#0f4b25a5694e6972677cb189d2a72eabea7a8345" + integrity sha512-yHd3oKGMgm7zxo3EA7H2n7vxSoiGmHk5t6Ou4bXsfcgWyhfDKMpyKfhHR6Bjnn63c+YXBLBPUql9H4wPJM6sXw== + +react-is@^16.13.1, react-is@^16.7.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== -react@18.2.0: +react@^18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== @@ -1607,6 +1881,11 @@ semver@^7.3.7: dependencies: lru-cache "^6.0.0" +shallowequal@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" + integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -1692,13 +1971,36 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -styled-jsx@5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.1.0.tgz#4a5622ab9714bd3fcfaeec292aa555871f057563" - integrity sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ== +styled-components@^5.3.6: + version "5.3.6" + resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-5.3.6.tgz#27753c8c27c650bee9358e343fc927966bfd00d1" + integrity sha512-hGTZquGAaTqhGWldX7hhfzjnIYBZ0IXQXkCYdvF1Sq3DsUaLx6+NTHC5Jj1ooM2F68sBiVz3lvhfwQs/S3l6qg== + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/traverse" "^7.4.5" + "@emotion/is-prop-valid" "^1.1.0" + "@emotion/stylis" "^0.8.4" + "@emotion/unitless" "^0.7.4" + babel-plugin-styled-components ">= 1.12.0" + css-to-react-native "^3.0.0" + hoist-non-react-statics "^3.0.0" + shallowequal "^1.1.0" + supports-color "^5.5.0" + +styled-jsx@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.1.1.tgz#839a1c3aaacc4e735fed0781b8619ea5d0009d1f" + integrity sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw== dependencies: client-only "0.0.1" +supports-color@^5.3.0, supports-color@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -1737,6 +2039,11 @@ tiny-glob@^0.2.9: globalyzer "0.1.0" globrex "^0.1.2" +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== + to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" From fe61ab035eff2746be08ab3952c656d01f8b5d64 Mon Sep 17 00:00:00 2001 From: Mateus Lopes <73197343+progmateus@users.noreply.github.com> Date: Sun, 15 Jan 2023 21:43:31 -0300 Subject: [PATCH 02/11] component productItem --- src/components/productItem/index.jsx | 24 +++++++ src/components/productItem/style.js | 79 ++++++++++++++++++++++++ src/components/sectionProducts/index.jsx | 22 +++++++ src/components/sectionProducts/style.js | 8 +++ src/pages/index.js | 2 + src/styles/global.js | 12 ++++ 6 files changed, 147 insertions(+) create mode 100644 src/components/productItem/index.jsx create mode 100644 src/components/productItem/style.js create mode 100644 src/components/sectionProducts/index.jsx create mode 100644 src/components/sectionProducts/style.js diff --git a/src/components/productItem/index.jsx b/src/components/productItem/index.jsx new file mode 100644 index 00000000..7aeed87e --- /dev/null +++ b/src/components/productItem/index.jsx @@ -0,0 +1,24 @@ +import { Container } from "./style" + +const productImageURL = "https://encrypted-tbn1.gstatic.com/shopping?q=tbn:ANd9GcTTHi0yE-Rui-kxpDR-CUPsWkEf4CC-uUaojmpPY7x2EaWhLe12tohtHezL7cyiGtPCo8FoOckqJaD2Dj80zQt-XgufS_FYDRTcvabgcWD-0qjcl6FR0Zdz&usqp=CAE" + +const ProductItem = () => { + return ( + +
+
+ +
+
+ Shampoo Escurecedor de Cabelo Gradual Men | Menfirst + +

Menfirst

+
+ +
+
+ ) +} +export { ProductItem } \ No newline at end of file diff --git a/src/components/productItem/style.js b/src/components/productItem/style.js new file mode 100644 index 00000000..42de8a55 --- /dev/null +++ b/src/components/productItem/style.js @@ -0,0 +1,79 @@ +import styled from "styled-components"; + + +export const Container = styled.div` + border: 0.1px solid #B2B2B2; + border-radius: 10px; + max-width: 12rem; + display: flex; + justify-content: center; + padding: 0.6rem; + flex: 1 1 12rem; + margin: 10px 10px; + + img{ + text-align: center; + max-width: 10rem; + } + + div{ + + &:hover{ + &#product_name{ + text-decoration: underline; + } + } + + a{ + + &#product_name{ + overflow: hidden; + display: -webkit-box; + text-overflow: ellipsis; + -webkit-line-clamp: 2; /* number of lines to show */ + -webkit-box-orient: vertical; + text-overflow: ellipsis; + text-align: left; + line-height: 1.5em; + margin: 0.5rem 0; + text-decoration: none; + + &:hover{ + text-decoration: underline; + } + } + + } + + p{ + opacity: 0.8; + } + + &#div_see_more { + margin-top: 0.8rem; + width: 100%; + padding-top: 0.5rem; + border-top: 0.1px solid #B2B2B2; + text-align: center; + + a{ + margin-top: 4rem; + text-decoration: none; + opacity: 0.8; + } + } + + + } + + + @media (max-width: 768px) { + + max-width: 9rem; + div{ + img{ + max-width: 5rem; + } + } + } +`; \ No newline at end of file diff --git a/src/components/sectionProducts/index.jsx b/src/components/sectionProducts/index.jsx new file mode 100644 index 00000000..8ad0ade4 --- /dev/null +++ b/src/components/sectionProducts/index.jsx @@ -0,0 +1,22 @@ +import { ProductItem } from "../productItem" +import { Container } from "./style" +const SectionProducts = () => { + return ( + + + + + + + + + + + + + + + + ) +} +export { SectionProducts } \ No newline at end of file diff --git a/src/components/sectionProducts/style.js b/src/components/sectionProducts/style.js new file mode 100644 index 00000000..3384d87f --- /dev/null +++ b/src/components/sectionProducts/style.js @@ -0,0 +1,8 @@ +import styled from "styled-components"; + +export const Container = styled.section` + display: flex; + margin-top: 4rem; + flex-wrap: wrap; + max-width: 120rem; +`; \ No newline at end of file diff --git a/src/pages/index.js b/src/pages/index.js index bcefc4d8..db3ea08f 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,5 +1,6 @@ import { FormSearchProducts } from "../components/formSearchProducts"; import { Header } from "../components/header"; +import { SectionProducts } from "../components/sectionProducts"; import { GlobalStyle } from "../styles/global"; export default function Home() { @@ -8,6 +9,7 @@ export default function Home() {
+ ) } diff --git a/src/styles/global.js b/src/styles/global.js index c8ce8709..2e2547e8 100644 --- a/src/styles/global.js +++ b/src/styles/global.js @@ -7,4 +7,16 @@ export const GlobalStyle = createGlobalStyle` box-sizing: border-box; font-family: Arial, Helvetica, sans-serif; } + + + html{ + + @media (max-width: 1080px) { + font-size: 93.75%; + } + + @media (max-width: 1080px) { + font-size: 87.5%; + } + } `; \ No newline at end of file From f997da4b121656bcf846d5fccff42b164e0329ff Mon Sep 17 00:00:00 2001 From: Mateus Lopes <73197343+progmateus@users.noreply.github.com> Date: Mon, 16 Jan 2023 02:48:27 -0300 Subject: [PATCH 03/11] component section products --- package.json | 1 + src/components/productItem/index.jsx | 10 +- src/components/productItem/style.js | 26 +- src/components/sectionProducts/index.jsx | 31 +- src/components/sectionProducts/style.js | 3 +- src/mocks/products.json | 1145 ++++++++++++++++++++++ src/pages/index.js | 34 +- src/services/api.js | 34 + src/utils/titleCase.js | 12 + yarn.lock | 57 ++ 10 files changed, 1323 insertions(+), 30 deletions(-) create mode 100644 src/mocks/products.json create mode 100644 src/services/api.js create mode 100644 src/utils/titleCase.js diff --git a/package.json b/package.json index bccd97b2..254f619d 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "lint": "next lint" }, "dependencies": { + "axios": "^1.2.2", "next": "^13.1.2", "react": "^18.2.0", "react-dom": "18.2.0", diff --git a/src/components/productItem/index.jsx b/src/components/productItem/index.jsx index 7aeed87e..74ca5d17 100644 --- a/src/components/productItem/index.jsx +++ b/src/components/productItem/index.jsx @@ -1,18 +1,20 @@ +import { titleCase } from "../../utils/titleCase" import { Container } from "./style" const productImageURL = "https://encrypted-tbn1.gstatic.com/shopping?q=tbn:ANd9GcTTHi0yE-Rui-kxpDR-CUPsWkEf4CC-uUaojmpPY7x2EaWhLe12tohtHezL7cyiGtPCo8FoOckqJaD2Dj80zQt-XgufS_FYDRTcvabgcWD-0qjcl6FR0Zdz&usqp=CAE" -const ProductItem = () => { +const ProductItem = (props) => { + return (
- +
- Shampoo Escurecedor de Cabelo Gradual Men | Menfirst + {titleCase(props.name)} -

Menfirst

+

{props.brand ? props.brand : "Não informado"}

ver mais diff --git a/src/components/productItem/style.js b/src/components/productItem/style.js index 42de8a55..93d5249a 100644 --- a/src/components/productItem/style.js +++ b/src/components/productItem/style.js @@ -2,13 +2,13 @@ import styled from "styled-components"; export const Container = styled.div` + display: flex; + justify-content: center; + flex: 1 1 6rem; border: 0.1px solid #B2B2B2; border-radius: 10px; max-width: 12rem; - display: flex; - justify-content: center; padding: 0.6rem; - flex: 1 1 12rem; margin: 10px 10px; img{ @@ -17,6 +17,8 @@ export const Container = styled.div` } div{ + text-align: center; + max-width: 100%; &:hover{ &#product_name{ @@ -35,35 +37,34 @@ export const Container = styled.div` text-overflow: ellipsis; text-align: left; line-height: 1.5em; + min-height: 3rem; margin: 0.5rem 0; text-decoration: none; &:hover{ text-decoration: underline; } - } - + } } p{ + margin-top: 0.8rem; + text-align: left; opacity: 0.8; } &#div_see_more { - margin-top: 0.8rem; width: 100%; + margin-top: 0.8rem; padding-top: 0.5rem; border-top: 0.1px solid #B2B2B2; - text-align: center; + justify-content: center; a{ - margin-top: 4rem; text-decoration: none; opacity: 0.8; } } - - } @@ -74,6 +75,11 @@ export const Container = styled.div` img{ max-width: 5rem; } + + a{ + font-size: 12px; + max-width: 7rem; + } } } `; \ No newline at end of file diff --git a/src/components/sectionProducts/index.jsx b/src/components/sectionProducts/index.jsx index 8ad0ade4..9fe638c6 100644 --- a/src/components/sectionProducts/index.jsx +++ b/src/components/sectionProducts/index.jsx @@ -1,20 +1,25 @@ import { ProductItem } from "../productItem" import { Container } from "./style" -const SectionProducts = () => { + + +const SectionProducts = (props) => { + console.log(props.products) return ( - - - - - - - - - - - - + { + props.products.map((product) => { + console.log(product) + return ( + + ) + }) + + } ) diff --git a/src/components/sectionProducts/style.js b/src/components/sectionProducts/style.js index 3384d87f..f2416230 100644 --- a/src/components/sectionProducts/style.js +++ b/src/components/sectionProducts/style.js @@ -2,7 +2,8 @@ import styled from "styled-components"; export const Container = styled.section` display: flex; - margin-top: 4rem; + margin-top: 3rem; flex-wrap: wrap; max-width: 120rem; + justify-content: center; `; \ No newline at end of file diff --git a/src/mocks/products.json b/src/mocks/products.json new file mode 100644 index 00000000..73d2fb8c --- /dev/null +++ b/src/mocks/products.json @@ -0,0 +1,1145 @@ +{ + "products": [ + { + "description": "ACUCAR", + "gtin": 7896032503052, + "width": null, + "height": null, + "length": null, + "net_weight": null, + "gross_weight": null, + "created_at": "2014-04-24T11:07:34.000-03:00", + "updated_at": "2023-01-13T05:11:00.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7896032503052, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/FD73D264032FFA1239BF3911ACFC7B75.png", + "gpc": { + "code": "10000043", + "description": "Açúcar / Substitutos do Açúcar (Não perecível)" + }, + "ncm": { + "code": "17011300", + "description": "Açúcar de cana mencionado na Nota de subposição 2 do presente Capítulo", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido. - Açúcares brutos sem adição de aromatizantes ou de corantes: - Açúcar de cana mencionado na Nota de subposição 2 do presente Capítulo", + "ex": null + } + }, + { + "description": "ACUCAR CONF.BRETZKE", + "gtin": 7896072002034, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": null, + "gross_weight": null, + "created_at": "2015-01-14T22:00:00.000-02:00", + "updated_at": "2022-05-25T15:37:44.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7896072002034, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/19EEEBBB3169A054D7C74546BA26B7CB.png", + "gpc": { + "code": "10000043", + "description": "Açúcar / Substitutos do Açúcar (Não perecível)" + }, + "ncm": { + "code": "17019100", + "description": "Adicionados de aromatizantes ou de corantes", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido. - Outros: - Adicionados de aromatizantes ou de corantes", + "ex": null + } + }, + { + "description": "ACUCAR CONFEITARIA", + "gtin": 7896087100114, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 1, + "gross_weight": 1, + "created_at": "2016-03-18T16:38:30.000-03:00", + "updated_at": "2022-05-04T09:09:31.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7896087100114, + "commercial_unit": { + "type_packaging": "Kilo", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/4D990B3D711BA29A606480778F8228F4.png", + "ncm": { + "code": "17049090", + "description": "Outros", + "full_description": "Açúcares e produtos de confeitaria - Produtos de confeitaria, sem cacau (incluído o chocolate branco) - Outros - Outros", + "ex": null + } + }, + { + "description": "ACUCAR REF.DOLCE", + "gtin": 7896060102210, + "thumbnail": "https://cdn-cosmos.bluesoft.com.br/products/7896060102210", + "width": null, + "height": null, + "length": null, + "net_weight": null, + "gross_weight": null, + "created_at": "2014-04-24T11:07:34.000-03:00", + "updated_at": "2023-01-15T19:01:18.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7896060102210, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/269A8C98918E68E651F2F60EBC1CB389.png", + "gpc": { + "code": "10000043", + "description": "Açúcar / Substitutos do Açúcar (Não perecível)" + }, + "ncm": { + "code": "17019900", + "description": "Outros", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido. - Outros: - Outros", + "ex": null + } + }, + { + "description": "PACOCA S ACUCAR", + "gtin": 7898379440755, + "width": null, + "height": null, + "length": null, + "net_weight": null, + "gross_weight": null, + "created_at": "2016-01-19T14:03:12.000-02:00", + "updated_at": "2022-05-04T09:09:11.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898379440755, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/156D76A9D4EEE4064B2A32129099FE5E.png", + "ncm": { + "code": "20071000", + "description": "Preparações homogeneizadas", + "full_description": "Preparações de produtos hortícolas, de frutas ou de outras partes de plantas - Doces, geleias, marmelades, purês e pastas de fruta, obtidos por cozimento, mesmo com adição de açúcar ou de outros edulcorantes. - Preparações homogeneizadas", + "ex": null + } + }, + { + "description": "AÇUCAR TOPÇUCAR", + "gtin": 7898932776154, + "width": null, + "height": null, + "length": null, + "net_weight": null, + "gross_weight": null, + "created_at": "2018-07-24T15:25:32.000-03:00", + "updated_at": "2023-01-03T14:12:55.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898932776154, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/4C0A555761F3EFB6D7E83F9792AA7603.png", + "brand": { + "name": "TOPÇÚCAR", + "picture": "/assets/brand-placeholder-7080174fbd24025783105a607811edad.png" + }, + "ncm": { + "code": "17019900", + "description": "Outros", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido. - Outros: - Outros", + "ex": null + } + }, + { + "description": "ACUCAR MASCAVO", + "gtin": 7898954007137, + "width": null, + "height": null, + "length": null, + "net_weight": null, + "gross_weight": null, + "created_at": "2016-03-25T15:31:51.000-03:00", + "updated_at": "2022-12-20T18:09:42.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898954007137, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/BD7BF11E714FE43194662C8D9E79E67E.png", + "ncm": { + "code": "17019900", + "description": "Outros", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido. - Outros: - Outros", + "ex": null + } + }, + { + "description": "PACOCA S ACUCAR", + "gtin": 7898268910178, + "thumbnail": "https://cdn-cosmos.bluesoft.com.br/products/7898268910178", + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": null, + "gross_weight": null, + "created_at": "2014-04-24T11:07:34.000-03:00", + "updated_at": "2023-01-13T03:08:38.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898268910178, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/9B49B15812B649CD5A9724A30FAE687F.png", + "brand": { + "name": "AIRON", + "picture": "/assets/brand-placeholder-7080174fbd24025783105a607811edad.png" + }, + "ncm": { + "code": "20079990", + "description": "Outros", + "full_description": "Preparações de produtos hortícolas, de frutas ou de outras partes de plantas - Doces, geleias, marmelades, purês e pastas de fruta, obtidos por cozimento, mesmo com adição de açúcar ou de outros edulcorantes. - Outros: - Outros - Outros", + "ex": null + }, + "cest": { + "id": 2138, + "code": "1709400", + "description": "Doces, geléias, “marmelades”, purês e pastas de frutas, obtidos por cozimento, com ou sem adição de açúcar ou de outros edulcorantes, em embalagens de conteúdo inferior ou igual a 1 kg, exceto as embalagens individuais de conteúdo inferior ou igual a 10 g", + "parent_id": 1671 + } + }, + { + "description": "BISCOITO.CHAMPANHE COM ACUCAR", + "gtin": 7891962005324, + "thumbnail": "https://cdn-cosmos.bluesoft.com.br/products/7891962005324", + "width": null, + "height": null, + "length": null, + "net_weight": null, + "gross_weight": null, + "created_at": "2016-01-19T14:17:35.000-02:00", + "updated_at": "2023-01-12T12:04:01.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7891962005324, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + }, + { + "gtin": 17891962005321, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": 0, + "layer": 0 + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/0390DB751B70B5E4AAD1C519FB35DB27.png", + "brand": { + "name": "BAUDUCCO", + "picture": "https://cdn-cosmos.bluesoft.com.br/brands/brand_bauducco" + }, + "gpc": { + "code": "10000161", + "description": "Biscoitos / Bolachas (Não perecíveis)" + }, + "ncm": { + "code": "19053100", + "description": "Bolachas e biscoitos, adicionados de edulcorantes", + "full_description": "Preparações à base de cereais, farinhas, amidos, féculas ou de leite; produtos de pastelaria - Produtos de padaria, pastelaria ou da indústria de bolachas e biscoitos, mesmo adicionados de cacau; hóstias, cápsulas vazias para medicamentos, obreias, pastas secas de farinha, amido ou fécula, em folhas, e produtos semelhantes. - Bolachas e biscoitos, adicionados de edulcorantes; waffles e wafers: - Bolachas e biscoitos, adicionados de edulcorantes", + "ex": null + } + }, + { + "description": "ACUCAR GUIMARAES", + "gtin": 7896775178135, + "thumbnail": "https://cdn-cosmos.bluesoft.com.br/products/7896775178135", + "width": null, + "height": null, + "length": null, + "net_weight": null, + "gross_weight": null, + "created_at": "2014-04-24T11:07:34.000-03:00", + "updated_at": "2023-01-13T05:49:28.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7896775178135, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + }, + { + "gtin": 17896775178132, + "commercial_unit": { + "type_packaging": "Caixa", + "quantity_packaging": 30, + "ballast": 7, + "layer": 7 + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/E4A553F9D83C2F261F1279321C4C2980.png", + "brand": { + "name": "GUIMARAES", + "picture": "/assets/brand-placeholder-7080174fbd24025783105a607811edad.png" + }, + "gpc": { + "code": "10000043", + "description": "Açúcar / Substitutos do Açúcar (Não perecível)" + }, + "ncm": { + "code": "17011400", + "description": "Outros açúcares de cana", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido. - Açúcares brutos sem adição de aromatizantes ou de corantes: - Outros açúcares de cana", + "ex": null + } + }, + { + "description": "AÇUCAR PICININ", + "gtin": 7896864400222, + "width": null, + "height": null, + "length": null, + "net_weight": null, + "gross_weight": null, + "created_at": "2014-04-24T11:07:34.000-03:00", + "updated_at": "2022-06-22T08:37:22.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7896864400222, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/9CE708CA04D66D35FF379D56CCB4AAB3.png", + "brand": { + "name": "PICININ", + "picture": "/assets/brand-placeholder-7080174fbd24025783105a607811edad.png" + }, + "gpc": { + "code": "10000043", + "description": "Açúcar / Substitutos do Açúcar (Não perecível)" + }, + "ncm": { + "code": "17019900", + "description": "Outros", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido. - Outros: - Outros", + "ex": null + } + }, + { + "description": "ACUCAR CONFEITEIRO", + "gtin": 7897077808287, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 1, + "gross_weight": 1, + "created_at": "2014-04-24T11:07:34.000-03:00", + "updated_at": "2023-01-14T01:00:36.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7897077808287, + "commercial_unit": { + "type_packaging": "Fardo", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/02E20FA0ACC2BAF50655016FAA71E030.png", + "gpc": { + "code": "10000043", + "description": "Açúcar / Substitutos do Açúcar (Não perecível)" + }, + "ncm": { + "code": "17011300", + "description": "Açúcar de cana mencionado na Nota de subposição 2 do presente Capítulo", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido. - Açúcares brutos sem adição de aromatizantes ou de corantes: - Açúcar de cana mencionado na Nota de subposição 2 do presente Capítulo", + "ex": null + } + }, + { + "description": "AÇUCAR CRISTAL 1KG", + "gtin": 7898042070029, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 0, + "gross_weight": 0, + "created_at": "2016-04-06T01:18:46.000-03:00", + "updated_at": "2022-11-26T11:08:38.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898042070029, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/BAC1922C01DFD56A5537925F49DF98BD.png", + "ncm": { + "code": "17011100", + "description": "De cana", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido - Açúcares em bruto, sem adição de aromatizantes ou de corantes: - De cana", + "ex": null + } + }, + { + "description": "AÇUCAR CRISTAL 2KG", + "gtin": 7898355600142, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 0, + "gross_weight": 0, + "created_at": "2016-04-06T01:36:15.000-03:00", + "updated_at": "2022-08-04T13:24:00.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898355600142, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/7A36EFA4C1C59AE4DE5D44543D2138AF.png", + "ncm": { + "code": "17011100", + "description": "De cana", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido - Açúcares em bruto, sem adição de aromatizantes ou de corantes: - De cana", + "ex": null + } + }, + { + "description": "CHICLE LIXX S / AÇUCAR .", + "gtin": 7896321007193, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": null, + "gross_weight": null, + "created_at": "2017-06-13T14:39:58.000-03:00", + "updated_at": "2021-04-08T14:09:32.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7896321007193, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/5E7C5F36FAC8B713E73437C079390071.png", + "brand": { + "name": "LIXX", + "picture": "/assets/brand-placeholder-7080174fbd24025783105a607811edad.png" + }, + "ncm": { + "code": "17041000", + "description": "Gomas de mascar (Pastilhas elásticas*), mesmo revestidas de açúcar", + "full_description": "Açúcares e produtos de confeitaria - Produtos de confeitaria sem cacau (incluindo o chocolate branco). - Gomas de mascar (Pastilhas elásticas*), mesmo revestidas de açúcar", + "ex": null + } + }, + { + "description": "ACUCAR MASCAVO 350G", + "gtin": 7898957516070, + "thumbnail": "https://cdn-cosmos.bluesoft.com.br/products/7898957516070", + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": null, + "gross_weight": null, + "created_at": "2016-06-07T15:56:47.000-03:00", + "updated_at": "2023-01-14T01:00:46.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898957516070, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/BA1590FC4D090B0F4E40997738B66EEB.png", + "brand": { + "name": "CHOCOLATE VERDE", + "picture": "/assets/brand-placeholder-7080174fbd24025783105a607811edad.png" + }, + "ncm": { + "code": "17019900", + "description": "Outros", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido. - Outros: - Outros", + "ex": null + }, + "cest": { + "id": 2148, + "code": "1709900", + "description": "Açúcar refinado, em embalagens de conteúdo inferior ou igual a 2 kg, exceto as embalagens contendo envelopes individualizados (sachês) de conteúdo inferior ou igual a 10 g", + "parent_id": 1671 + } + }, + { + "description": "ACUCAR FEST.CONFEITEIRO 1KG", + "gtin": 7898264510051, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 1, + "gross_weight": 1, + "created_at": "2016-04-06T00:58:07.000-03:00", + "updated_at": "2022-08-04T12:10:08.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898264510051, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/184BD2B02C56A7EC6587FC66E5F47A0C.png", + "ncm": { + "code": "17019900", + "description": "Outros", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido. - Outros: - Outros", + "ex": null + } + }, + { + "description": "AÇUCAR CRISTAL 1KG", + "gtin": 7896576200202, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 0, + "gross_weight": 0, + "created_at": "2016-04-06T01:19:09.000-03:00", + "updated_at": "2022-11-26T11:10:07.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7896576200202, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/08203CF8014F0597F1EEF2790ACC912F.png", + "ncm": { + "code": "17011100", + "description": "De cana", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido - Açúcares em bruto, sem adição de aromatizantes ou de corantes: - De cana", + "ex": null + } + }, + { + "description": "AÇUCAR CRISTAL 1KG", + "gtin": 7898994105343, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 0, + "gross_weight": 0, + "created_at": "2016-04-06T01:19:11.000-03:00", + "updated_at": "2022-07-05T11:04:43.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898994105343, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/E6E75AC8F64F649DD2402CBA553D3B46.png", + "ncm": { + "code": "17011100", + "description": "De cana", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido - Açúcares em bruto, sem adição de aromatizantes ou de corantes: - De cana", + "ex": null + } + }, + { + "description": "AÇUCAR CRISTAL 5KG", + "gtin": 7898903262051, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 0, + "gross_weight": 0, + "created_at": "2016-04-06T01:23:01.000-03:00", + "updated_at": "2022-12-11T14:02:58.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898903262051, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/11228394632641B28025A773F023259C.png", + "ncm": { + "code": "17011100", + "description": "De cana", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido - Açúcares em bruto, sem adição de aromatizantes ou de corantes: - De cana", + "ex": null + } + }, + { + "description": "AÇUCAR CRISTAL 2KG", + "gtin": 7898938738026, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 0, + "gross_weight": 0, + "created_at": "2016-04-06T01:30:34.000-03:00", + "updated_at": "2022-11-26T11:10:38.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898938738026, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/D07F471A796B2425320CE565D9A6E578.png", + "ncm": { + "code": "17011100", + "description": "De cana", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido - Açúcares em bruto, sem adição de aromatizantes ou de corantes: - De cana", + "ex": null + } + }, + { + "description": "AÇUCAR CRISTAL 1KG", + "gtin": 7898355600074, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 0, + "gross_weight": 0, + "created_at": "2016-04-06T01:30:30.000-03:00", + "updated_at": "2022-11-26T11:10:48.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898355600074, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/7A36EFA4C1C59AE402991D4428667AEC.png", + "ncm": { + "code": "17011100", + "description": "De cana", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido - Açúcares em bruto, sem adição de aromatizantes ou de corantes: - De cana", + "ex": null + } + }, + { + "description": "AÇUCAR CRISTAL 2KG", + "gtin": 7898368480021, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 0, + "gross_weight": 0, + "created_at": "2016-04-06T01:25:13.000-03:00", + "updated_at": "2022-04-11T22:45:55.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898368480021, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/98C4143F0132780ED0A1B98ED64F93F9.png", + "ncm": { + "code": "17011100", + "description": "De cana", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido - Açúcares em bruto, sem adição de aromatizantes ou de corantes: - De cana", + "ex": null + } + }, + { + "description": "AÇUCAR CRISTAL 5KG", + "gtin": 7898994105398, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 0, + "gross_weight": 0, + "created_at": "2016-04-06T01:25:15.000-03:00", + "updated_at": "2022-05-14T15:20:13.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898994105398, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/E6E75AC8F64F649D67A5F8AFE8956108.png", + "ncm": { + "code": "17019900", + "description": "Outros", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido. - Outros: - Outros", + "ex": null + } + }, + { + "description": "AÇUCAR CRISTAL 5KG", + "gtin": 7898994111917, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 0, + "gross_weight": 0, + "created_at": "2016-04-06T01:25:21.000-03:00", + "updated_at": "2022-12-29T11:11:41.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898994111917, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/E6E75AC8F64F649D203862AC2D8731E3.png", + "ncm": { + "code": "17011100", + "description": "De cana", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido - Açúcares em bruto, sem adição de aromatizantes ou de corantes: - De cana", + "ex": null + } + }, + { + "description": "AÇUCAR CRISTAL 5KG", + "gtin": 7898938738019, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 0, + "gross_weight": 0, + "created_at": "2016-04-06T01:25:12.000-03:00", + "updated_at": "2022-11-15T17:43:46.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898938738019, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/D07F471A796B2425EB3619ECD145675C.png", + "ncm": { + "code": "17011100", + "description": "De cana", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido - Açúcares em bruto, sem adição de aromatizantes ou de corantes: - De cana", + "ex": null + } + }, + { + "description": "AÇUCAR CRISTAL 5KG", + "gtin": 7898368480014, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 0, + "gross_weight": 0, + "created_at": "2016-04-06T01:25:12.000-03:00", + "updated_at": "2022-05-23T19:08:44.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898368480014, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/98C4143F0132780E5208E889537837D8.png", + "ncm": { + "code": "17019900", + "description": "Outros", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido. - Outros: - Outros", + "ex": null + } + }, + { + "description": "AÇUCAR CRISTAL 5KG", + "gtin": 7898926037063, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 0, + "gross_weight": 0, + "created_at": "2016-04-06T01:33:20.000-03:00", + "updated_at": "2022-06-04T13:53:25.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898926037063, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/346AF44333E690A6710A32974C51B6D0.png", + "ncm": { + "code": "17011100", + "description": "De cana", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido - Açúcares em bruto, sem adição de aromatizantes ou de corantes: - De cana", + "ex": null + } + }, + { + "description": "AÇUCAR CRISTAL 2KG", + "gtin": 7898163430023, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 0, + "gross_weight": 0, + "created_at": "2016-04-06T01:33:20.000-03:00", + "updated_at": "2022-03-24T11:47:52.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898163430023, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/F0E7D557600E314A4C819EFA8BDD7401.png", + "ncm": { + "code": "17011100", + "description": "De cana", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido - Açúcares em bruto, sem adição de aromatizantes ou de corantes: - De cana", + "ex": null + } + }, + { + "description": "AÇUCAR CRISTAL 5KG", + "gtin": 7898088870201, + "width": 0.0, + "height": 0.0, + "length": 0.0, + "net_weight": 0, + "gross_weight": 0, + "created_at": "2016-04-06T01:33:20.000-03:00", + "updated_at": "2021-07-11T10:18:57.000-03:00", + "release_date": null, + "price": null, + "avg_price": null, + "max_price": 0.0, + "min_price": 0.0, + "gtins": [ + { + "gtin": 7898088870201, + "commercial_unit": { + "type_packaging": "Unidade", + "quantity_packaging": 1, + "ballast": null, + "layer": null + } + } + ], + "origin": "COSMOS", + "barcode_image": "https://api.cosmos.bluesoft.com.br/products/barcode/4CD3535E6499764EB842313B20C746B6.png", + "ncm": { + "code": "17011100", + "description": "De cana", + "full_description": "Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido - Açúcares em bruto, sem adição de aromatizantes ou de corantes: - De cana", + "ex": null + } + } + ] +} \ No newline at end of file diff --git a/src/pages/index.js b/src/pages/index.js index db3ea08f..e732c072 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,15 +1,45 @@ import { FormSearchProducts } from "../components/formSearchProducts"; import { Header } from "../components/header"; import { SectionProducts } from "../components/sectionProducts"; +import { api } from "../services/api"; import { GlobalStyle } from "../styles/global"; -export default function Home() { +export default function Home(props) { + + const mocks = { + exemplo: require("../mocks/products.json") + } + + + return (
- +
) } + +///9?name=sla + +export async function getServerSideProps(context) { + + const { name } = context.query + + let products = null; + + // if (name) { + // const { data } = await api.get(`/products?query=${name}`) + // products = data + // } + + + + return { + props: { + products + } + } +} diff --git a/src/services/api.js b/src/services/api.js new file mode 100644 index 00000000..27d8b457 --- /dev/null +++ b/src/services/api.js @@ -0,0 +1,34 @@ +import axios from "axios"; + +const tokenBluesoft = process.env.TOKEN_BLUESOFT_COSMOS; + +export const api = axios.create({ + baseURL: "https://api.cosmos.bluesoft.com.br", + headers: { 'X-Cosmos-Token': "DytjRBuVJC5Gmd3dwUZxLA" }, + validateStatus: () => true + +}) + +export async function getProductByGtin(gtin) { + try { + const { status, data } = await api.get(`gtins/${gtin}`) + return { + status: status, + data: data + } + } catch (error) { + console.log(error); + } +} + +export async function getProductByName(name) { + try { + const { status, data } = await api.get(`gtins/${gtin}`) + return { + status: status, + data: data + } + } catch (error) { + console.log(error); + } +} \ No newline at end of file diff --git a/src/utils/titleCase.js b/src/utils/titleCase.js new file mode 100644 index 00000000..9d6a94e7 --- /dev/null +++ b/src/utils/titleCase.js @@ -0,0 +1,12 @@ +export const titleCase = text => { + + if (text?.length > 0) { + return text.toLowerCase() + .split(' ') + .map((word) => { + return word[0].toUpperCase() + word.slice(1); + }).join(' ') + } + + return "" +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index a9f0b62c..ba0b5297 100644 --- a/yarn.lock +++ b/yarn.lock @@ -495,11 +495,25 @@ ast-types-flow@^0.0.7: resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" integrity sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag== +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + axe-core@^4.4.3: version "4.6.0" resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.6.0.tgz#1d07514866fa51262734b3357932fcf86961383a" integrity sha512-L3ZNbXPTxMrl0+qTXAzn9FBRvk5XdO56K8CvcCKtlxv44Aw2w2NCclGuvCWxHPw1Riiq3ncP/sxFYj2nUqdoTw== +axios@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.2.2.tgz#72681724c6e6a43a9fea860fc558127dbe32f9f1" + integrity sha512-bz/J4gS2S3I7mpN/YZfGFTqhXTYzRho8Ay38w2otuuDR322KzFIWm/4W2K6gIwvWaws5n+mnb7D1lN9uD+QH6Q== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + axobject-query@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" @@ -610,6 +624,13 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -687,6 +708,11 @@ define-properties@^1.1.3, define-properties@^1.1.4: has-property-descriptors "^1.0.0" object-keys "^1.1.1" +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -1056,6 +1082,20 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== +follow-redirects@^1.15.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -1523,6 +1563,18 @@ micromatch@^4.0.4: braces "^3.0.2" picomatch "^2.3.1" +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.12: + 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" + minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -1757,6 +1809,11 @@ prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" From 1e2333c49677cd55e5642d676ca6c6ff765e614c Mon Sep 17 00:00:00 2001 From: Mateus Lopes <73197343+progmateus@users.noreply.github.com> Date: Mon, 16 Jan 2023 21:31:40 -0300 Subject: [PATCH 04/11] component pagination --- package.json | 1 + src/components/formSearchProducts/style.js | 5 +- src/components/pagination/index.jsx | 44 ++ src/components/pagination/style.js | 46 ++ src/components/sectionProducts/index.jsx | 2 - src/mocks/products.json | 856 ++++++++++----------- src/pages/index.js | 3 + yarn.lock | 9 +- 8 files changed, 518 insertions(+), 448 deletions(-) create mode 100644 src/components/pagination/index.jsx create mode 100644 src/components/pagination/style.js diff --git a/package.json b/package.json index 254f619d..ce4c60ab 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "react": "^18.2.0", "react-dom": "18.2.0", "react-icons": "^4.7.1", + "react-paginate": "^8.1.4", "styled-components": "^5.3.6" }, "devDependencies": { diff --git a/src/components/formSearchProducts/style.js b/src/components/formSearchProducts/style.js index dcd321ef..10e2aa74 100644 --- a/src/components/formSearchProducts/style.js +++ b/src/components/formSearchProducts/style.js @@ -2,7 +2,7 @@ import styled from "styled-components"; export const Container = styled.div` - margin-top: 1.5rem; + margin-top: 2rem; display: flex; justify-content: center; @@ -20,7 +20,8 @@ export const Container = styled.div` height: 2.5rem; margin-top: 0.6rem; border-radius: 70px; - border: 0.5px solid #000; + /// border: 0.1px solid #000; + box-shadow: 1px 1px 3px black; align-items: center; padding: 0.8rem; diff --git a/src/components/pagination/index.jsx b/src/components/pagination/index.jsx new file mode 100644 index 00000000..d52436aa --- /dev/null +++ b/src/components/pagination/index.jsx @@ -0,0 +1,44 @@ +import { useState } from 'react'; +import ReactPaginate from 'react-paginate'; +import { Container } from './style'; + + +const Pagination = (props) => { + + console.log("props: ", props.pageCount); + + const [itemOffset, setItemOffset] = useState(0); + + /// const endOffset = itemOffset + itemsPerPage; + /// console.log(`Loading items from ${itemOffset} to ${endOffset}`); + /// const currentItems = items.slice(itemOffset, endOffset); + ///const pageCount = Math.ceil(items.length / itemsPerPage); + + const handlePageClick = (event) => { + // const newOffset = (event.selected * itemsPerPage) % items.length; + // console.log( + // `User requested page number ${event.selected}, which is offset ${newOffset}` + // ); + // setItemOffset(newOffset); + + console.log(`User requested page number ${event.selected}`) + }; + + return ( + + + + + ) +} +export { Pagination }; \ No newline at end of file diff --git a/src/components/pagination/style.js b/src/components/pagination/style.js new file mode 100644 index 00000000..2de4e9b7 --- /dev/null +++ b/src/components/pagination/style.js @@ -0,0 +1,46 @@ +import styled from "styled-components"; + + +export const Container = styled.div` + display: flex; + + .container_className{ + display: flex; + list-style: none; + margin: 1rem auto; + + li{ + margin: 0 0.4rem; + background-color: #2E8CA3; + /// border: 1px solid #1F6B88; + border-radius: 10px; + box-shadow: 1px 1px 2px black; + padding: 0.6rem 0.8rem; + + + a{ + color: white; + font-weight: bold; + width: 100%; + + &:hover{ + cursor: pointer; + } + } + + &.selected{ + background-color: white; + -webkit-box-shadow: inset 0px 0px 5px #c1c1c1; + -moz-box-shadow: inset 0px 0px 5px #c1c1c1; + box-shadow: inset 0px 0px 5px #c1c1c1; + a{ + color: black; + } + } + } + } + + .activeLinkClassName{ + color: white; + } +`; \ No newline at end of file diff --git a/src/components/sectionProducts/index.jsx b/src/components/sectionProducts/index.jsx index 9fe638c6..e90ec43f 100644 --- a/src/components/sectionProducts/index.jsx +++ b/src/components/sectionProducts/index.jsx @@ -3,12 +3,10 @@ import { Container } from "./style" const SectionProducts = (props) => { - console.log(props.products) return ( { props.products.map((product) => { - console.log(product) return (
+
) } diff --git a/yarn.lock b/yarn.lock index ba0b5297..e14dfb74 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1800,7 +1800,7 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prop-types@^15.8.1: +prop-types@^15, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== @@ -1842,6 +1842,13 @@ react-is@^16.13.1, react-is@^16.7.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== +react-paginate@^8.1.4: + version "8.1.4" + resolved "https://registry.yarnpkg.com/react-paginate/-/react-paginate-8.1.4.tgz#f62bfef4f07bb420f3a994e0284d1065a865a6b9" + integrity sha512-c3rxjcTEqeDQa6LqXifxLeFguY2qy2CHGRphVjHLFFMGfIHyaJ+v3bOvIlLYEeohwQ1q+cQpknjsqBVrkc/SNA== + dependencies: + prop-types "^15" + react@^18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" From 3958ade8c76781ed06bd20f0bd0effb08a07581e Mon Sep 17 00:00:00 2001 From: Mateus Lopes <73197343+progmateus@users.noreply.github.com> Date: Tue, 17 Jan 2023 03:27:29 -0300 Subject: [PATCH 05/11] page list products --- src/components/formSearchProducts/index.jsx | 25 +++++-- src/components/pageProduct/index.jsx | 26 ++++++++ src/components/pageProduct/style.js | 72 +++++++++++++++++++++ src/components/pagination/index.jsx | 22 ++++--- src/components/productItem/index.jsx | 2 +- src/components/productItem/style.js | 6 +- src/components/sectionProducts/index.jsx | 2 +- src/pages/index.js | 54 ++++++++++++---- src/pages/products.js | 14 ++++ src/services/api.js | 2 +- 10 files changed, 197 insertions(+), 28 deletions(-) create mode 100644 src/components/pageProduct/index.jsx create mode 100644 src/components/pageProduct/style.js create mode 100644 src/pages/products.js diff --git a/src/components/formSearchProducts/index.jsx b/src/components/formSearchProducts/index.jsx index 993477a9..823665f4 100644 --- a/src/components/formSearchProducts/index.jsx +++ b/src/components/formSearchProducts/index.jsx @@ -1,15 +1,32 @@ import { Container } from "./style" import { BsSearch } from "react-icons/bs"; +import Router from "next/router"; const FormSearchProducts = () => { + + const handleKeyPressInput = (event) => { + event.preventDefault(); + const input = document.getElementById("input_search_products") + + Router.push(`/?name=${input.value}`) + } + + return (

Buscar produtos

-
- - -
+
+
+ + +
+
+
) diff --git a/src/components/pageProduct/index.jsx b/src/components/pageProduct/index.jsx new file mode 100644 index 00000000..a260bd45 --- /dev/null +++ b/src/components/pageProduct/index.jsx @@ -0,0 +1,26 @@ +import { Container } from "./style" + + +const PageProduct = () => { + return ( + +
+

LEITE FERMENTO DANONINHO LEITE

+
+ +
+

GTIN/EAN: 7891025301479

+
+
+

+ NCM: 0403.90.00 - Leite e laticínios; ovos de aves; mel natural; produtos comestíveis + de origem animal, não especificados nem compreendidos em outros Capítulos - Leitelho, + leite e creme de leite coalhados, iogurte, quefir e outros leites e cremes de leite + fermentados ou acidificados, mesmo concentrados ou adicionados de açúcar ou de outros + edulcorantes, ou aromatizados ou adicionados de frutas ou de cacau - Outros +

+
+
+ ) +} +export { PageProduct } \ No newline at end of file diff --git a/src/components/pageProduct/style.js b/src/components/pageProduct/style.js new file mode 100644 index 00000000..4e2ced1e --- /dev/null +++ b/src/components/pageProduct/style.js @@ -0,0 +1,72 @@ +import styled from "styled-components" + +export const Container = styled.div` + + margin-top: 4rem; + + .header_product{ + text-align: center; + + div{ + margin-top: 2rem; + } + + h1{ + font-size: 24px; + } + + img{ + max-width: 12rem; + max-height: 12rem; + } + + p{ + font-weight: bold; + margin-top: 1rem; + opacity: 0.6; + } + + } + + .footer_product{ + margin: 2rem auto; + line-height: 1.5em; + max-width: 34rem; + } + + + + + @media (max-width: 768px){ + .footer_product{ + max-width: 34rem; + } + } + + + + + @media (max-width: 688px) { + + margin-top: 5rem; + padding: 0 3rem; + + .header_product{ + text-align: center; + + h1{ + margin: 0 auto; + font-size: 18px; + max-width: 22rem; + } + + img{ + max-width: 10rem; + max-height: 10rem; + } + } + } + + + +`; \ No newline at end of file diff --git a/src/components/pagination/index.jsx b/src/components/pagination/index.jsx index d52436aa..b8535682 100644 --- a/src/components/pagination/index.jsx +++ b/src/components/pagination/index.jsx @@ -1,12 +1,11 @@ import { useState } from 'react'; import ReactPaginate from 'react-paginate'; +import { api } from '../../services/api'; import { Container } from './style'; const Pagination = (props) => { - console.log("props: ", props.pageCount); - const [itemOffset, setItemOffset] = useState(0); /// const endOffset = itemOffset + itemsPerPage; @@ -14,14 +13,18 @@ const Pagination = (props) => { /// const currentItems = items.slice(itemOffset, endOffset); ///const pageCount = Math.ceil(items.length / itemsPerPage); - const handlePageClick = (event) => { - // const newOffset = (event.selected * itemsPerPage) % items.length; - // console.log( - // `User requested page number ${event.selected}, which is offset ${newOffset}` - // ); - // setItemOffset(newOffset); + const handlePageClick = async (event) => { + console.log("Entrou na função") + + console.log("Name: ", props.product_name) + + const { data } = await api.get(`/products?page=${(event.selected + 1)}&query=${props.product_name}`) + + console.log(`User requested page number ${(event.selected + 1)}`) + console.log(`Pagina atual ${data.current_page}`) + + props.setdataProducts(data) - console.log(`User requested page number ${event.selected}`) }; return ( @@ -29,6 +32,7 @@ const Pagination = (props) => { { diff --git a/src/components/productItem/style.js b/src/components/productItem/style.js index 93d5249a..7ea520bc 100644 --- a/src/components/productItem/style.js +++ b/src/components/productItem/style.js @@ -14,6 +14,10 @@ export const Container = styled.div` img{ text-align: center; max-width: 10rem; + min-width: 10rem; + max-height: 10rem; + min-height: 10rem; + } div{ @@ -81,5 +85,5 @@ export const Container = styled.div` max-width: 7rem; } } - } + } `; \ No newline at end of file diff --git a/src/components/sectionProducts/index.jsx b/src/components/sectionProducts/index.jsx index e90ec43f..13eb0e83 100644 --- a/src/components/sectionProducts/index.jsx +++ b/src/components/sectionProducts/index.jsx @@ -6,7 +6,7 @@ const SectionProducts = (props) => { return ( { - props.products.map((product) => { + props.products && props.products.map((product) => { return ( { + setdataProducts(props.dataProducts) + setPoductName(props.name) + }, [props.name]) + console.log(props.name) return ( @@ -19,30 +30,51 @@ export default function Home(props) {
- - + { + dataProducts && ( + <> + + + + ) + } +
) } -///9?name=sla - export async function getServerSideProps(context) { - const { name } = context.query - let products = null; + let dataProducts = null; + let { name } = context.query + let error = null - // if (name) { - // const { data } = await api.get(`/products?query=${name}`) - // products = data - // } + if (!name) { + name = null; + } + + if (name) { + const { data } = await api.get(`/products?query=${name}`) + if (data.message) { + error = data.message + } + if (data.products) { + dataProducts = data + } + } return { props: { - products + dataProducts, + name, + error } } } diff --git a/src/pages/products.js b/src/pages/products.js new file mode 100644 index 00000000..1742887b --- /dev/null +++ b/src/pages/products.js @@ -0,0 +1,14 @@ +import { Header } from "../components/header"; +import { PageProduct } from "../components/pageProduct"; +import { GlobalStyle } from "../styles/global"; + + +export default function Products() { + return ( + <> + +
+ + + ) +} \ No newline at end of file diff --git a/src/services/api.js b/src/services/api.js index 27d8b457..19a7833a 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -4,7 +4,7 @@ const tokenBluesoft = process.env.TOKEN_BLUESOFT_COSMOS; export const api = axios.create({ baseURL: "https://api.cosmos.bluesoft.com.br", - headers: { 'X-Cosmos-Token': "DytjRBuVJC5Gmd3dwUZxLA" }, + headers: { 'X-Cosmos-Token': "HmUVWX_o-dpQcV-7UcrMGg" }, validateStatus: () => true }) From 4f423d998fb3f2b42e8c7817946bc1d7565de203 Mon Sep 17 00:00:00 2001 From: Mateus Lopes <73197343+progmateus@users.noreply.github.com> Date: Tue, 17 Jan 2023 04:07:57 -0300 Subject: [PATCH 06/11] page product info --- src/components/pageProduct/index.jsx | 16 ++++----- src/components/pageProduct/style.js | 9 ++++- src/components/pagination/index.jsx | 13 ------- src/components/productItem/index.jsx | 4 +-- src/components/sectionProducts/index.jsx | 1 + src/pages/index.js | 7 ---- src/pages/products.js | 14 -------- src/pages/products/[gtin].js | 43 ++++++++++++++++++++++++ src/services/api.js | 2 +- 9 files changed, 62 insertions(+), 47 deletions(-) delete mode 100644 src/pages/products.js create mode 100644 src/pages/products/[gtin].js diff --git a/src/components/pageProduct/index.jsx b/src/components/pageProduct/index.jsx index a260bd45..843596de 100644 --- a/src/components/pageProduct/index.jsx +++ b/src/components/pageProduct/index.jsx @@ -1,23 +1,21 @@ import { Container } from "./style" +const defaultThumbnailURL = "https://cosmos.bluesoft.com.br/assets/product-placeholder-ce4926921923d1e9bc66cd0e1493b49b.png" + +const PageProduct = (props) => { -const PageProduct = () => { return (
-

LEITE FERMENTO DANONINHO LEITE

+

{props.data?.description}

- +
-

GTIN/EAN: 7891025301479

+

GTIN/EAN: {props.data?.gtin}

- NCM: 0403.90.00 - Leite e laticínios; ovos de aves; mel natural; produtos comestíveis - de origem animal, não especificados nem compreendidos em outros Capítulos - Leitelho, - leite e creme de leite coalhados, iogurte, quefir e outros leites e cremes de leite - fermentados ou acidificados, mesmo concentrados ou adicionados de açúcar ou de outros - edulcorantes, ou aromatizados ou adicionados de frutas ou de cacau - Outros + NCM: {props.data?.ncm.full_description}

diff --git a/src/components/pageProduct/style.js b/src/components/pageProduct/style.js index 4e2ced1e..5de48378 100644 --- a/src/components/pageProduct/style.js +++ b/src/components/pageProduct/style.js @@ -21,17 +21,24 @@ export const Container = styled.div` } p{ + font-weight: bold; + font-size: 18px; margin-top: 1rem; opacity: 0.6; + } } .footer_product{ - margin: 2rem auto; + margin: 1.5rem auto; line-height: 1.5em; max-width: 34rem; + + p{ + font-size: 16px + } } diff --git a/src/components/pagination/index.jsx b/src/components/pagination/index.jsx index b8535682..1bd3e8da 100644 --- a/src/components/pagination/index.jsx +++ b/src/components/pagination/index.jsx @@ -6,23 +6,10 @@ import { Container } from './style'; const Pagination = (props) => { - const [itemOffset, setItemOffset] = useState(0); - - /// const endOffset = itemOffset + itemsPerPage; - /// console.log(`Loading items from ${itemOffset} to ${endOffset}`); - /// const currentItems = items.slice(itemOffset, endOffset); - ///const pageCount = Math.ceil(items.length / itemsPerPage); - const handlePageClick = async (event) => { - console.log("Entrou na função") - - console.log("Name: ", props.product_name) const { data } = await api.get(`/products?page=${(event.selected + 1)}&query=${props.product_name}`) - console.log(`User requested page number ${(event.selected + 1)}`) - console.log(`Pagina atual ${data.current_page}`) - props.setdataProducts(data) }; diff --git a/src/components/productItem/index.jsx b/src/components/productItem/index.jsx index 38e71da2..a3bbb55f 100644 --- a/src/components/productItem/index.jsx +++ b/src/components/productItem/index.jsx @@ -12,12 +12,12 @@ const ProductItem = (props) => {
- {titleCase(props.name)} + {titleCase(props.name)}

{props.brand ? props.brand : "Não informado"}

diff --git a/src/components/sectionProducts/index.jsx b/src/components/sectionProducts/index.jsx index 13eb0e83..c25dc2b0 100644 --- a/src/components/sectionProducts/index.jsx +++ b/src/components/sectionProducts/index.jsx @@ -13,6 +13,7 @@ const SectionProducts = (props) => { name={String(product.description)} brand={product.brand?.name} thumbnail={product.thumbnail} + gtin={product.gtin} /> ) }) diff --git a/src/pages/index.js b/src/pages/index.js index e49c8d86..22ef52c4 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -8,22 +8,15 @@ import { GlobalStyle } from "../styles/global"; export default function Home(props) { - console.log("Error:", props.error); const [dataProducts, setdataProducts] = useState(props.dataProducts) const [productName, setPoductName] = useState(props.name) - const mocks = { - exemplo: require("../mocks/products.json") - } - useEffect(() => { setdataProducts(props.dataProducts) setPoductName(props.name) }, [props.name]) - console.log(props.name) - return (
diff --git a/src/pages/products.js b/src/pages/products.js deleted file mode 100644 index 1742887b..00000000 --- a/src/pages/products.js +++ /dev/null @@ -1,14 +0,0 @@ -import { Header } from "../components/header"; -import { PageProduct } from "../components/pageProduct"; -import { GlobalStyle } from "../styles/global"; - - -export default function Products() { - return ( - <> - -
- - - ) -} \ No newline at end of file diff --git a/src/pages/products/[gtin].js b/src/pages/products/[gtin].js new file mode 100644 index 00000000..d8e60112 --- /dev/null +++ b/src/pages/products/[gtin].js @@ -0,0 +1,43 @@ +import { Header } from "../../components/header"; +import { PageProduct } from "../../components/pageProduct"; +import { api } from "../../services/api"; +import { GlobalStyle } from "../../styles/global"; + + +export default function Products(props) { + return ( + <> + +
+ + + ) +} + + +export async function getServerSideProps(context) { + + let dataProduct = null; + let { gtin } = context.query + let error = null + + + if (gtin) { + const { data } = await api.get(`/gtins/${gtin}`) + + if (data.message) { + error = data.message + } + + if (data) { + dataProduct = data + } + } + + return { + props: { + dataProduct, + error + } + } +} \ No newline at end of file diff --git a/src/services/api.js b/src/services/api.js index 19a7833a..97540a89 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -4,7 +4,7 @@ const tokenBluesoft = process.env.TOKEN_BLUESOFT_COSMOS; export const api = axios.create({ baseURL: "https://api.cosmos.bluesoft.com.br", - headers: { 'X-Cosmos-Token': "HmUVWX_o-dpQcV-7UcrMGg" }, + headers: { 'X-Cosmos-Token': "VfF1jiCaOwnPgfTGJn5bmQ" }, validateStatus: () => true }) From 60bd3adc4492a8be6c7074b8e1d335d831488bfd Mon Sep 17 00:00:00 2001 From: Mateus Lopes <73197343+progmateus@users.noreply.github.com> Date: Tue, 17 Jan 2023 19:36:28 -0300 Subject: [PATCH 07/11] untying component searchProducts --- .../index.jsx | 15 ++++----- .../style.js | 0 src/pages/index.js | 18 +++++++++-- src/pages/status.js | 30 ++++++++++++++++++ src/services/api.js | 31 ++----------------- 5 files changed, 54 insertions(+), 40 deletions(-) rename src/components/{formSearchProducts => formSearchItem}/index.jsx (65%) rename src/components/{formSearchProducts => formSearchItem}/style.js (100%) create mode 100644 src/pages/status.js diff --git a/src/components/formSearchProducts/index.jsx b/src/components/formSearchItem/index.jsx similarity index 65% rename from src/components/formSearchProducts/index.jsx rename to src/components/formSearchItem/index.jsx index 823665f4..65c6057c 100644 --- a/src/components/formSearchProducts/index.jsx +++ b/src/components/formSearchItem/index.jsx @@ -2,34 +2,31 @@ import { Container } from "./style" import { BsSearch } from "react-icons/bs"; import Router from "next/router"; -const FormSearchProducts = () => { +const FormSearchItem = (props) => { const handleKeyPressInput = (event) => { event.preventDefault(); - const input = document.getElementById("input_search_products") - - Router.push(`/?name=${input.value}`) + props.handleKeyPressInput() } - return (
-

Buscar produtos

+

{props.label}

-
+ ) } -export { FormSearchProducts } \ No newline at end of file +export { FormSearchItem } \ No newline at end of file diff --git a/src/components/formSearchProducts/style.js b/src/components/formSearchItem/style.js similarity index 100% rename from src/components/formSearchProducts/style.js rename to src/components/formSearchItem/style.js diff --git a/src/pages/index.js b/src/pages/index.js index 22ef52c4..c9adf339 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,10 +1,12 @@ import { useEffect, useState } from "react"; -import { FormSearchProducts } from "../components/formSearchProducts"; +import { FormSearchItem } from "../components/formSearchItem"; import { Header } from "../components/header"; import { Pagination } from "../components/pagination"; import { SectionProducts } from "../components/sectionProducts"; import { api } from "../services/api"; import { GlobalStyle } from "../styles/global"; +import Router from "next/router"; + export default function Home(props) { @@ -12,17 +14,29 @@ export default function Home(props) { const [dataProducts, setdataProducts] = useState(props.dataProducts) const [productName, setPoductName] = useState(props.name) + console.log(props.error); + + useEffect(() => { setdataProducts(props.dataProducts) setPoductName(props.name) }, [props.name]) + const handleKeyPressInput = () => { + const input = document.getElementById("input_search_products") + Router.push(`/?name=${input.value}`) + } return (
- + { dataProducts && ( <> diff --git a/src/pages/status.js b/src/pages/status.js new file mode 100644 index 00000000..7848f57f --- /dev/null +++ b/src/pages/status.js @@ -0,0 +1,30 @@ +import { FormSearchItem } from "../components/formSearchItem"; +import { Header } from "../components/header"; +import { GlobalStyle } from "../styles/global"; + + + +export default function Status() { + + + const handleKeyPressInput = (event) => { + event.preventDefault(); + props.handleKeyPressInput() + } + + + return ( + <> + +
+ + + + + ) + +} \ No newline at end of file diff --git a/src/services/api.js b/src/services/api.js index 97540a89..d8cceb94 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -1,34 +1,7 @@ import axios from "axios"; -const tokenBluesoft = process.env.TOKEN_BLUESOFT_COSMOS; - export const api = axios.create({ baseURL: "https://api.cosmos.bluesoft.com.br", - headers: { 'X-Cosmos-Token': "VfF1jiCaOwnPgfTGJn5bmQ" }, + headers: { 'X-Cosmos-Token': "rsTaQyQlnf-0ldY78mFScg" }, validateStatus: () => true - -}) - -export async function getProductByGtin(gtin) { - try { - const { status, data } = await api.get(`gtins/${gtin}`) - return { - status: status, - data: data - } - } catch (error) { - console.log(error); - } -} - -export async function getProductByName(name) { - try { - const { status, data } = await api.get(`gtins/${gtin}`) - return { - status: status, - data: data - } - } catch (error) { - console.log(error); - } -} \ No newline at end of file +}); \ No newline at end of file From 8af774e3670226187b63ecee826a686aad047365 Mon Sep 17 00:00:00 2001 From: Mateus Lopes <73197343+progmateus@users.noreply.github.com> Date: Wed, 18 Jan 2023 02:05:16 -0300 Subject: [PATCH 08/11] component theme mode --- src/components/formSearchItem/index.jsx | 9 +- src/components/formSearchItem/style.js | 21 +- src/components/header/index.jsx | 18 +- src/components/header/style.js | 16 +- src/components/pageProduct/index.jsx | 12 +- src/components/pageProduct/style.js | 16 +- src/components/pagination/index.jsx | 8 +- src/components/pagination/style.js | 3 +- src/components/productItem/index.jsx | 12 +- src/components/productItem/style.js | 9 +- src/components/themeMode/index.jsx | 26 + src/components/themeMode/style.js | 47 + src/contextx/themeContext.js | 24 + src/pages/_app.js | 11 +- src/pages/index.js | 1161 ++++++++++++++++++++++- src/pages/products/[gtin].js | 7 +- src/pages/status.js | 17 +- src/services/api.js | 2 +- src/styles/global.js | 4 + src/styles/theme.js | 13 + 20 files changed, 1400 insertions(+), 36 deletions(-) create mode 100644 src/components/themeMode/index.jsx create mode 100644 src/components/themeMode/style.js create mode 100644 src/contextx/themeContext.js create mode 100644 src/styles/theme.js diff --git a/src/components/formSearchItem/index.jsx b/src/components/formSearchItem/index.jsx index 65c6057c..3eac6c52 100644 --- a/src/components/formSearchItem/index.jsx +++ b/src/components/formSearchItem/index.jsx @@ -1,22 +1,27 @@ import { Container } from "./style" import { BsSearch } from "react-icons/bs"; import Router from "next/router"; +import { ThemeContext } from "../../contextx/themeContext"; +import { useContext } from "react"; const FormSearchItem = (props) => { + const { theme, setTheme } = useContext(ThemeContext); + + const handleKeyPressInput = (event) => { event.preventDefault(); props.handleKeyPressInput() } return ( - +

{props.label}

diff --git a/src/components/formSearchItem/style.js b/src/components/formSearchItem/style.js index 10e2aa74..afc223a7 100644 --- a/src/components/formSearchItem/style.js +++ b/src/components/formSearchItem/style.js @@ -9,9 +9,9 @@ export const Container = styled.div` div{ h1{ - color: black; - font-size: 36px; - text-align: center; + color: ${(props) => props.theme.fontColor}; + font-size: 36px; + text-align: center; } div{ @@ -24,6 +24,8 @@ export const Container = styled.div` box-shadow: 1px 1px 3px black; align-items: center; padding: 0.8rem; + color: ${(props) => props.theme.fontColor}; + input{ width: 20rem; @@ -31,7 +33,18 @@ export const Container = styled.div` padding: 3px; font-size: 14px; outline: none; - border: none; + border: none; + background-color: ${(props) => props.theme.bg}; + color: ${(props) => props.theme.fontColor}; + + &::placeholder { + color: ${(props) => props.theme.fontColor}; + opacity: 0.6; + } + + &:focus{ + background-color: ${(props) => props.theme.bg}; + } } } } diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index 0c6b882f..f982537c 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -1,14 +1,18 @@ +import Link from "next/link" import { Container } from "./style" +import { AiFillHome } from "react-icons/ai"; +import { useContext } from "react"; +import { ThemeContext } from "../../contextx/themeContext"; +import { ThemeMode } from "../themeMode"; + const Header = () => { + + const { theme, setTheme } = useContext(ThemeContext); + return ( - - + + ) } diff --git a/src/components/header/style.js b/src/components/header/style.js index 63635fbe..dd059340 100644 --- a/src/components/header/style.js +++ b/src/components/header/style.js @@ -3,14 +3,24 @@ import styled from "styled-components" export const Container = styled.header` display: flex; - background-color: #3FAFBE; + + background-color: ${(props) => props.theme.bgHeader}; + height: 4rem; width: 100%; align-items: center; justify-content: center; font-size: 1.2rem; - ul { + svg{ + font-size: 28px; + + path{ + color: white; + } + } + + /* ul { display: flex; justify-content: space-between; width: 10rem; @@ -23,6 +33,6 @@ export const Container = styled.header` color: white; } } - } + } */ `; diff --git a/src/components/pageProduct/index.jsx b/src/components/pageProduct/index.jsx index 843596de..b77137a4 100644 --- a/src/components/pageProduct/index.jsx +++ b/src/components/pageProduct/index.jsx @@ -1,11 +1,16 @@ +import Link from "next/link" +import { useContext } from "react"; +import { ThemeContext } from "../../contextx/themeContext"; import { Container } from "./style" const defaultThumbnailURL = "https://cosmos.bluesoft.com.br/assets/product-placeholder-ce4926921923d1e9bc66cd0e1493b49b.png" const PageProduct = (props) => { + const { theme, setTheme } = useContext(ThemeContext); + return ( - +

{props.data?.description}

@@ -17,7 +22,12 @@ const PageProduct = (props) => {

NCM: {props.data?.ncm.full_description}

+ < Link href="/"> + Voltar ao inicio +
+ + ) } diff --git a/src/components/pageProduct/style.js b/src/components/pageProduct/style.js index 5de48378..e0bdf643 100644 --- a/src/components/pageProduct/style.js +++ b/src/components/pageProduct/style.js @@ -13,6 +13,7 @@ export const Container = styled.div` h1{ font-size: 24px; + color: ${(props) => props.theme.fontColor} } img{ @@ -21,9 +22,9 @@ export const Container = styled.div` } p{ - font-weight: bold; font-size: 18px; + color: ${(props) => props.theme.fontColor}; margin-top: 1rem; opacity: 0.6; @@ -35,15 +36,26 @@ export const Container = styled.div` margin: 1.5rem auto; line-height: 1.5em; max-width: 34rem; + text-align: center; p{ - font-size: 16px + font-size: 16px; + text-align: left; + margin-bottom: 2rem; + color: ${(props) => props.theme.fontColor}; + + } + + a{ + color: ${(props) => props.theme.linkColor}; } } + + @media (max-width: 768px){ .footer_product{ max-width: 34rem; diff --git a/src/components/pagination/index.jsx b/src/components/pagination/index.jsx index 1bd3e8da..63de17e1 100644 --- a/src/components/pagination/index.jsx +++ b/src/components/pagination/index.jsx @@ -1,11 +1,15 @@ -import { useState } from 'react'; +import { useContext, useState } from 'react'; import ReactPaginate from 'react-paginate'; +import { ThemeContext } from '../../contextx/themeContext'; import { api } from '../../services/api'; import { Container } from './style'; const Pagination = (props) => { + const { theme, setTheme } = useContext(ThemeContext); + + const handlePageClick = async (event) => { const { data } = await api.get(`/products?page=${(event.selected + 1)}&query=${props.product_name}`) @@ -15,7 +19,7 @@ const Pagination = (props) => { }; return ( - + props.theme.bgHeader}; /// border: 1px solid #1F6B88; border-radius: 10px; box-shadow: 1px 1px 2px black; diff --git a/src/components/productItem/index.jsx b/src/components/productItem/index.jsx index a3bbb55f..a3d3c85e 100644 --- a/src/components/productItem/index.jsx +++ b/src/components/productItem/index.jsx @@ -1,3 +1,6 @@ +import Image from "next/image"; +import { useContext } from "react"; +import { ThemeContext } from "../../contextx/themeContext"; import { titleCase } from "../../utils/titleCase" import { Container } from "./style" @@ -5,11 +8,16 @@ const productImageURL = "https://cosmos.bluesoft.com.br/assets/product-placehold const ProductItem = (props) => { + const { theme, setTheme } = useContext(ThemeContext); + return ( - +
- + {`Imagem
{titleCase(props.name)} diff --git a/src/components/productItem/style.js b/src/components/productItem/style.js index 7ea520bc..5900713e 100644 --- a/src/components/productItem/style.js +++ b/src/components/productItem/style.js @@ -14,10 +14,9 @@ export const Container = styled.div` img{ text-align: center; max-width: 10rem; - min-width: 10rem; max-height: 10rem; - min-height: 10rem; - + min-width: 5rem; + min-height: 5rem; } div{ @@ -44,6 +43,8 @@ export const Container = styled.div` min-height: 3rem; margin: 0.5rem 0; text-decoration: none; + color: ${(props) => props.theme.fontColor}; + &:hover{ text-decoration: underline; @@ -52,6 +53,7 @@ export const Container = styled.div` } p{ + color: ${(props) => props.theme.fontColor}; margin-top: 0.8rem; text-align: left; opacity: 0.8; @@ -65,6 +67,7 @@ export const Container = styled.div` justify-content: center; a{ + color: ${(props) => props.theme.fontColor}; text-decoration: none; opacity: 0.8; } diff --git a/src/components/themeMode/index.jsx b/src/components/themeMode/index.jsx new file mode 100644 index 00000000..57aa5548 --- /dev/null +++ b/src/components/themeMode/index.jsx @@ -0,0 +1,26 @@ +import { Container } from "./style" +import { BsFillSunFill, BsMoonFill } from "react-icons/bs" +import { useContext } from "react" +import { ThemeContext } from "../../contextx/themeContext" + + +const ThemeMode = () => { + + const { mode, setMode } = useContext(ThemeContext) + + const handleCheckboxChange = () => { + mode === "ligth" ? setMode("dark") : setMode("ligth") + } + + return ( + + + + + ) +} +export { ThemeMode } \ No newline at end of file diff --git a/src/components/themeMode/style.js b/src/components/themeMode/style.js new file mode 100644 index 00000000..b3d34491 --- /dev/null +++ b/src/components/themeMode/style.js @@ -0,0 +1,47 @@ +import styled from "styled-components" + + +export const Container = styled.div` + input{ + opacity: 0; + position: absolute; + + &:checked + label div{ + transform: translateX(1.5rem) + } + } + + label{ + display: flex; + position: relative; + width: 3.125rem; + height: 1.625rem; + align-items: center; + background-color: black; + justify-content: space-between; + border-radius: 50px; + cursor: pointer; + padding: 5px; + transform: scale(1.5); + + div{ + background-color: white; + border-radius: 50px; + position: absolute; + top: 2px; + left: 2px; + width: 1.375rem; + height: 1.375rem; + transform: translateX(0px); + transition: transform 0.2s linear; + } + } + + svg{ + font-size: 16px; + + path{ + color: #f1c40f; + } + } +`; \ No newline at end of file diff --git a/src/contextx/themeContext.js b/src/contextx/themeContext.js new file mode 100644 index 00000000..6b5f96e8 --- /dev/null +++ b/src/contextx/themeContext.js @@ -0,0 +1,24 @@ +import { createContext, useEffect, useState } from "react"; +import { darkTheme, ligthTheme } from "../styles/theme"; + +export const ThemeContext = createContext({}); + +export function ThemeProvider({ children }) { + const [mode, setMode] = useState("ligth") + const [theme, setTheme] = useState({}) + + + useEffect(() => { + mode === "ligth" ? setTheme(ligthTheme) : setTheme(darkTheme) + }, [mode]) + + const onChangeTheme = () => { + theme === "ligth" ? setTheme("dark") : setTheme("ligth") + } + + return ( + + {children} + + ) +} \ No newline at end of file diff --git a/src/pages/_app.js b/src/pages/_app.js index 23d1ca6c..117628dd 100644 --- a/src/pages/_app.js +++ b/src/pages/_app.js @@ -1,6 +1,15 @@ +import { useContext } from "react"; +import { ThemeContext, ThemeProvider } from "../contextx/themeContext" +import { GlobalStyle } from "../styles/global" function MyApp({ Component, pageProps }) { - return + + + return ( + + + + ) } export default MyApp diff --git a/src/pages/index.js b/src/pages/index.js index c9adf339..fe7b118b 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,4 +1,4 @@ -import { useEffect, useState } from "react"; +import { useContext, useEffect, useState } from "react"; import { FormSearchItem } from "../components/formSearchItem"; import { Header } from "../components/header"; import { Pagination } from "../components/pagination"; @@ -6,10 +6,12 @@ import { SectionProducts } from "../components/sectionProducts"; import { api } from "../services/api"; import { GlobalStyle } from "../styles/global"; import Router from "next/router"; +import { ThemeContext, ThemeProvider } from "../contextx/themeContext"; export default function Home(props) { + const { theme, setTheme } = useContext(ThemeContext); const [dataProducts, setdataProducts] = useState(props.dataProducts) const [productName, setPoductName] = useState(props.name) @@ -23,13 +25,13 @@ export default function Home(props) { }, [props.name]) const handleKeyPressInput = () => { - const input = document.getElementById("input_search_products") + const input = document.getElementById("input_search_items") Router.push(`/?name=${input.value}`) } return (
- +
- +
diff --git a/src/pages/status.js b/src/pages/status.js index 7848f57f..0636319d 100644 --- a/src/pages/status.js +++ b/src/pages/status.js @@ -1,3 +1,4 @@ +import axios from "axios"; import { FormSearchItem } from "../components/formSearchItem"; import { Header } from "../components/header"; import { GlobalStyle } from "../styles/global"; @@ -6,10 +7,20 @@ import { GlobalStyle } from "../styles/global"; export default function Status() { + const handleKeyPressInput = async () => { - const handleKeyPressInput = (event) => { - event.preventDefault(); - props.handleKeyPressInput() + try { + const input = document.getElementById("input_search_items") + + const { data } = await axios.get("https://dog.ceo/api/breeds/image/randomFetch!", {}, + { + headers: { + "Access-Control-Allow-Origin": "*" + }, + }) + } catch (error) { + + } } diff --git a/src/services/api.js b/src/services/api.js index d8cceb94..6998ce4d 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -2,6 +2,6 @@ import axios from "axios"; export const api = axios.create({ baseURL: "https://api.cosmos.bluesoft.com.br", - headers: { 'X-Cosmos-Token': "rsTaQyQlnf-0ldY78mFScg" }, + headers: { 'X-Cosmos-Token': "aMLH5bIfXrSIZkfjs6c7YQ" }, validateStatus: () => true }); \ No newline at end of file diff --git a/src/styles/global.js b/src/styles/global.js index 2e2547e8..5e9ab220 100644 --- a/src/styles/global.js +++ b/src/styles/global.js @@ -8,6 +8,10 @@ export const GlobalStyle = createGlobalStyle` font-family: Arial, Helvetica, sans-serif; } + body{ + transition: background 0.2 linear; + background-color: ${(props) => props.theme.bg}; + } html{ diff --git a/src/styles/theme.js b/src/styles/theme.js new file mode 100644 index 00000000..4f969a2c --- /dev/null +++ b/src/styles/theme.js @@ -0,0 +1,13 @@ +export const ligthTheme = { + bg: "#FFFFFF", + fontColor: "#252525", + bgHeader: "#3FAFBE", + linkColor: "#0000FF" +} + +export const darkTheme = { + bg: "#243447", + fontColor: "#ffffff", + bgHeader: "#1A283D", + linkColor: "#1081DB" +} \ No newline at end of file From 8b3571b51d094c884ca9fc9abc3f71afee97cf29 Mon Sep 17 00:00:00 2001 From: Mateus Lopes <73197343+progmateus@users.noreply.github.com> Date: Wed, 18 Jan 2023 03:05:03 -0300 Subject: [PATCH 09/11] component messagebox --- src/components/formSearchItem/index.jsx | 2 +- src/components/formSearchItem/style.js | 4 ++-- src/components/messageBox/index.jsx | 24 ++++++++++++++++++++++ src/components/messageBox/style.js | 27 +++++++++++++++++++++++++ src/pages/index.js | 14 ++++++++++--- src/services/api.js | 2 +- 6 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 src/components/messageBox/index.jsx create mode 100644 src/components/messageBox/style.js diff --git a/src/components/formSearchItem/index.jsx b/src/components/formSearchItem/index.jsx index 3eac6c52..8e99116a 100644 --- a/src/components/formSearchItem/index.jsx +++ b/src/components/formSearchItem/index.jsx @@ -6,7 +6,7 @@ import { useContext } from "react"; const FormSearchItem = (props) => { - const { theme, setTheme } = useContext(ThemeContext); + const { theme } = useContext(ThemeContext); const handleKeyPressInput = (event) => { diff --git a/src/components/formSearchItem/style.js b/src/components/formSearchItem/style.js index afc223a7..29767791 100644 --- a/src/components/formSearchItem/style.js +++ b/src/components/formSearchItem/style.js @@ -18,9 +18,9 @@ export const Container = styled.div` display: flex; width: 22rem; height: 2.5rem; - margin-top: 0.6rem; + margin-top: 1.5rem; border-radius: 70px; - /// border: 0.1px solid #000; + box-shadow: 1px 1px 3px black; align-items: center; padding: 0.8rem; diff --git a/src/components/messageBox/index.jsx b/src/components/messageBox/index.jsx new file mode 100644 index 00000000..5b00c4ab --- /dev/null +++ b/src/components/messageBox/index.jsx @@ -0,0 +1,24 @@ +import { useContext } from "react" +import { ThemeContext } from "../../contextx/themeContext" +import { Container } from "./style" +import { IoWarning } from "react-icons/io5" + + + +const MessageBox = () => { + + const { mode } = useContext(ThemeContext) + + return ( + + + + +

+ Nenhum resultado encontrado +

+
+ ) +} + +export { MessageBox } \ No newline at end of file diff --git a/src/components/messageBox/style.js b/src/components/messageBox/style.js new file mode 100644 index 00000000..67bb395c --- /dev/null +++ b/src/components/messageBox/style.js @@ -0,0 +1,27 @@ +import styled from "styled-components" + +export const Container = styled.div` + display: flex; + margin: 4rem auto; + justify-content: center; + align-items: center; + width: 22rem; + height: 5rem; + color: ${(props) => props.theme.fontColor}; + background-color:#b0fbf1; + background-color: ${(props) => props.mode === "ligth" ? "#b0fbf1" : "#1A283D"}; + border-radius: 3px; + border: 0.01px solid #65EEC1; + + p{ + color: ${(props) => props.mode === "ligth" ? "#09c7ac" : "#8CADC7"}; + font-size: 18px; + margin-left: 0.4rem; + } + + svg{ + color: ${(props) => props.mode === "ligth" ? "#09c7ac" : "#8CADC7"}; + font-size: 18px + } + +`; \ No newline at end of file diff --git a/src/pages/index.js b/src/pages/index.js index fe7b118b..76403aaa 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -7,11 +7,12 @@ import { api } from "../services/api"; import { GlobalStyle } from "../styles/global"; import Router from "next/router"; import { ThemeContext, ThemeProvider } from "../contextx/themeContext"; +import { MessageBox } from "../components/messageBox"; export default function Home(props) { - const { theme, setTheme } = useContext(ThemeContext); + const { theme } = useContext(ThemeContext); const [dataProducts, setdataProducts] = useState(props.dataProducts) const [productName, setPoductName] = useState(props.name) @@ -40,7 +41,7 @@ export default function Home(props) { /> { - dataProducts && ( + dataProducts && dataProducts.products.length > 0 && ( <> @@ -48,10 +49,17 @@ export default function Home(props) { pageCount={dataProducts?.total_pages} setdataProducts={setdataProducts} product_name={productName} - /> + /> + + )} + + { + dataProducts && dataProducts.products.length === 0 && ( + ) } +
) } diff --git a/src/services/api.js b/src/services/api.js index 6998ce4d..17cb318a 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -2,6 +2,6 @@ import axios from "axios"; export const api = axios.create({ baseURL: "https://api.cosmos.bluesoft.com.br", - headers: { 'X-Cosmos-Token': "aMLH5bIfXrSIZkfjs6c7YQ" }, + headers: { 'X-Cosmos-Token': "MkjGKs44ffFJ6DSXfG4Acw" }, validateStatus: () => true }); \ No newline at end of file From 317268221920f34eac666e07498141a94c8c66ae Mon Sep 17 00:00:00 2001 From: Mateus Lopes <73197343+progmateus@users.noreply.github.com> Date: Wed, 18 Jan 2023 04:13:04 -0300 Subject: [PATCH 10/11] dynamic page title --- src/components/header/index.jsx | 2 +- src/components/pageProduct/index.jsx | 6 +-- src/components/pagination/index.jsx | 2 +- src/pages/index.js | 65 ++++++++++++++++------------ src/pages/products/[gtin].js | 6 +++ src/services/api.js | 2 +- 6 files changed, 48 insertions(+), 35 deletions(-) diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index f982537c..a5115f0c 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -8,7 +8,7 @@ import { ThemeMode } from "../themeMode"; const Header = () => { - const { theme, setTheme } = useContext(ThemeContext); + const { theme } = useContext(ThemeContext); return ( diff --git a/src/components/pageProduct/index.jsx b/src/components/pageProduct/index.jsx index b77137a4..4970ff44 100644 --- a/src/components/pageProduct/index.jsx +++ b/src/components/pageProduct/index.jsx @@ -7,7 +7,7 @@ const defaultThumbnailURL = "https://cosmos.bluesoft.com.br/assets/product-place const PageProduct = (props) => { - const { theme, setTheme } = useContext(ThemeContext); + const { theme } = useContext(ThemeContext); return ( @@ -20,14 +20,12 @@ const PageProduct = (props) => {

- NCM: {props.data?.ncm.full_description} + NCM: {props.data?.ncm?.full_description}

< Link href="/"> Voltar ao inicio
- - ) } diff --git a/src/components/pagination/index.jsx b/src/components/pagination/index.jsx index 63de17e1..e9642b26 100644 --- a/src/components/pagination/index.jsx +++ b/src/components/pagination/index.jsx @@ -7,7 +7,7 @@ import { Container } from './style'; const Pagination = (props) => { - const { theme, setTheme } = useContext(ThemeContext); + const { theme } = useContext(ThemeContext); const handlePageClick = async (event) => { diff --git a/src/pages/index.js b/src/pages/index.js index 76403aaa..08a6f6fe 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -8,6 +8,7 @@ import { GlobalStyle } from "../styles/global"; import Router from "next/router"; import { ThemeContext, ThemeProvider } from "../contextx/themeContext"; import { MessageBox } from "../components/messageBox"; +import Head from "next/head"; export default function Home(props) { @@ -17,12 +18,14 @@ export default function Home(props) { const [dataProducts, setdataProducts] = useState(props.dataProducts) const [productName, setPoductName] = useState(props.name) - console.log(props.error); - useEffect(() => { setdataProducts(props.dataProducts) setPoductName(props.name) + + if (props.error) { + alert("Limite de requisições à API excedido!") + } }, [props.name]) const handleKeyPressInput = () => { @@ -31,36 +34,42 @@ export default function Home(props) { } return ( -
- -
- - { - dataProducts && dataProducts.products.length > 0 && ( - <> - + <> + + + Find products + + +
+ +
+ - - )} + /> + { + dataProducts && dataProducts.products.length > 0 && ( + <> + - { - dataProducts && dataProducts.products.length === 0 && ( - - ) - } + + + )} + { + dataProducts && dataProducts.products.length === 0 && ( + + ) + } +
+ -
) } diff --git a/src/pages/products/[gtin].js b/src/pages/products/[gtin].js index f5c90e70..56a3043d 100644 --- a/src/pages/products/[gtin].js +++ b/src/pages/products/[gtin].js @@ -1,3 +1,4 @@ +import Head from "next/head"; import Link from "next/link"; import { useContext } from "react"; import { Header } from "../../components/header"; @@ -12,6 +13,11 @@ export default function Products(props) { return ( <> + + + {props.dataProduct.description} + +
diff --git a/src/services/api.js b/src/services/api.js index 17cb318a..15fc83fd 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -2,6 +2,6 @@ import axios from "axios"; export const api = axios.create({ baseURL: "https://api.cosmos.bluesoft.com.br", - headers: { 'X-Cosmos-Token': "MkjGKs44ffFJ6DSXfG4Acw" }, + headers: { 'X-Cosmos-Token': "kE3OdctnwL3IrT3c_ZVILw" }, validateStatus: () => true }); \ No newline at end of file From bacdc23e74544f9a5f3be2d08f746d16a2738faa Mon Sep 17 00:00:00 2001 From: Mateus Lopes <73197343+progmateus@users.noreply.github.com> Date: Wed, 18 Jan 2023 04:14:48 -0300 Subject: [PATCH 11/11] modify token api --- src/services/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/api.js b/src/services/api.js index 15fc83fd..c2cf3c57 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -2,6 +2,6 @@ import axios from "axios"; export const api = axios.create({ baseURL: "https://api.cosmos.bluesoft.com.br", - headers: { 'X-Cosmos-Token': "kE3OdctnwL3IrT3c_ZVILw" }, + headers: { 'X-Cosmos-Token': "qwbOLARThPUoG21lEhmE3w" }, validateStatus: () => true }); \ No newline at end of file