first commit
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
'use client'
|
||||
|
||||
|
||||
import React from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { yupResolver } from "@hookform/resolvers/yup";
|
||||
import * as Yup from "yup";
|
||||
|
||||
const BlogDetailsForm = () => {
|
||||
// for validation
|
||||
const validationSchema = Yup.object().shape({
|
||||
name: Yup.string().required(" Name is required"),
|
||||
email: Yup.string()
|
||||
.required("Email is required")
|
||||
.email("Entered value does not match email format"),
|
||||
sendMessage: Yup.string().required("Please,leave us a message."),
|
||||
});
|
||||
|
||||
const formOptions = { resolver: yupResolver(validationSchema) };
|
||||
// get functions to build form with useForm() hook
|
||||
const { register, handleSubmit, formState } = useForm(formOptions);
|
||||
const { errors } = formState;
|
||||
|
||||
function onSubmit(data, e) {
|
||||
// display form data on success
|
||||
console.log("Message submited: " + JSON.stringify(data));
|
||||
e.target.reset();
|
||||
}
|
||||
|
||||
return (
|
||||
<form id="contact-form" onSubmit={handleSubmit(onSubmit)}>
|
||||
<div className="row">
|
||||
<div className="col-12">
|
||||
<div className="input-group-meta mb-35">
|
||||
<label>Name</label>
|
||||
<input
|
||||
placeholder="Michel"
|
||||
name="name"
|
||||
type="text"
|
||||
{...register("name")}
|
||||
className={`${errors.name ? "is-invalid" : ""}`}
|
||||
/>
|
||||
{errors.name && (
|
||||
<div className="invalid-feedback">{errors.name?.message}</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-12">
|
||||
<div className="input-group-meta mb-35">
|
||||
<label>Your Email</label>
|
||||
<input
|
||||
placeholder="Email Address"
|
||||
name="email"
|
||||
type="text"
|
||||
{...register("email")}
|
||||
className={` ${errors.email ? "is-invalid" : ""}`}
|
||||
/>
|
||||
{errors.email && (
|
||||
<div className="invalid-feedback">{errors.email?.message}</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-12">
|
||||
<div className="input-group-meta lg mb-35">
|
||||
<label>Your Message</label>
|
||||
<textarea
|
||||
placeholder="Your message"
|
||||
name="sendMessage"
|
||||
type="text"
|
||||
{...register("message")}
|
||||
className={`${errors.sendMessage ? "is-invalid" : ""}`}
|
||||
></textarea>
|
||||
{errors.sendMessage && (
|
||||
<div className="invalid-feedback">
|
||||
{errors.sendMessage?.message}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-12">
|
||||
<button className="theme-btn-one btn-lg">Post Comment</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
export default BlogDetailsForm;
|
||||
@@ -0,0 +1,21 @@
|
||||
'use client'
|
||||
|
||||
|
||||
import Image from "next/image";
|
||||
import React from "react";
|
||||
|
||||
const BlogSidebarForm = () => {
|
||||
const handleSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
return (
|
||||
<form onClick={handleSubmit}>
|
||||
<input type="text" placeholder="Search" />
|
||||
<button>
|
||||
<Image width="18" height="20" src="/images/icon/50.svg" alt="icon" />
|
||||
</button>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
export default BlogSidebarForm;
|
||||
@@ -0,0 +1,21 @@
|
||||
'use client'
|
||||
|
||||
|
||||
import Image from "next/image";
|
||||
import React from "react";
|
||||
|
||||
const BlogSidebarForm2 = () => {
|
||||
const handleSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
return (
|
||||
<form onClick={handleSubmit}>
|
||||
<input type="text" placeholder="Search" />
|
||||
<button>
|
||||
<Image width="18" height="20" src="/images/icon/51.svg" alt="icon" />
|
||||
</button>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
export default BlogSidebarForm2;
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
|
||||
'use client'
|
||||
import React from 'react'
|
||||
import Coupon from '../e-commerce/cart/Coupon';
|
||||
import CartTotal from '../e-commerce/cart/CartTotal';
|
||||
import CartProduct from '../e-commerce/cart/CartProduct';
|
||||
|
||||
export default function CartForm() {
|
||||
const handleSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
return (
|
||||
<form className="cart-list-form" onClick={handleSubmit}>
|
||||
<div className="table-responsive">
|
||||
<table className="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colSpan="2">Product</th>
|
||||
<th>Price</th>
|
||||
<th>QTY</th>
|
||||
<th>Total</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<CartProduct />
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{/* <!-- /.table-responsive --> */}
|
||||
|
||||
<div className="d-sm-flex justify-content-between cart-footer">
|
||||
<Coupon />
|
||||
{/* <!-- /.coupon-section --> */}
|
||||
|
||||
<div className="cart-total-section d-flex flex-column sm-pt-40">
|
||||
<CartTotal />
|
||||
</div>
|
||||
</div>
|
||||
{/* <!-- /.cart-footer --> */}
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
'use client'
|
||||
|
||||
|
||||
import React from 'react'
|
||||
import BillingDetails from '../e-commerce/checkout/BillingDetails'
|
||||
import Payment from '../e-commerce/checkout/Payment'
|
||||
|
||||
export default function CheckoutForm() {
|
||||
const handleSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
return (
|
||||
<form onClick={handleSubmit} className="checkout-form">
|
||||
<div className="row">
|
||||
<div className="col-xl-6 col-lg-7">
|
||||
<h2 className="main-title">Billign Details</h2>
|
||||
<BillingDetails />
|
||||
{/* <!-- /.user-profile-data --> */}
|
||||
</div>
|
||||
{/* <!-- /.col- --> */}
|
||||
|
||||
<div className="col-xxl-4 col-lg-5 ms-auto">
|
||||
<div className="order-confirm-sheet md-mt-60">
|
||||
<h2 className="main-title">Order Details</h2>
|
||||
<Payment />
|
||||
</div>
|
||||
{/* <!-- /.order-confirm-sheet --> */}
|
||||
</div>
|
||||
</div>
|
||||
{/* <!-- /.row --> */}
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
'use client'
|
||||
|
||||
|
||||
import React from 'react'
|
||||
|
||||
export default function CommingSoonForm() {
|
||||
const handleSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
return (
|
||||
<form onClick={handleSubmit}>
|
||||
<input type="email" placeholder="ihidago@ujufidnan.gov" />
|
||||
<button>Notify Me</button>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
'use client'
|
||||
|
||||
|
||||
import React from 'react'
|
||||
import Image from "next/image";
|
||||
export default function DocFormTwo() {
|
||||
const handleSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
return (
|
||||
<div className="search-form">
|
||||
<form onClick={handleSubmit}>
|
||||
<input type="text" placeholder="Search here.." />
|
||||
<button>
|
||||
<Image width={17} height={16} style={{width:'100%',height:'fit-content'}} src="/images/icon/59.svg" alt="icon" />
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
|
||||
'use client'
|
||||
|
||||
|
||||
|
||||
import Image from 'next/image';
|
||||
import React from 'react'
|
||||
|
||||
export default function FaqForm() {
|
||||
const handleSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
return (
|
||||
<form onClick={handleSubmit} className="search-form">
|
||||
<input type="text" placeholder="Search for articles..." />
|
||||
<button>
|
||||
<Image width="27" height="23" src="/images/icon/47.svg" alt="icon" />
|
||||
</button>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
'use client'
|
||||
|
||||
|
||||
import Image from "next/image";
|
||||
import React from "react";
|
||||
|
||||
const FormAppoint = () => {
|
||||
const handleSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
return (
|
||||
<form onClick={handleSubmit}>
|
||||
<input type="email" placeholder="ihidago@ujufidnan.gov" />
|
||||
<button className="d-flex justify-content-center align-items-center">
|
||||
<Image width="28" height="15" src="/images/icon/119.svg" alt="icon" />
|
||||
</button>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
export default FormAppoint;
|
||||
@@ -0,0 +1,18 @@
|
||||
'use client'
|
||||
|
||||
|
||||
import React from "react";
|
||||
|
||||
const FormEvent = () => {
|
||||
const handleSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
return (
|
||||
<form onClick={handleSubmit}>
|
||||
<input type="text" placeholder="ihidago@ujufidnan.gov" />
|
||||
<button>Try free demo</button>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
export default FormEvent;
|
||||
@@ -0,0 +1,32 @@
|
||||
'use client'
|
||||
|
||||
|
||||
import Image from "next/image";
|
||||
import React from "react";
|
||||
|
||||
const FormEvent = () => {
|
||||
const handleSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
return (
|
||||
<form onClick={handleSubmit}>
|
||||
<input type="text" placeholder="Search Somthing.." />
|
||||
{/* serarch field */}
|
||||
|
||||
<button>
|
||||
<Image width="27" height="23" src="/images/icon/54.svg" alt="icon" />
|
||||
</button>
|
||||
{/* Search button */}
|
||||
|
||||
<select className="form-control" id="exampleFormControlSelect1">
|
||||
<option>All</option>
|
||||
<option>Layout</option>
|
||||
<option>API</option>
|
||||
<option>Doc</option>
|
||||
</select>
|
||||
{/* End select menu */}
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
export default FormEvent;
|
||||
@@ -0,0 +1,18 @@
|
||||
'use client'
|
||||
|
||||
|
||||
import React from "react";
|
||||
|
||||
const FormEvent = () => {
|
||||
const handleSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
return (
|
||||
<form onClick={handleSubmit}>
|
||||
<input type="text" placeholder="Email address" />
|
||||
<button>Start Trial</button>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
export default FormEvent;
|
||||
@@ -0,0 +1,18 @@
|
||||
'use client'
|
||||
|
||||
|
||||
import React from "react";
|
||||
|
||||
const FormFooterSignup = () => {
|
||||
const handleSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
return (
|
||||
<form onClick={handleSubmit}>
|
||||
<input type="text" placeholder="Enter your email" />
|
||||
<button>Sign UP</button>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
export default FormFooterSignup;
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
'use client'
|
||||
|
||||
|
||||
import React from 'react'
|
||||
|
||||
export default function FormProjectManagement() {
|
||||
const handleSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
}
|
||||
return (
|
||||
<form
|
||||
action="#"
|
||||
className="subscription-form"
|
||||
onClick={handleSubmit}
|
||||
>
|
||||
<input type="email" placeholder="Your work email" />
|
||||
<button>Try for free</button>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
'use client'
|
||||
|
||||
|
||||
import React from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { yupResolver } from "@hookform/resolvers/yup";
|
||||
import * as Yup from "yup";
|
||||
|
||||
const HeaderPopupForm = () => {
|
||||
// for validation
|
||||
const validationSchema = Yup.object().shape({
|
||||
name: Yup.string().required(" Name is required"),
|
||||
email: Yup.string()
|
||||
.required("Email is required")
|
||||
.email("Entered value does not match email format"),
|
||||
sendMessage: Yup.string().required("Please,leave us a message."),
|
||||
});
|
||||
|
||||
const formOptions = { resolver: yupResolver(validationSchema) };
|
||||
// get functions to build form with useForm() hook
|
||||
const { register, handleSubmit, formState } = useForm(formOptions);
|
||||
const { errors } = formState;
|
||||
|
||||
function onSubmit(data, e) {
|
||||
// display form data on success
|
||||
console.log("Message submited: " + JSON.stringify(data));
|
||||
e.target.reset();
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<form id="contact-form" onSubmit={handleSubmit(onSubmit)}>
|
||||
<div className="messages"></div>
|
||||
<div className="row controls">
|
||||
<div className="col-12">
|
||||
<div className="input-group-meta form-group mb-20">
|
||||
<label>Name</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Your Name"
|
||||
name="name"
|
||||
{...register("name")}
|
||||
className={`${errors.name ? "is-invalid" : ""}`}
|
||||
/>
|
||||
{errors.name && (
|
||||
<div className="invalid-feedback">{errors.name?.message}</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{/* End .col */}
|
||||
|
||||
<div className="col-12">
|
||||
<div className="input-group-meta form-group mb-20">
|
||||
<label>Email*</label>
|
||||
<input
|
||||
placeholder="Email Address"
|
||||
name="email"
|
||||
type="text"
|
||||
{...register("email")}
|
||||
className={` ${errors.email ? "is-invalid" : ""}`}
|
||||
/>
|
||||
{errors.email && (
|
||||
<div className="invalid-feedback">{errors.email?.message}</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{/* End .col */}
|
||||
|
||||
<div className="col-12">
|
||||
<div className="input-group-meta form-group mb-30">
|
||||
<label>Message*</label>
|
||||
<textarea
|
||||
placeholder="Your message"
|
||||
name="sendMessage"
|
||||
type="text"
|
||||
{...register("message")}
|
||||
className={`${errors.sendMessage ? "is-invalid" : ""}`}
|
||||
></textarea>
|
||||
{errors.sendMessage && (
|
||||
<div className="invalid-feedback">
|
||||
{errors.sendMessage?.message}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{/* End .col */}
|
||||
|
||||
<div className="col-12">
|
||||
<button className="theme-btn-seven w-100">Send Message</button>
|
||||
</div>
|
||||
{/* End .col */}
|
||||
</div>
|
||||
</form>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default HeaderPopupForm;
|
||||
Reference in New Issue
Block a user