From bdce958f29c3a1695fe1488e90eef653251cf3f7 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 7 Aug 2024 08:16:15 +1000 Subject: [PATCH] tidy(ui): "useIsEntitySelected" -> "useEntityIsSelected" --- .../controlLayers/components/common/CanvasEntityContainer.tsx | 4 ++-- .../controlLayers/components/common/CanvasEntityTitle.tsx | 4 ++-- .../hooks/{useIsEntitySelected.ts => useEntityIsSelected.ts} | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename invokeai/frontend/web/src/features/controlLayers/hooks/{useIsEntitySelected.ts => useEntityIsSelected.ts} (87%) diff --git a/invokeai/frontend/web/src/features/controlLayers/components/common/CanvasEntityContainer.tsx b/invokeai/frontend/web/src/features/controlLayers/components/common/CanvasEntityContainer.tsx index 550ba0d020..5cc84f8a32 100644 --- a/invokeai/frontend/web/src/features/controlLayers/components/common/CanvasEntityContainer.tsx +++ b/invokeai/frontend/web/src/features/controlLayers/components/common/CanvasEntityContainer.tsx @@ -2,7 +2,7 @@ import { Flex } from '@invoke-ai/ui-library'; import { useAppDispatch } from 'app/store/storeHooks'; import { useEntityIdentifierContext } from 'features/controlLayers/contexts/EntityIdentifierContext'; import { useEntitySelectionColor } from 'features/controlLayers/hooks/useEntitySelectionColor'; -import { useIsEntitySelected } from 'features/controlLayers/hooks/useIsEntitySelected'; +import { useEntityIsSelected } from 'features/controlLayers/hooks/useEntityIsSelected'; import { entitySelected } from 'features/controlLayers/store/canvasV2Slice'; import type { PropsWithChildren } from 'react'; import { memo, useCallback } from 'react'; @@ -10,7 +10,7 @@ import { memo, useCallback } from 'react'; export const CanvasEntityContainer = memo((props: PropsWithChildren) => { const dispatch = useAppDispatch(); const entityIdentifier = useEntityIdentifierContext(); - const isSelected = useIsEntitySelected(entityIdentifier); + const isSelected = useEntityIsSelected(entityIdentifier); const selectionColor = useEntitySelectionColor(entityIdentifier); const onClick = useCallback(() => { if (isSelected) { diff --git a/invokeai/frontend/web/src/features/controlLayers/components/common/CanvasEntityTitle.tsx b/invokeai/frontend/web/src/features/controlLayers/components/common/CanvasEntityTitle.tsx index cbb48fa246..3853f7249c 100644 --- a/invokeai/frontend/web/src/features/controlLayers/components/common/CanvasEntityTitle.tsx +++ b/invokeai/frontend/web/src/features/controlLayers/components/common/CanvasEntityTitle.tsx @@ -1,6 +1,6 @@ import { Text } from '@invoke-ai/ui-library'; import { useEntityIdentifierContext } from 'features/controlLayers/contexts/EntityIdentifierContext'; -import { useIsEntitySelected } from 'features/controlLayers/hooks/useIsEntitySelected'; +import { useEntityIsSelected } from 'features/controlLayers/hooks/useEntityIsSelected'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { assert } from 'tsafe'; @@ -8,7 +8,7 @@ import { assert } from 'tsafe'; export const CanvasEntityTitle = memo(() => { const { t } = useTranslation(); const entityIdentifier = useEntityIdentifierContext(); - const isSelected = useIsEntitySelected(entityIdentifier); + const isSelected = useEntityIsSelected(entityIdentifier); const title = useMemo(() => { if (entityIdentifier.type === 'inpaint_mask') { return t('controlLayers.inpaintMask'); diff --git a/invokeai/frontend/web/src/features/controlLayers/hooks/useIsEntitySelected.ts b/invokeai/frontend/web/src/features/controlLayers/hooks/useEntityIsSelected.ts similarity index 87% rename from invokeai/frontend/web/src/features/controlLayers/hooks/useIsEntitySelected.ts rename to invokeai/frontend/web/src/features/controlLayers/hooks/useEntityIsSelected.ts index 8d5c3ca86f..80fe4a61b4 100644 --- a/invokeai/frontend/web/src/features/controlLayers/hooks/useIsEntitySelected.ts +++ b/invokeai/frontend/web/src/features/controlLayers/hooks/useEntityIsSelected.ts @@ -2,7 +2,7 @@ import { useAppSelector } from 'app/store/storeHooks'; import type { CanvasEntityIdentifier } from 'features/controlLayers/store/types'; import { useMemo } from 'react'; -export const useIsEntitySelected = (entityIdentifier: CanvasEntityIdentifier) => { +export const useEntityIsSelected = (entityIdentifier: CanvasEntityIdentifier) => { const selectedEntityIdentifier = useAppSelector((s) => s.canvasV2.selectedEntityIdentifier); const isSelected = useMemo(() => { return selectedEntityIdentifier?.id === entityIdentifier.id;