-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
separated the catergories without subs #3
base: master
Are you sure you want to change the base?
Conversation
gap: 2rem; | ||
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); | ||
display: flex; | ||
/* display: grid; */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these stylings that are commented out necessary here or can we remove?
@@ -222,6 +225,66 @@ const Submenu: FC<ItemProps> = observer((props) => { | |||
// eslint-disable-next-line react-hooks/exhaustive-deps | |||
[departmentActive, collapsibleStates] | |||
) | |||
|
|||
const itemsWithNoSubCategories = useMemo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the file, it seems that there's a fair bit of duplication between itemsWithSubCategories
/ items
– We might want to extract the following, somehow:
mega-menu/react/MegaMenu/components/Submenu.tsx
Lines 119 to 136 in dc7e3cd
const items = useMemo( | |
() => { | |
if (!departmentActive) return | |
if (departmentActive.menu) { | |
if (departmentActive.menu.length > 1) { | |
setShowBtnCat(true) | |
} else { | |
setShowBtnCat(false) | |
} | |
} else { | |
setShowBtnCat(false) | |
} | |
const categories = getCategories() | |
return categories | |
.filter((j) => j.display) |
What problem is this solving?
The design was a little off, It's not perfect but it's much closer
How should this be manually tested?
Test here WITI - 272
Screenshots or example usage: