Fixed Service Cards Not Bing Centered

This commit is contained in:
2024-08-19 05:12:10 +01:00
parent ce0bcac88f
commit d73c6b567b
8 changed files with 29 additions and 22 deletions
+12 -5
View File
@@ -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 = () => {
@@ -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);
@@ -106,7 +113,7 @@ const ContactForm = () => {
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,
}} }}
@@ -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 -1
View File
@@ -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,7 +2,7 @@ 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")}
@@ -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")}