@@ -96,124 +37,19 @@ export const CategoryTree = ({
}
return (
-
-
- handleDrag({
- dragItem: dragItem as CategoryTreeItem,
- items: items as CategoryTreeItem[],
- targetPath,
- })
- }
- disableDrag={({ item }) => getIsEnabled(item as CategoryTreeItem)}
- renderItem={({ index, item, ...props }) => {
- return (
-
- )
- }}
- renderCollapseIcon={({ isCollapsed }) => {
- return
- }}
- threshold={10}
- />
-
+
)
}
-const CollapseHandler = ({ isCollapsed }: { isCollapsed: boolean }) => {
- return (
-
-
-
-
-
- {isCollapsed ? : }
-
-
- )
-}
-
-type CategoryBranchProps = {
- item: CategoryTreeItem
- depth: number
- isEnabled: boolean
- isNew?: boolean
- collapseIcon: ReactNode
- handler?: ReactNode
-}
-
-export const CategoryBranch = ({
- item,
- depth,
- isEnabled,
- isNew = false,
- collapseIcon,
-}: CategoryBranchProps) => {
- const { t } = useTranslation()
-
- const isLeaf = !collapseIcon
-
- const Component = (
-
console.log("dragging")}
- data-disabled={!isEnabled}
- className={clx(
- "bg-ui-bg-base hover:bg-ui-bg-base-hover transition-fg group group flex h-12 cursor-grab items-center gap-x-3 border-b px-6 py-2.5 active:cursor-grabbing",
- {
- "bg-ui-bg-subtle hover:bg-ui-bg-subtle cursor-not-allowed":
- !isEnabled,
- }
- )}
- >
-
-
-
- {Array.from({ length: depth }).map((_, i) => (
-
- ))}
-
{collapseIcon}
- {isLeaf && (
-
- )}
-
-
-
- {item.name}
-
- {isNew && (
-
- {t("categories.fields.new.label")}
-
- )}
-
-
- )
-
- return Component
-}
-
const CategoryLeafPlaceholder = () => {
return (
-
+
)
}
diff --git a/packages/admin-next/dashboard/src/routes/categories/common/components/category-tree/styles.css b/packages/admin-next/dashboard/src/routes/categories/common/components/category-tree/styles.css
deleted file mode 100644
index 1f4effa57cb8c..0000000000000
--- a/packages/admin-next/dashboard/src/routes/categories/common/components/category-tree/styles.css
+++ /dev/null
@@ -1,50 +0,0 @@
-.nestable-item {
- margin: 0 !important;
-}
-
-.nestable-item.is-dragging:before {
- content: "" !important;
- position: absolute !important;
- top: 0 !important;
- left: 0 !important;
- right: 0 !important;
- bottom: 0 !important;
- background: var(--bg-base-hover) !important;
- border-radius: 0 !important;
-
- transition: 0.3s all !important;
- border: 0px !important;
- border-bottom: 1px solid var(--border-base) !important;
-}
-
-.nestable-item.is-dragging * {
- height: 48px !important;
- min-height: 48px !important;
- max-height: 48px !important;
- overflow: hidden !important;
- background: var(--bg-base) !important;
- box-shadow: var(--elevation-card-hover) !important;
- z-index: 1000 !important;
-}
-
-.nestable-drag-layer > .nestable-list {
- box-shadow: var(--elevation-flyout) !important;
- border-radius: 6px !important;
- overflow: hidden !important;
- opacity: 0.8 !important;
- width: fit-content !important;
-}
-
-.nestable-item,
-.nestable-item-copy {
- margin: 0 !important;
-}
-
-.nestable-drag-layer > .nestable-list > .nestable-item-copy > div {
- border-bottom: 0px !important;
-}
-
-.nestable-list {
- padding: 0 !important;
- margin: 0 !important;
-}
diff --git a/yarn.lock b/yarn.lock
index 1e8212080c224..90916961f2cb5 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4508,7 +4508,6 @@ __metadata:
react-hook-form: 7.49.1
react-i18next: 13.5.0
react-jwt: ^1.2.0
- react-nestable: ^3.0.2
react-router-dom: 6.20.1
tailwindcss: ^3.4.1
tsup: ^8.0.2
@@ -25965,24 +25964,6 @@ __metadata:
languageName: node
linkType: hard
-"react-addons-shallow-compare@npm:^15.6.3":
- version: 15.6.3
- resolution: "react-addons-shallow-compare@npm:15.6.3"
- dependencies:
- object-assign: ^4.1.0
- checksum: ad1a2ef7adf1a307b55de58a99ccf40998a1f7c84dcaadb1a2dd40c0e21e911b84fe04ab5f3494a1118846fc7537043287d54bcaffc2daf819b6c45eef5635ce
- languageName: node
- linkType: hard
-
-"react-addons-update@npm:^15.6.3":
- version: 15.6.3
- resolution: "react-addons-update@npm:15.6.3"
- dependencies:
- object-assign: ^4.1.0
- checksum: b6d98b459eb37393b8103309090b36649c0a0e95c7dbe010e692616eb025baf62b53cb187925ecce0c3ed0377357ce03c3a45a8ec2d91e6886f8d2eb55b0dfd1
- languageName: node
- linkType: hard
-
"react-aria@npm:^3.33.1":
version: 3.33.1
resolution: "react-aria@npm:3.33.1"
@@ -26194,19 +26175,6 @@ __metadata:
languageName: node
linkType: hard
-"react-nestable@npm:^3.0.2":
- version: 3.0.2
- resolution: "react-nestable@npm:3.0.2"
- dependencies:
- classnames: ^2.3.2
- react: ^18.2.0
- react-addons-shallow-compare: ^15.6.3
- react-addons-update: ^15.6.3
- react-dom: ^18.2.0
- checksum: e2a7947382ca28e12048c534a2ad6e544dff60a56e712b7a1b00838434c5b5444b4c50c1fd652e032710b567674b4eff36ee4c3a5021c02f933d11c7b88ce7b9
- languageName: node
- linkType: hard
-
"react-refresh@npm:^0.14.0":
version: 0.14.2
resolution: "react-refresh@npm:0.14.2"