diff --git a/packages/client/src/pages/Main/containers/StatementsListBox/StatementListHeader/StatementListHeader.tsx b/packages/client/src/pages/Main/containers/StatementsListBox/StatementListHeader/StatementListHeader.tsx index 174e6bfd2..91f45e97e 100644 --- a/packages/client/src/pages/Main/containers/StatementsListBox/StatementListHeader/StatementListHeader.tsx +++ b/packages/client/src/pages/Main/containers/StatementsListBox/StatementListHeader/StatementListHeader.tsx @@ -45,6 +45,7 @@ import { StyledMoveToParent, StyledSuggesterRow, } from "./StatementListHeaderStyles"; +import { rootTerritoryId } from "Theme/constants"; interface StatementListHeader { data: IResponseTerritory; @@ -305,20 +306,22 @@ export const StatementListHeader: React.FC = ({ : "no territory selected"} - - {"Move to parent:\xa0"} - { - moveTerritoryMutation.mutate(newSelectedId); - }} - excludedActantIds={excludedMoveTerritories} - /> - + {territoryId !== rootTerritoryId && ( + + {"Move to parent:\xa0"} + { + moveTerritoryMutation.mutate(newSelectedId); + }} + excludedActantIds={excludedMoveTerritories} + /> + + )} diff --git a/packages/client/src/pages/Main/containers/TerritoryTreeBox/TerritoryTreeNode/TerritoryTreeNode.tsx b/packages/client/src/pages/Main/containers/TerritoryTreeBox/TerritoryTreeNode/TerritoryTreeNode.tsx index d7a9248cc..0fa593bc8 100644 --- a/packages/client/src/pages/Main/containers/TerritoryTreeBox/TerritoryTreeNode/TerritoryTreeNode.tsx +++ b/packages/client/src/pages/Main/containers/TerritoryTreeBox/TerritoryTreeNode/TerritoryTreeNode.tsx @@ -263,73 +263,69 @@ export const TerritoryTreeNode: React.FC = ({ return ( <> - {id !== rootTerritoryId && ( - <> - {!tempDisabled ? ( - - - {hasChildren ? ( - <>{renderArrowIcon()} + {!tempDisabled ? ( + + + {hasChildren ? ( + <>{renderArrowIcon()} + ) : ( + <> + {statementsCount > 0 ? ( + { + setTerritoryId(id); + }} + /> ) : ( - <> - {statementsCount > 0 ? ( - { - setTerritoryId(id); - }} - /> - ) : ( - { - setTerritoryId(id); - }} - /> - )} - + { + setTerritoryId(id); + }} + /> )} - - - - - setContextMenuOpen(true)} - onMenuClose={() => setContextMenuOpen(false)} - right={right} - empty={(empty && !children.length) || false} - storedTerritories={storedTerritories} - updateUserMutation={updateUserMutation} - isFavorited={isFavorited} - /> - - ) : ( - - )} - + + )} + + + + + setContextMenuOpen(true)} + onMenuClose={() => setContextMenuOpen(false)} + right={right} + empty={(empty && !children.length) || false} + storedTerritories={storedTerritories} + updateUserMutation={updateUserMutation} + isFavorited={isFavorited} + /> + + ) : ( + )} ); @@ -339,7 +335,7 @@ export const TerritoryTreeNode: React.FC = ({ <> {renderTreeNode()} - + {!hideChildTerritories && isExpanded && childTerritories.map((child: IExtendedResponseTree, key: number) => (