| import Image from 'next/image'; | |||||
| import styles from './hover-image-card.module.css'; | import styles from './hover-image-card.module.css'; | ||||
| const HoverImageCard = () => { | const HoverImageCard = () => { | ||||
| <button className={styles.btn}>More Details</button> | <button className={styles.btn}>More Details</button> | ||||
| </div> | </div> | ||||
| {/*Change with Next Image*/} | {/*Change with Next Image*/} | ||||
| <img src="/images/image-one.jpg" alt="text" /> | |||||
| <Image src="/images/image-one.jpg" alt="text" /> | |||||
| </div> | </div> | ||||
| <div className={styles.card}> | <div className={styles.card}> | ||||
| <div className={styles.content}> | <div className={styles.content}> | ||||
| <button className={styles.btn}>Button Text</button> | <button className={styles.btn}>Button Text</button> | ||||
| </div> | </div> | ||||
| {/*Change with Next Image*/} | {/*Change with Next Image*/} | ||||
| <img src="/images/image-one.jpg" alt="text" /> | |||||
| <Image src="/images/image-one.jpg" alt="text" /> | |||||
| </div> | </div> | ||||
| <div className={styles.card}> | <div className={styles.card}> | ||||
| <div className={styles.content}> | <div className={styles.content}> | ||||
| <button className={styles.btn}>Button Text</button> | <button className={styles.btn}>Button Text</button> | ||||
| </div> | </div> | ||||
| {/*Change with Next Image*/} | {/*Change with Next Image*/} | ||||
| <img src="/images/image-one.jpg" alt="text" /> | |||||
| <Image src="/images/image-one.jpg" alt="text" /> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| ); | ); |
| const { t } = useTranslation('contact'); | const { t } = useTranslation('contact'); | ||||
| const [open, setOpen] = useState(false); | const [open, setOpen] = useState(false); | ||||
| const handleSubmit = async (values) => { | |||||
| const handleSubmit = async (values, { resetForm }) => { | |||||
| try { | try { | ||||
| postQuestion(values); | postQuestion(values); | ||||
| setOpen(true); | setOpen(true); | ||||
| resetForm({ values: '' }); | |||||
| } catch (error) { | } catch (error) { | ||||
| console.log(error); | console.log(error); | ||||
| } | } |
| const submitHandler = async (values) => { | const submitHandler = async (values) => { | ||||
| try { | try { | ||||
| const result = await createUser( | |||||
| await createUser( | |||||
| values.fullName, | values.fullName, | ||||
| values.username, | values.username, | ||||
| values.email, | values.email, |
| import { useRouter } from 'next/router'; | import { useRouter } from 'next/router'; | ||||
| import PropType from 'prop-types'; | import PropType from 'prop-types'; | ||||
| import { useState } from 'react'; | import { useState } from 'react'; | ||||
| import { shippingDetailsSchema } from '../../../schemas/shippingDetailsSchema'; | |||||
| import shippingDetailsSchema from '../../../schemas/shippingDetailsSchema'; | |||||
| import { useUserData } from '../../../store/user-context'; | import { useUserData } from '../../../store/user-context'; | ||||
| import ErrorMessageComponent from '../../mui/ErrorMessageComponent'; | import ErrorMessageComponent from '../../mui/ErrorMessageComponent'; | ||||
| }); | }); | ||||
| }; | }; | ||||
| } | } | ||||
| // eslint-disable-next-line react-hooks/exhaustive-deps | |||||
| }, [checkoutStorage]); | }, [checkoutStorage]); | ||||
| return ( | return ( |
| }, | }, | ||||
| ], | ], | ||||
| time: { | time: { | ||||
| type: Date, | |||||
| type: String, | |||||
| required: [true, 'Please provide a date.'], | required: [true, 'Please provide a date.'], | ||||
| validate(value) { | |||||
| if (!validator.isDate(value)) { | |||||
| throw new Error('Not a date'); | |||||
| } | |||||
| }, | |||||
| }, | }, | ||||
| shippingAddress: { | shippingAddress: { | ||||
| country: { | country: { |
| "react": "18.2.0", | "react": "18.2.0", | ||||
| "react-dom": "18.2.0", | "react-dom": "18.2.0", | ||||
| "sass": "^1.54.0", | "sass": "^1.54.0", | ||||
| "sharp": "^0.31.2", | |||||
| "stripe": "^10.8.0", | "stripe": "^10.8.0", | ||||
| "swr": "^1.3.0", | "swr": "^1.3.0", | ||||
| "validator": "^13.7.0", | "validator": "^13.7.0", |
| export async function getStaticProps({ locale }) { | export async function getStaticProps({ locale }) { | ||||
| try { | try { | ||||
| const { message, featuredProducts } = await getFeaturedProducts(); | |||||
| const { featuredProducts } = await getFeaturedProducts(); | |||||
| return { | return { | ||||
| props: { | props: { | ||||
| ...(await serverSideTranslations(locale, ['home'])), | ...(await serverSideTranslations(locale, ['home'])), | ||||
| message, | |||||
| featuredProducts, | featuredProducts, | ||||
| }, | }, | ||||
| }; | }; | ||||
| return { | return { | ||||
| props: { | props: { | ||||
| ...(await serverSideTranslations(locale, ['home'])), | ...(await serverSideTranslations(locale, ['home'])), | ||||
| errorMessage: error, | |||||
| featuredProducts: [], | featuredProducts: [], | ||||
| }, | }, | ||||
| }; | }; |
| import * as Yup from 'yup'; | import * as Yup from 'yup'; | ||||
| export const registerSchema = Yup.object().shape({ | |||||
| const registerSchema = Yup.object().shape({ | |||||
| fullName: Yup.string().required('Full name is required'), | fullName: Yup.string().required('Full name is required'), | ||||
| address: Yup.string().required('Address is required'), | address: Yup.string().required('Address is required'), | ||||
| address2: Yup.string(), | address2: Yup.string(), | ||||
| country: Yup.string().required('Country name is required'), | country: Yup.string().required('Country name is required'), | ||||
| postcode: Yup.string().required('Postal code name is required'), | postcode: Yup.string().required('Postal code name is required'), | ||||
| }); | }); | ||||
| export default registerSchema; |