Fixed Service Cards Not Bing Centered
This commit is contained in:
@@ -3,8 +3,11 @@ import emailjs from "@emailjs/browser";
|
|||||||
import { ToastContainer, toast } from "react-toastify";
|
import { ToastContainer, toast } from "react-toastify";
|
||||||
import "react-toastify/dist/ReactToastify.css";
|
import "react-toastify/dist/ReactToastify.css";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import PhoneInput, { formatPhoneNumber, parsePhoneNumber } from "react-phone-number-input";
|
import PhoneInput, {
|
||||||
import 'react-phone-number-input/style.css'
|
formatPhoneNumber,
|
||||||
|
parsePhoneNumber,
|
||||||
|
} from "react-phone-number-input";
|
||||||
|
import "react-phone-number-input/style.css";
|
||||||
import "./ContactForm.css";
|
import "./ContactForm.css";
|
||||||
|
|
||||||
const ContactForm = () => {
|
const ContactForm = () => {
|
||||||
@@ -22,7 +25,7 @@ const ContactForm = () => {
|
|||||||
const emptyForm = () => {
|
const emptyForm = () => {
|
||||||
toast.warning(t("contact.toasts.empty"));
|
toast.warning(t("contact.toasts.empty"));
|
||||||
};
|
};
|
||||||
|
|
||||||
const invalidCountryCode = () => {
|
const invalidCountryCode = () => {
|
||||||
toast.error(t("contact.toasts.invalidCountryCode"));
|
toast.error(t("contact.toasts.invalidCountryCode"));
|
||||||
};
|
};
|
||||||
@@ -36,7 +39,8 @@ const ContactForm = () => {
|
|||||||
(input as HTMLInputElement).value.trim() === ""
|
(input as HTMLInputElement).value.trim() === ""
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isEmpty || !phone) { // Check if phone is also empty
|
if (isEmpty || !phone) {
|
||||||
|
// Check if phone is also empty
|
||||||
emptyForm();
|
emptyForm();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -52,7 +56,10 @@ const ContactForm = () => {
|
|||||||
// Append phone number to the form
|
// Append phone number to the form
|
||||||
const phoneInput = document.createElement("input");
|
const phoneInput = document.createElement("input");
|
||||||
phoneInput.setAttribute("type", "hidden");
|
phoneInput.setAttribute("type", "hidden");
|
||||||
phoneInput.setAttribute("value", `+${countryCode} ${formatPhoneNumber(phone)}`);
|
phoneInput.setAttribute(
|
||||||
|
"value",
|
||||||
|
`+${countryCode} ${formatPhoneNumber(phone)}`
|
||||||
|
);
|
||||||
phoneInput.setAttribute("name", "user_phone");
|
phoneInput.setAttribute("name", "user_phone");
|
||||||
e.currentTarget.appendChild(phoneInput);
|
e.currentTarget.appendChild(phoneInput);
|
||||||
|
|
||||||
@@ -100,13 +107,13 @@ const ContactForm = () => {
|
|||||||
placeholder={t("contact.form.company")}
|
placeholder={t("contact.form.company")}
|
||||||
/>
|
/>
|
||||||
<div className="md:w-1/2 flex items-center">
|
<div className="md:w-1/2 flex items-center">
|
||||||
<PhoneInput
|
<PhoneInput
|
||||||
defaultCountry="PT"
|
defaultCountry="PT"
|
||||||
placeholder={t("contact.form.phone")}
|
placeholder={t("contact.form.phone")}
|
||||||
className="form-input placeholder-white w-full"
|
className="form-input placeholder-white w-full"
|
||||||
value={phone}
|
value={phone}
|
||||||
onChange={setPhone}
|
onChange={setPhone}
|
||||||
inputProps={{
|
inputprops={{
|
||||||
name: "user_phone",
|
name: "user_phone",
|
||||||
required: true,
|
required: true,
|
||||||
}}
|
}}
|
||||||
@@ -121,13 +128,13 @@ const ContactForm = () => {
|
|||||||
placeholder={t("contact.form.question")}
|
placeholder={t("contact.form.question")}
|
||||||
></input>
|
></input>
|
||||||
|
|
||||||
<div className="md:mt-4">
|
<div className="md:mt-4">
|
||||||
<input
|
<input
|
||||||
className="form-input w-full"
|
className="form-input w-full"
|
||||||
name="user_reference"
|
name="user_reference"
|
||||||
placeholder={t("contact.form.reference")}
|
placeholder={t("contact.form.reference")}
|
||||||
></input>
|
></input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex mt-5 mb-10 lg:mt-12 mx-10 sm:mx-40 rounded-full bg-gradient-to-br from-gold-light to-gold-dark p-0.5 shadow-lg">
|
<div className="flex mt-5 mb-10 lg:mt-12 mx-10 sm:mx-40 rounded-full bg-gradient-to-br from-gold-light to-gold-dark p-0.5 shadow-lg">
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const CameraCards = () => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex lg:mt-20 flex-col flex-wrap xl:flex-row mx-4">
|
<div className="h-full flex lg:mt-20 flex-col flex-wrap xl:flex-row mx-4 gap-5">
|
||||||
<Card
|
<Card
|
||||||
title={t("services.cards.media.card1.title")}
|
title={t("services.cards.media.card1.title")}
|
||||||
description={t("services.cards.media.card1.description")}
|
description={t("services.cards.media.card1.description")}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import WesiteCards from "./WesiteCards";
|
import WesiteCards from "./WebsiteCards";
|
||||||
import Buttons from "./Buttons";
|
import Buttons from "./Buttons";
|
||||||
import MarketingCards from "./MarketingCards";
|
import MarketingCards from "./MarketingCards";
|
||||||
import CameraCards from "./CameraCards";
|
import CameraCards from "./CameraCards";
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const MarketingCards = () => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex lg:mt-20 flex-col flex-wrap xl:flex-row mx-4">
|
<div className="h-full flex lg:mt-20 flex-col flex-wrap xl:flex-row mx-4 gap-5">
|
||||||
<Card
|
<Card
|
||||||
title={t("services.cards.marketing.card1.title")}
|
title={t("services.cards.marketing.card1.title")}
|
||||||
description={t("services.cards.marketing.card1.description")}
|
description={t("services.cards.marketing.card1.description")}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ interface IProps {
|
|||||||
const Card = ({ title, description, imgSrc, delay }: IProps) => {
|
const Card = ({ title, description, imgSrc, delay }: IProps) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="flex flex-col mt-4 lg:mt-0 lg:mr-8 justify-end flex-1 h-full border-solid border bg-cover bg-center text-center shadow-2xl"
|
className="flex flex-col mt-4 lg:mt-0 justify-end flex-1 h-full border-solid border bg-cover bg-center text-center shadow-2xl"
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(${imgSrc})`,
|
backgroundImage: `url(${imgSrc})`,
|
||||||
filter: "saturate(50%)",
|
filter: "saturate(50%)",
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import CardGroup from "./CardGroup";
|
|||||||
|
|
||||||
const ServiceCardContainer = () => {
|
const ServiceCardContainer = () => {
|
||||||
return (
|
return (
|
||||||
<div className="h-full xl:h-[65vh] 1920:h-[60vh] rounded-xl mx-4 lg:mx-20 xl:mx-40 2xl:mx-60 1920:margin-calc mt-10 p-0.5">
|
<div className="h-full xl:h-[65vh] 1920:h-[60vh] rounded-xl mx-4 lg:mx-20 xl:mx-40 2xl:mx-60 1920:margin-calc mt-10 p-0.5 gap-4">
|
||||||
<CardGroup />
|
<CardGroup />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const SocialMediaCards = () => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex lg:mt-20 flex-col flex-wrap xl:flex-row mx-4">
|
<div className="h-full flex lg:mt-20 flex-col flex-wrap xl:flex-row mx-4 gap-5">
|
||||||
<Card
|
<Card
|
||||||
title={t("services.cards.social.card1.title")}
|
title={t("services.cards.social.card1.title")}
|
||||||
description={t("services.cards.social.card1.description")}
|
description={t("services.cards.social.card1.description")}
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ const WesiteCards = () => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex lg:mt-20 flex-col flex-wrap xl:flex-row mx-4">
|
<div className="h-full flex lg:mt-20 flex-col flex-wrap xl:flex-row mx-4 gap-5">
|
||||||
<Card
|
<Card
|
||||||
title={t("services.cards.website.card1.title")}
|
title={t("services.cards.website.card1.title")}
|
||||||
description={t("services.cards.website.card1.description")}
|
description={t("services.cards.website.card1.description")}
|
||||||
Reference in New Issue
Block a user