add_cart_notfound
This commit is contained in:
parent
2421bce5f7
commit
36ffb8ef19
BIN
public/Cart/empty_card.gif
Normal file
BIN
public/Cart/empty_card.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
public/Home/notfound_search.png
Normal file
BIN
public/Home/notfound_search.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
BIN
public/icon/notfound_search.png
Normal file
BIN
public/icon/notfound_search.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
|
|
@ -19,12 +19,12 @@ const App = () => {
|
||||||
|
|
||||||
}
|
}
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
const randomtoken = Math.random()
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fn_firebase = (async () => {
|
const fn_firebase = (async () => {
|
||||||
const token = await requestPermission()
|
// const token = await requestPermission()
|
||||||
if (!Guest) {
|
if (!Guest) {
|
||||||
mutate({ fcm_token: token });
|
mutate({ fcm_token: randomtoken });
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
fn_firebase()
|
fn_firebase()
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ const CartWithDrawer = () => {
|
||||||
open={open}
|
open={open}
|
||||||
key={placement}
|
key={placement}
|
||||||
width={550}
|
width={550}
|
||||||
style={{maxHeight:"90%"}}
|
style={{maxHeight:"60%", minHeight:"500px"}}
|
||||||
>
|
>
|
||||||
<div className="cart_first_section">
|
<div className="cart_first_section">
|
||||||
<span>{t("Cart")}</span>
|
<span>{t("Cart")}</span>
|
||||||
|
|
@ -76,6 +76,7 @@ const CartWithDrawer = () => {
|
||||||
<CardItem key={index} data={item} />
|
<CardItem key={index} data={item} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{Cart?.length > 0 ? (
|
{Cart?.length > 0 ? (
|
||||||
<div className="ViewCart_Button">
|
<div className="ViewCart_Button">
|
||||||
|
|
@ -97,7 +98,10 @@ const CartWithDrawer = () => {
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div></div>
|
<div className="EmptyCard">
|
||||||
|
<img src="/Cart/empty_card.gif" alt="" />
|
||||||
|
<p>{t('You have not placed any orders yet')}</p>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
|
|
|
||||||
17
src/Components/Utils/Search/Empty.tsx
Normal file
17
src/Components/Utils/Search/Empty.tsx
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
import React from 'react'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
|
const Empty = () => {
|
||||||
|
const [t] = useTranslation()
|
||||||
|
return (
|
||||||
|
<div className='Empty'>
|
||||||
|
<img src="/icon/notfound_search.png" alt="" />
|
||||||
|
<h1>{t("There are no suitable products")}</h1>
|
||||||
|
<p>
|
||||||
|
{t("Please try using other keywords to find the product name")}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Empty
|
||||||
|
|
@ -104,4 +104,9 @@
|
||||||
border-radius: 5px 0 0 5px;
|
border-radius: 5px 0 0 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.search_comp{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
@ -18,6 +18,7 @@ const LoginForm = ({ setOpen }: any) => {
|
||||||
const { mutate, isLoading, isSuccess, data } = useLogin();
|
const { mutate, isLoading, isSuccess, data } = useLogin();
|
||||||
const { login } = useAuthState();
|
const { login } = useAuthState();
|
||||||
const FCM = localStorage.getItem(FCM_TOKEN_KEY)
|
const FCM = localStorage.getItem(FCM_TOKEN_KEY)
|
||||||
|
const random_token = Math.random()
|
||||||
|
|
||||||
const handelSubmit = (values: any) => {
|
const handelSubmit = (values: any) => {
|
||||||
if (!values.email || !values.password) {
|
if (!values.email || !values.password) {
|
||||||
|
|
@ -25,7 +26,7 @@ const LoginForm = ({ setOpen }: any) => {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mutate({ ...values, fcm_token: FCM });
|
mutate({ ...values, fcm_token: random_token });
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
.active{
|
.active{
|
||||||
|
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
// border-bottom: .1vw solid var(--primary);
|
border-bottom: .1vw solid var(--primary);
|
||||||
color: var(--primary);
|
color: var(--primary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -113,4 +113,19 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.EmptyCard{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 5%;
|
||||||
|
gap: 20px;
|
||||||
|
img{
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
p{
|
||||||
|
font-size: max(1.5vw,15px);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user