From 35e5b974c340c441451c8125ca84fb78ba73b802 Mon Sep 17 00:00:00 2001 From: Gabriel Ferraz Date: Tue, 17 Jan 2023 20:20:58 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20layout=20scss=20mobile=20at=C3=A9=20280?= =?UTF-8?q?px?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.scss | 3 + src/App.tsx | 2 + src/components/ContactForm.tsx | 3 +- src/components/Footer/BottomFooter.tsx | 2 - src/components/Footer/FooterMain.modules.scss | 53 +++++++-------- src/components/Footer/SocialMedia.tsx | 23 ++++--- src/components/Footer/wpp.tsx | 15 ----- .../Header/HeaderDesktop.modules.scss | 23 ++++--- .../Header/HeaderMobile.modules.scss | 2 +- src/components/Navegation.modules.scss | 6 +- .../schema/CustonValidationsRegex.ts | 2 + src/components/schema/FormSchema.ts | 19 ++++-- src/components/wpp.scss | 65 +++++++++++++++++++ src/components/wpp.tsx | 35 ++++++++++ 14 files changed, 170 insertions(+), 83 deletions(-) delete mode 100644 src/components/Footer/wpp.tsx create mode 100644 src/components/wpp.scss create mode 100644 src/components/wpp.tsx diff --git a/src/App.scss b/src/App.scss index d22998e..aea148c 100644 --- a/src/App.scss +++ b/src/App.scss @@ -2,6 +2,8 @@ body { margin: 0; + width: 100%; + height: 100%; } .Container-menu { @@ -28,6 +30,7 @@ body { @media (min-width: 1025px) { width: 100%; padding: 20px 0px; + margin-bottom: 84px; } @media (max-width: 1024px) { diff --git a/src/App.tsx b/src/App.tsx index b54722c..96b19d0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -7,6 +7,7 @@ import { HeaderDesktop } from "./components/Header/HeaderDesktop"; import { HeaderMobile } from "./components/Header/HeaderMobile"; import { TopContainer } from "./components/Container-menu/TopContainer"; import { MainFooter } from "./components/Footer/FooterMain"; +import { WppIcon } from "./components/wpp"; import "./App.scss"; @@ -25,6 +26,7 @@ export const App = () => { + ) diff --git a/src/components/ContactForm.tsx b/src/components/ContactForm.tsx index 570c179..1888047 100644 --- a/src/components/ContactForm.tsx +++ b/src/components/ContactForm.tsx @@ -63,7 +63,6 @@ export const ContactForm = () => { @@ -75,7 +74,6 @@ export const ContactForm = () => { @@ -112,6 +110,7 @@ export const ContactForm = () => { + )} diff --git a/src/components/Footer/BottomFooter.tsx b/src/components/Footer/BottomFooter.tsx index 199a000..e6e8b4f 100644 --- a/src/components/Footer/BottomFooter.tsx +++ b/src/components/Footer/BottomFooter.tsx @@ -10,7 +10,6 @@ import Pagseguro from "../assets/imgs/SVGs/credit-cards/Pagseguro.svg"; import Boleto from "../assets/imgs/SVGs/credit-cards/Boleto.svg"; import vtex from "../assets/imgs/SVGs/credit-cards/vtex-pci-200.svg"; -import { WppIcon } from "./wpp"; export const BottomFooter = () => { return ( @@ -22,7 +21,6 @@ export const BottomFooter = () => {
- {window.innerWidth > 1024 ? "" : } Master-icon Visa-icon Diners-icon diff --git a/src/components/Footer/FooterMain.modules.scss b/src/components/Footer/FooterMain.modules.scss index b145b19..73c3ef5 100644 --- a/src/components/Footer/FooterMain.modules.scss +++ b/src/components/Footer/FooterMain.modules.scss @@ -99,7 +99,7 @@ @media (min-width: 1025px) { position: relative; - padding: 50px 0; + padding: 50px 100px; } .Contact_wrapper { @@ -225,35 +225,6 @@ line-height: 16px; color: $color-gray-700; } - - .Wpp-Icon { - display: flex; - flex-direction: column; - - @media (min-width: 1025px) { - position: absolute; - right: 16px; - top: 50px; - } - - .button_wrapper { - position: relative; - } - .button_wrapper::after { - content: " "; - width: 13px; - height: 7px; - top: 33%; - right: 31%; - position: absolute; - background-image: url("../assets/imgs/SVGs/Vector.svg"); - } - - .button { - display: flex; - background-image: url("../assets/imgs/SVGs/Vector.svg"); - } - } } .Bottom_Wrapper { @@ -269,6 +240,7 @@ @media (max-width: 1024px) { flex-direction: column; gap: 15px; + position: relative; } .corporateName { @@ -288,6 +260,7 @@ } .Payment_methods { + width: fit-content; align-items: center; display: flex; gap: 12px; @@ -301,7 +274,7 @@ height: 20px; } - .div_icons { + .div_icons::after { content: ""; border: 1px solid $color-gray; transform: rotate(90deg); @@ -313,6 +286,24 @@ width: 54.61px; height: 34px; } + + @media (max-width: 425px) { + gap: 11px; + + .carts_icons { + width: 30px; + height: 17px; + } + + .vtex_icon { + width: 45px; + height: 28px; + } + } + + @media (max-width: 375px) { + gap: 1px; + } } .Authors { diff --git a/src/components/Footer/SocialMedia.tsx b/src/components/Footer/SocialMedia.tsx index 4b88291..1724d10 100644 --- a/src/components/Footer/SocialMedia.tsx +++ b/src/components/Footer/SocialMedia.tsx @@ -4,22 +4,21 @@ import Twitter from "../assets/imgs/SVGs/Twitter.svg"; import YouTube from "../assets/imgs/SVGs/YouTube.svg"; import Linkedin from "../assets/imgs/SVGs/Linkedin.svg"; -import { WppIcon } from "./wpp"; - export const SocialMedia = () => { return ( <> -
-
- Facebook-logo - Instagram-logo - Twitter-logo - YouTube-logo - Linkedin-logo +
+
+
+ Facebook-logo + Instagram-logo + Twitter-logo + YouTube-logo + Linkedin-logo +
+ www.loremipsum.com
- www.loremipsum.com -
{window.innerWidth > 1024 ? : ""}
-
+ ); }; diff --git a/src/components/Footer/wpp.tsx b/src/components/Footer/wpp.tsx deleted file mode 100644 index 0a23738..0000000 --- a/src/components/Footer/wpp.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import Wpp from "../assets/imgs/SVGs/whatsapp.svg"; -import Ellipse from "../assets/imgs/SVGs/Ellipse.svg"; - -export const WppIcon = () => { - return ( - <> -
- Wpp-logo -
- Ellipse-logo -
-
- - ); -}; diff --git a/src/components/Header/HeaderDesktop.modules.scss b/src/components/Header/HeaderDesktop.modules.scss index 51efd13..3525d82 100644 --- a/src/components/Header/HeaderDesktop.modules.scss +++ b/src/components/Header/HeaderDesktop.modules.scss @@ -42,17 +42,20 @@ padding: 12px; } } + .InconWrapper { + position: absolute; + content: ""; + width: 18px; + height: 18px; + top: 10px; + right: 16px; + background-image: url("../assets/imgs/SVGs/search-icon-desktop.svg"); + cursor: pointer; + pointer-events: all; + } } - .Search_Header_wrapper::after { - position: absolute; - content: ""; - width: 18px; - height: 18px; - top: 10px; - right: 16px; - background-image: url("../assets/imgs/SVGs/search-icon-desktop.svg"); - cursor: pointer; - } + // .Search_Header_wrapper::after { + // } .Headerlinks { display: flex; gap: 55px; diff --git a/src/components/Header/HeaderMobile.modules.scss b/src/components/Header/HeaderMobile.modules.scss index c1fdfd6..d7dc6f2 100644 --- a/src/components/Header/HeaderMobile.modules.scss +++ b/src/components/Header/HeaderMobile.modules.scss @@ -94,7 +94,7 @@ width: 100%; .Search_Header { - width: 96.372%; + width: calc(100% - 36px); border: 2px solid $color-white-100; border-radius: 5px; padding: 10px 16px; diff --git a/src/components/Navegation.modules.scss b/src/components/Navegation.modules.scss index 764b33c..bde8701 100644 --- a/src/components/Navegation.modules.scss +++ b/src/components/Navegation.modules.scss @@ -7,6 +7,8 @@ width: 40.376%; padding: 0; margin-right: 30px; + height: 337px; + border-right: 1px solid $color-black; } ul { @@ -24,10 +26,6 @@ @media (max-width: 1024px) { padding: 10px 16px; } - - @media (min-width: 1025px) { - border-right: 1px solid $color-black; - } } } diff --git a/src/components/schema/CustonValidationsRegex.ts b/src/components/schema/CustonValidationsRegex.ts index 7f06086..84bf09c 100644 --- a/src/components/schema/CustonValidationsRegex.ts +++ b/src/components/schema/CustonValidationsRegex.ts @@ -4,3 +4,5 @@ export const cpfNumber = /\d{3}.\d{3}.\d{3}-\d{2}/; export const insta = /(?:^|[^\w])(?:@)([\w-](?:(?:[\w-]|(?:\.(?!\.))){0,28}(?:[\w-]))?)/; + +export const bornData = /\d{2}.\d{2}.\d{4}/; diff --git a/src/components/schema/FormSchema.ts b/src/components/schema/FormSchema.ts index 831a175..8f469ea 100644 --- a/src/components/schema/FormSchema.ts +++ b/src/components/schema/FormSchema.ts @@ -1,13 +1,17 @@ import * as Yup from "yup"; -import { phoneNumber, cpfNumber, insta } from "./CustonValidationsRegex"; +import { + phoneNumber, + cpfNumber, + insta, + bornData, +} from "./CustonValidationsRegex"; export default Yup.object().shape({ - name: Yup.string().required("*Campo Obrigatório"), - email: Yup.string() - .email() + name: Yup.string() .required("*Campo Obrigatório") - .email("E-mail inválido"), + .min(3, "O campo deve ter no mínimo 3 caracteres"), + email: Yup.string().required("*Campo Obrigatório").email("E-mail inválido"), cpf: Yup.string() .matches(cpfNumber, "CPF inválido") .required("*Campo Obrigatório"), @@ -15,6 +19,9 @@ export default Yup.object().shape({ .matches(phoneNumber, "numero inválido") .required("*Campo Obrigatório"), instagram: Yup.string().matches(insta, "conta inválida"), - data: Yup.date().required("*Campo Obrigatório"), + data: Yup.string() + .matches(bornData, "data inválido") + // .max(new Date(), "Não é possível incluir uma data futura") + .required("Campo obrigatório"), checkbox: Yup.boolean().oneOf([true], "*"), }); diff --git a/src/components/wpp.scss b/src/components/wpp.scss new file mode 100644 index 0000000..317329f --- /dev/null +++ b/src/components/wpp.scss @@ -0,0 +1,65 @@ +@import "./Variables.scss"; + +.links_wrappers { + position: fixed; + right: 16px; + bottom: 51px; + z-index: 1; + + .Wpp-Icon { + display: flex; + flex-direction: column; + + .Chat_link { + border: none; + width: fit-content; + padding: 0; + margin: 0; + height: 34px; + background: none; + + &:focus { + outline: none; + } + + @media (min-width: 1025px) { + cursor: pointer; + } + } + + .button_wrapper { + position: relative; + + .ToTop_button { + border: none; + width: fit-content; + padding: 0; + margin: 0; + height: 34px; + background: none; + + &:focus { + outline: none; + } + + @media (min-width: 1025px) { + cursor: pointer; + } + } + } + .button_wrapper::after { + content: " "; + width: 13px; + height: 7px; + top: 33%; + right: 31%; + position: absolute; + background-image: url("./assets/imgs/SVGs/Vector.svg"); + } + + .button { + display: flex; + background-image: url("./assets/imgs/SVGs/Vector.svg"); + } + } +} diff --git a/src/components/wpp.tsx b/src/components/wpp.tsx new file mode 100644 index 0000000..dbbde29 --- /dev/null +++ b/src/components/wpp.tsx @@ -0,0 +1,35 @@ +import Wpp from "./assets/imgs/SVGs/whatsapp.svg"; +import Ellipse from "./assets/imgs/SVGs/Ellipse.svg"; + +import "./wpp.scss"; + +const ScrollUp = () => { + window.scrollTo({ + top: 0, + behavior: "smooth", + }); +}; + +export const WppIcon = () => { + return ( + <> +
+
+ + Wpp-logo + +
+ +
+
+
+ + ); +};