From 3d43273f751a7d10f8545b4e7de2870a05117a7f Mon Sep 17 00:00:00 2001 From: viet nguyen Date: Tue, 2 Jan 2024 19:32:24 -0800 Subject: [PATCH] fix: sort child area list by LR index --- src/app/editArea/[slug]/general/components/AreaList.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/editArea/[slug]/general/components/AreaList.tsx b/src/app/editArea/[slug]/general/components/AreaList.tsx index 0657a7e83..15f815207 100644 --- a/src/app/editArea/[slug]/general/components/AreaList.tsx +++ b/src/app/editArea/[slug]/general/components/AreaList.tsx @@ -2,6 +2,7 @@ import { AreaType } from '@/js/types' import { AreaItem } from './AreaItem' import { GluttenFreeCrumbs } from '@/components/ui/BreadCrumbs' +import { areaLeftRightIndexComparator } from '@/js/utils' type AreaListProps = Pick & { areas: AreaType[] @@ -33,6 +34,6 @@ export const AreaListForm: React.FC = ({ areaName, uuid, pathToke export const AreaList: React.FC<{ parentUuid: string, areas: AreaType[], editMode?: boolean }> = ({ areas, parentUuid, editMode = false }) => (
- {areas.map((item, index) => + {[...areas].sort(areaLeftRightIndexComparator).map((item, index) => )}
)