form to mobile
This commit is contained in:
@@ -3,7 +3,7 @@ import clsx from "clsx";
|
|||||||
interface CardProps {
|
interface CardProps {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
color?: "gradient" | "darker" | "yellow";
|
color?: "gradient" | "darker" | "yellow";
|
||||||
className?: string | null;
|
className?: string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Card({ children, color = "gradient", className }: CardProps) {
|
export function Card({ children, color = "gradient", className }: CardProps) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import clsx from "clsx";
|
|||||||
|
|
||||||
interface ContainerProps {
|
interface ContainerProps {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
className?: string | null;
|
className?: string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Container({ children, className }: ContainerProps) {
|
export function Container({ children, className }: ContainerProps) {
|
||||||
|
|||||||
@@ -2,10 +2,13 @@ import { useForm } from "react-hook-form";
|
|||||||
import { useMutation } from "node_modules/@tanstack/react-query/build/legacy";
|
import { useMutation } from "node_modules/@tanstack/react-query/build/legacy";
|
||||||
import { queryClient } from "../queryClient";
|
import { queryClient } from "../queryClient";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { createElement } from "react";
|
||||||
|
import clsx from "clsx";
|
||||||
|
|
||||||
interface IFormInput {
|
interface IFormInput {
|
||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
|
message: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Form() {
|
export function Form() {
|
||||||
@@ -29,12 +32,13 @@ export function Form() {
|
|||||||
return (
|
return (
|
||||||
<form
|
<form
|
||||||
onSubmit={handleSubmit(onSubmit)}
|
onSubmit={handleSubmit(onSubmit)}
|
||||||
className="flex flex-col gap-2.5 dark:text-green-primary space-y-5"
|
className="flex flex-col gap-2.5 lg:gap-5 dark:text-green-primary"
|
||||||
>
|
>
|
||||||
{formState.isSubmitSuccessful && (
|
{formState.isSubmitSuccessful && (
|
||||||
<p className="bg-green-700 text-white p-2.5 rounded-lg">OK!</p>
|
<p className="bg-green-700 text-white p-2.5 rounded-lg">OK!</p>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
<div className="grid lg:grid-cols-2 gap-2.5 lg:gap-5">
|
||||||
<label>
|
<label>
|
||||||
Nome
|
Nome
|
||||||
<Input {...register("name")} />
|
<Input {...register("name")} />
|
||||||
@@ -43,6 +47,13 @@ export function Form() {
|
|||||||
Email
|
Email
|
||||||
<Input {...register("email")} />
|
<Input {...register("email")} />
|
||||||
</label>
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
Mensagem
|
||||||
|
<Input as="textarea" className="h-26" {...register("message")} />
|
||||||
|
</label>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="font-medium bg-green-secondary hover:bg-green-support p-2.5 rounded-lg transition cursor-pointer h-12"
|
className="font-medium bg-green-secondary hover:bg-green-support p-2.5 rounded-lg transition cursor-pointer h-12"
|
||||||
@@ -53,11 +64,17 @@ export function Form() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Input({ ...props }) {
|
interface IInput extends React.HTMLAttributes<HTMLElement> {
|
||||||
return (
|
as?: string;
|
||||||
<input
|
className?: string | undefined;
|
||||||
className="border border-gray-300 focus:border-green-secondary focus:ring ring-green-secondary bg-white px-5 rounded-lg w-full outline-none h-12"
|
}
|
||||||
{...props}
|
|
||||||
/>
|
export function Input({ as = "input", className, ...props }: IInput) {
|
||||||
);
|
return createElement(as, {
|
||||||
|
className: clsx(
|
||||||
|
"border border-gray-300 focus:border-green-secondary focus:ring ring-green-secondary bg-white p-2.5 rounded-lg w-full outline-none",
|
||||||
|
className,
|
||||||
|
),
|
||||||
|
...props,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,11 +57,13 @@ import Layout from "@layouts/Layout.astro";
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<section class="grid lg:grid-cols-2 gap-6 p-5">
|
<section class="grid lg:grid-cols-2 gap-6 p-5">
|
||||||
<div class="space-y-1">
|
<div class="space-y-1.5 lg:p-12">
|
||||||
<h4 class="text-2xl">Solicite um orçamento</h4>
|
<h4 class="font-medium text-4xl">Solicite um orçamento</h4>
|
||||||
<p>
|
<p>
|
||||||
Quer saber como podemos capacitar sua equipe? Fale com nossa
|
Quer saber como podemos capacitar sua equipe?<br
|
||||||
equipe e receba uma proposta personalizada.
|
class="max-lg:hidden"
|
||||||
|
/>
|
||||||
|
Fale com nossa equipe e receba uma proposta personalizada.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user