Bläddra i källkod

Merge branch 'bug-fix-v1' of ntasicc/coffee into master

localization
lazarkostic 3 år sedan
förälder
incheckning
734f2f3854

+ 2
- 2
components/cards/cart-card/CartCard.jsx Visa fil

@@ -184,8 +184,8 @@ CartCard.propTypes = {
people: PropType.string,
process: PropType.string,
pairing: PropType.string,
available: PropType.Boolean,
isFeatured: PropType.Boolean,
//available: PropType.Boolean,
//isFeatured: PropType.Boolean,
price: PropType.number,
customID: PropType.string,
}),

+ 5
- 15
components/forms/contact/ContactPageForm.jsx Visa fil

@@ -1,10 +1,8 @@
import {
Alert,
Box,
Button,
Container,
Grid,
Snackbar,
TextField,
Typography,
} from '@mui/material';
@@ -16,6 +14,7 @@ import React, { useState } from 'react';
import { BASE_PAGE } from '../../../constants/pages';
import { postQuestion } from '../../../requests/question/postQuestionRequest';
import { contactPageSchema } from '../../../schemas/contactSchema';
import Notification from '../../notification/Notification';

const ContactPageForm = () => {
const { t } = useTranslation('contact');
@@ -49,20 +48,11 @@ const ContactPageForm = () => {

return (
<Container component="main" maxWidth="md" sx={{ mb: '60px' }}>
<Snackbar
anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
<Notification
open={open}
autoHideDuration={3000}
onClose={handleCloseNotification}
>
<Alert
onClose={handleCloseNotification}
severity="success"
sx={{ width: '100%', backgroundColor: 'green', color: 'white' }}
>
{t('contact:notification')}
</Alert>
</Snackbar>
notification={t('contact:notification')}
handleCloseNotification={handleCloseNotification}
/>
<Box
sx={{
marginTop: 32,

+ 2
- 2
components/forms/shipping-details/ShippingDetailsForm.jsx Visa fil

@@ -163,8 +163,8 @@ const ShippingDetailsForm = ({
};

ShippingDetailsForm.propTypes = {
backBtn: PropType.Boolean,
isCheckout: PropType.Boolean,
backBtn: PropType.bool,
isCheckout: PropType.bool,
submitHandler: PropType.func,
};


+ 1
- 0
components/hero/Hero.jsx Visa fil

@@ -129,6 +129,7 @@ const Hero = () => {
alt="profile"
width={818}
height={796}
priority
/>
</Box>
</Box>

+ 39
- 30
components/layout/navbar/DesktopNav.jsx Visa fil

@@ -17,7 +17,7 @@ const DesktopNav = ({ router, totalQuantity, session, signOutHandler }) => {
justifyContent: 'center',
}}
>
{items.map((item, i) => (
{items.map((item) => (
<NavItemDesktop
key={item.id}
router={router}
@@ -61,12 +61,14 @@ const DesktopNav = ({ router, totalQuantity, session, signOutHandler }) => {
}}
>
<Link key="home" href={PROFILE_PAGE}>
<Image
src="/images/profile.svg"
alt="profile"
width={24}
height={24}
/>
<a>
<Image
src="/images/profile.svg"
alt="profile"
width={24}
height={24}
/>
</a>
</Link>
</Box>
<Box
@@ -77,29 +79,36 @@ const DesktopNav = ({ router, totalQuantity, session, signOutHandler }) => {
}}
>
<Link key="home" href={CART_PAGE}>
<Box>
{totalQuantity !== 0 && (
<Box
sx={{
color: 'white',
zIndex: 3,
width: 20,
height: 20,
borderRadius: 20,
textAlign: 'center',
px: 0.5,
ml: 2.2,
mt: -1,
fontSize: 17,
position: 'absolute',
backgroundColor: 'primary.main',
}}
>
{totalQuantity}
</Box>
)}
<Image src="/images/cart.svg" alt="cart" width={24} height={24} />
</Box>
<a>
<Box>
{totalQuantity !== 0 && (
<Box
sx={{
color: 'white',
zIndex: 3,
width: 20,
height: 20,
borderRadius: 20,
textAlign: 'center',
px: 0.5,
ml: 2.2,
mt: -1,
fontSize: 17,
position: 'absolute',
backgroundColor: 'primary.main',
}}
>
{totalQuantity}
</Box>
)}
<Image
src="/images/cart.svg"
alt="cart"
width={24}
height={24}
/>
</Box>
</a>
</Link>
</Box>
</Box>

+ 2
- 2
components/layout/navbar/MobileNav.jsx Visa fil

@@ -33,8 +33,8 @@ const MobileNav = ({
}}
>
<Box sx={{ display: 'flex', justifyContent: 'space-between', mb: 2 }}>
<IconButton disableRipple>
<CloseIcon color="primary" onClick={toggleDrawer(false)} />
<IconButton disableRipple onClick={toggleDrawer(false)}>
<CloseIcon color="primary" />
</IconButton>

{session?.user?._id && (

+ 22
- 0
components/notification/Notification.jsx Visa fil

@@ -0,0 +1,22 @@
import { Alert, Snackbar } from '@mui/material';

const Notification = ({ handleCloseNotification, notification, open }) => {
return (
<Snackbar
anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
open={open}
autoHideDuration={3000}
onClose={handleCloseNotification}
>
<Alert
onClose={handleCloseNotification}
severity="success"
sx={{ width: '100%', backgroundColor: 'green', color: 'white' }}
>
{notification}
</Alert>
</Snackbar>
);
};

export default Notification;

+ 8
- 6
components/product-card/ProductCard.jsx Visa fil

@@ -29,12 +29,14 @@ const ProductCard = ({ product }) => {
href={`/products/${product.customID}`}
passHref
>
<Image
src={product.image}
alt="product image"
width={500}
height={390}
/>
<a>
<Image
src={product.image}
alt="product image"
width={500}
height={390}
/>
</a>
</NextLink>
</Box>
<Box

+ 6
- 14
components/profile-content/ProfileContent.jsx Visa fil

@@ -1,4 +1,4 @@
import { Alert, Snackbar, Typography } from '@mui/material';
import { Typography } from '@mui/material';
import { Box } from '@mui/system';
import { useSession } from 'next-auth/react';
import { useTranslation } from 'next-i18next';
@@ -11,6 +11,7 @@ import ShippingDetailsForm from '../forms/shipping-details/ShippingDetailsForm';
import ContentContainer from '../layout/content-wrapper/ContentContainer';
import PageWrapper from '../layout/page-wrapper/PageWrapper';
import StepTitle from '../layout/steps-title/StepTitle';
import Notification from '../notification/Notification';

const ProfileContent = ({ orders }) => {
const { t } = useTranslation('profile');
@@ -55,20 +56,11 @@ const ProfileContent = ({ orders }) => {
return (
<PageWrapper>
<StepTitle title={t('profile:title')} />
<Snackbar
anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
<Notification
open={open}
autoHideDuration={3000}
onClose={handleCloseNotification}
>
<Alert
onClose={handleCloseNotification}
severity="success"
sx={{ width: '100%', backgroundColor: 'green', color: 'white' }}
>
{t('profile:notification')}
</Alert>
</Snackbar>
handleCloseNotification={handleCloseNotification}
notification={t('profile:notification')}
/>

<ContentContainer>
<Box flexGrow={1} sx={{ minWidth: '65%' }}>

+ 1
- 1
public/locales/en/contact.json Visa fil

@@ -5,6 +5,6 @@
"firstName": "First name",
"lastName": "Last name",
"email": "Email",
"msg": "Message",
"message": "Message",
"notification": "Question submitted!"
}

Laddar…
Avbryt
Spara