fix(admin-ui): Collapse categories by default (#3637)
This commit is contained in:
+5
-4
@@ -1,6 +1,6 @@
|
|||||||
|
import { dropRight, flatMap, get } from "lodash"
|
||||||
import React, { useCallback, useMemo } from "react"
|
import React, { useCallback, useMemo } from "react"
|
||||||
import Nestable from "react-nestable"
|
import Nestable from "react-nestable"
|
||||||
import { dropRight, get, flatMap } from "lodash"
|
|
||||||
|
|
||||||
import "react-nestable/dist/styles/index.css"
|
import "react-nestable/dist/styles/index.css"
|
||||||
import "../styles/product-categories.css"
|
import "../styles/product-categories.css"
|
||||||
@@ -8,12 +8,12 @@ import "../styles/product-categories.css"
|
|||||||
import { ProductCategory } from "@medusajs/medusa"
|
import { ProductCategory } from "@medusajs/medusa"
|
||||||
import { adminProductCategoryKeys, useMedusa } from "medusa-react"
|
import { adminProductCategoryKeys, useMedusa } from "medusa-react"
|
||||||
|
|
||||||
import TriangleMiniIcon from "../../../components/fundamentals/icons/triangle-mini-icon"
|
|
||||||
import ProductCategoryListItemDetails from "./product-category-list-item-details"
|
|
||||||
import ReorderIcon from "../../../components/fundamentals/icons/reorder-icon"
|
|
||||||
import { useQueryClient } from "@tanstack/react-query"
|
import { useQueryClient } from "@tanstack/react-query"
|
||||||
|
import ReorderIcon from "../../../components/fundamentals/icons/reorder-icon"
|
||||||
|
import TriangleMiniIcon from "../../../components/fundamentals/icons/triangle-mini-icon"
|
||||||
import useNotification from "../../../hooks/use-notification"
|
import useNotification from "../../../hooks/use-notification"
|
||||||
import useToggleState from "../../../hooks/use-toggle-state"
|
import useToggleState from "../../../hooks/use-toggle-state"
|
||||||
|
import ProductCategoryListItemDetails from "./product-category-list-item-details"
|
||||||
|
|
||||||
type ProductCategoriesListProps = {
|
type ProductCategoriesListProps = {
|
||||||
categories: ProductCategory[]
|
categories: ProductCategory[]
|
||||||
@@ -76,6 +76,7 @@ function ProductCategoriesList(props: ProductCategoriesListProps) {
|
|||||||
() => (
|
() => (
|
||||||
<Nestable
|
<Nestable
|
||||||
items={categories}
|
items={categories}
|
||||||
|
collapsed={true}
|
||||||
onChange={onItemDrop}
|
onChange={onItemDrop}
|
||||||
childrenProp="category_children"
|
childrenProp="category_children"
|
||||||
// Adding an unreasonably high number here to prevent us from
|
// Adding an unreasonably high number here to prevent us from
|
||||||
|
|||||||
Reference in New Issue
Block a user