Skip to content

Commit

Permalink
Merge pull request #105 from perimetre/dev
Browse files Browse the repository at this point in the history
Promoting dev
  • Loading branch information
AssisrMatheus authored Apr 14, 2022
2 parents 68fddeb + 8e00e98 commit a4ea309
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions public/unity/Build/unity.data
Git LFS file not shown
2 changes: 1 addition & 1 deletion public/unity/Build/unity.framework.js

Large diffs are not rendered by default.

Binary file modified public/unity/Build/unity.wasm
Binary file not shown.
10 changes: 7 additions & 3 deletions src/components/UI/PlannerSidebar/SidebarModules/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ const SidebarModules: React.FC<SidebarModulesProps> = ({ modules: modulesProps,
const { state: projectState, projectModule, didFinishSetup } = usePlannerContext();

const modules = useMemo(
() => modulesProps?.filter((module) => module.categories.some((cat) => cat.slug === category?.slug)),
() =>
modulesProps
?.filter((module) => module.categories.some((cat) => cat.slug === category?.slug))
// Sort by category so the ones that doesn't belong to same category show up at the end
.sort((a) => (a.categories.some((cat) => cat.slug === category?.slug) ? -1 : 1)),
[modulesProps, category]
);

Expand Down Expand Up @@ -79,7 +83,7 @@ const SidebarModules: React.FC<SidebarModulesProps> = ({ modules: modulesProps,
{/* By setting the height value to any value with h-0, we force it to recalculate, which shows the scrollbar */}
<div className="flex flex-grow h-0 mui-scrollbar">
<motion.div
className="flex flex-col p-4 mr-4 overflow-auto gap-4"
className="flex flex-col w-5/12 p-4 mr-4 overflow-auto gap-4"
variants={container}
initial="hidden"
animate="show"
Expand Down Expand Up @@ -114,7 +118,7 @@ const SidebarModules: React.FC<SidebarModulesProps> = ({ modules: modulesProps,
</motion.div>
))}
</motion.div>
<div className="flex-grow">{selectedModule && <SidebarModuleDetail module={selectedModule} />}</div>
<div className="flex-grow w-min">{selectedModule && <SidebarModuleDetail module={selectedModule} />}</div>
</div>
</>
)}
Expand Down
4 changes: 2 additions & 2 deletions src/components/UI/PlannerSidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const PlannerSidebar: React.FC<PlannerSidebarProps> = ({ project, isSidebarOpen,
}, []);

const handleCategoryOpen = useCallback(() => {
if (state === 'categories' && project?.modules) {
const all = project?.modules[0].categories.find((f) => f.slug === 'all');
if (state === 'categories' && project?.modules && project.modules.length > 0) {
const all = project?.modules[0]?.categories.find((f) => f.slug === 'all');
onCategoryClick(all);
}
}, [state, project, onCategoryClick]);
Expand Down

0 comments on commit a4ea309

Please sign in to comment.