Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

paulosyatt
Copy link

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:
Screen Shot 2022-09-12 at 5 44 00 PM
Screen Shot 2022-09-12 at 5 44 15 PM
Screen Shot 2022-09-12 at 5 44 31 PM

@paulosyatt paulosyatt requested a review from a team September 21, 2022 17:34
gap: 2rem;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
display: flex;
/* display: grid; */

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(

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:

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants