홈 배너
This commit is contained in:
@@ -4,6 +4,8 @@ import { useStore } from '@/shared/model/store';
|
||||
import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||
import { UserFavorite } from '@/entities/user/model/types';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useLocation } from 'react-router';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
|
||||
export const MenuCategory = ({
|
||||
menuId,
|
||||
@@ -15,6 +17,7 @@ export const MenuCategory = ({
|
||||
setChangeMenuId
|
||||
}: MenuCategoryProps) => {
|
||||
const { navigate } = useNavigate();
|
||||
const location = useLocation();
|
||||
|
||||
const [favoriteItems, setFavoriteItems] = useState<Array<UserFavorite>>([]);
|
||||
const [menuIds, setMenuIds] = useState<Array<string | undefined>>([]);
|
||||
@@ -53,6 +56,9 @@ export const MenuCategory = ({
|
||||
useStore.getState().UserStore.setUserFavorite(userFavorite);
|
||||
setChangeMenuId(`${menuId}-${checked}`);
|
||||
callFavoiteItems();
|
||||
if(location.pathname === PATHS.home){
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
const callFavoiteItems = () => {
|
||||
@@ -123,7 +129,7 @@ export const MenuCategory = ({
|
||||
<span>{ menuName }</span>
|
||||
</div>
|
||||
<ul className="category-items">
|
||||
{ getMenuItems() }
|
||||
{ getMenuItems() }
|
||||
</ul>
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user