Преглед на файлове

feat: fixed bugs

master
Lazar Kostic преди 3 години
родител
ревизия
d9a505d684

+ 4
- 3
components/cards/hover-image-card/HoverImageCard.jsx Целия файл

@@ -1,3 +1,4 @@
import Image from 'next/image';
import styles from './hover-image-card.module.css';

const HoverImageCard = () => {
@@ -10,7 +11,7 @@ const HoverImageCard = () => {
<button className={styles.btn}>More Details</button>
</div>
{/*Change with Next Image*/}
<img src="/images/image-one.jpg" alt="text" />
<Image src="/images/image-one.jpg" alt="text" />
</div>
<div className={styles.card}>
<div className={styles.content}>
@@ -19,7 +20,7 @@ const HoverImageCard = () => {
<button className={styles.btn}>Button Text</button>
</div>
{/*Change with Next Image*/}
<img src="/images/image-one.jpg" alt="text" />
<Image src="/images/image-one.jpg" alt="text" />
</div>
<div className={styles.card}>
<div className={styles.content}>
@@ -28,7 +29,7 @@ const HoverImageCard = () => {
<button className={styles.btn}>Button Text</button>
</div>
{/*Change with Next Image*/}
<img src="/images/image-one.jpg" alt="text" />
<Image src="/images/image-one.jpg" alt="text" />
</div>
</div>
);

+ 2
- 1
components/forms/contact/ContactPageForm.jsx Целия файл

@@ -20,10 +20,11 @@ const ContactPageForm = () => {
const { t } = useTranslation('contact');
const [open, setOpen] = useState(false);

const handleSubmit = async (values) => {
const handleSubmit = async (values, { resetForm }) => {
try {
postQuestion(values);
setOpen(true);
resetForm({ values: '' });
} catch (error) {
console.log(error);
}

+ 1
- 1
components/forms/register/RegisterForm.jsx Целия файл

@@ -37,7 +37,7 @@ const RegisterForm = () => {

const submitHandler = async (values) => {
try {
const result = await createUser(
await createUser(
values.fullName,
values.username,
values.email,

+ 1
- 1
components/forms/shipping-details/ShippingDetailsForm.jsx Целия файл

@@ -4,7 +4,7 @@ import { useTranslation } from 'next-i18next';
import { useRouter } from 'next/router';
import PropType from 'prop-types';
import { useState } from 'react';
import { shippingDetailsSchema } from '../../../schemas/shippingDetailsSchema';
import shippingDetailsSchema from '../../../schemas/shippingDetailsSchema';
import { useUserData } from '../../../store/user-context';
import ErrorMessageComponent from '../../mui/ErrorMessageComponent';


+ 1
- 0
components/review-content/ReviewContent.jsx Целия файл

@@ -44,6 +44,7 @@ const ReviewContent = () => {
});
};
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [checkoutStorage]);

return (

+ 1
- 6
models/order.js Целия файл

@@ -62,13 +62,8 @@ const OrderSchema = new mongoose.Schema(
},
],
time: {
type: Date,
type: String,
required: [true, 'Please provide a date.'],
validate(value) {
if (!validator.isDate(value)) {
throw new Error('Not a date');
}
},
},
shippingAddress: {
country: {

+ 0
- 36100
package-lock.json
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 1
- 0
package.json Целия файл

@@ -35,6 +35,7 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"sass": "^1.54.0",
"sharp": "^0.31.2",
"stripe": "^10.8.0",
"swr": "^1.3.0",
"validator": "^13.7.0",

+ 1
- 3
pages/index.js Целия файл

@@ -42,11 +42,10 @@ const Home = (props) => {

export async function getStaticProps({ locale }) {
try {
const { message, featuredProducts } = await getFeaturedProducts();
const { featuredProducts } = await getFeaturedProducts();
return {
props: {
...(await serverSideTranslations(locale, ['home'])),
message,
featuredProducts,
},
};
@@ -54,7 +53,6 @@ export async function getStaticProps({ locale }) {
return {
props: {
...(await serverSideTranslations(locale, ['home'])),
errorMessage: error,
featuredProducts: [],
},
};

+ 3
- 1
schemas/shippingDetailsSchema.js Целия файл

@@ -1,6 +1,6 @@
import * as Yup from 'yup';

export const registerSchema = Yup.object().shape({
const registerSchema = Yup.object().shape({
fullName: Yup.string().required('Full name is required'),
address: Yup.string().required('Address is required'),
address2: Yup.string(),
@@ -8,3 +8,5 @@ export const registerSchema = Yup.object().shape({
country: Yup.string().required('Country name is required'),
postcode: Yup.string().required('Postal code name is required'),
});

export default registerSchema;

+ 3478
- 2540
yarn.lock
Файловите разлики са ограничени, защото са твърде много
Целия файл


Loading…
Отказ
Запис