업데이트

This commit is contained in:
focp212@naver.com
2025-10-01 09:27:08 +09:00
parent 857a58c14d
commit 68f8560d05
5 changed files with 62 additions and 11 deletions

View File

@@ -13,7 +13,7 @@ export const MenuCategory = ({
setMenuOn,
editMode,
setChangeMenuId,
buttonRefs
buttonRef,btnRef
}: MenuCategoryProps) => {
const { navigate } = useNavigate();
@@ -34,7 +34,7 @@ export const MenuCategory = ({
menuId?: string
) => {
let userFavorite = useStore.getState().UserStore.userFavorite;
let randomNum = Math.floor(Math.random() * 5) + 1;
let randomNum = Math.floor(Math.random() * 3) + 1;
if(checked){
userFavorite = [
...userFavorite,
@@ -78,7 +78,6 @@ export const MenuCategory = ({
<li
key={ `menu-item-key-${menuId}-${i}` }
onClick={ () => onClickToNavigate(subMenu[i]?.path) }
ref={ (element) => { buttonRefs.current[i] = element }}
>
<span>{ subMenu[i]?.menuName }</span>
<div className="check_box_scrap">
@@ -107,7 +106,7 @@ export const MenuCategory = ({
<li
key={ `menu-item-key-${i}` }
onClick={ () => onClickToNavigate(subMenu[i]?.path) }
ref={ (element) => { buttonRefs.current[i] = element }}
>{ subMenu[i]?.menuName }</li>
);
}
@@ -120,8 +119,13 @@ export const MenuCategory = ({
return (
<>
<div className="menu-category">
<div className="category-header">
<div
className={`menu-category ${btnRef? 'ok': 'no'}`}
>
<div className="category-header"
ref={ btnRef || null }
>
<div className={ 'category-icon ' + menuIcon }></div>
<span>{ menuName }</span>
</div>