fix: migrate from selectors in database slide to basic capability selectors

This commit is contained in:
Lukas Obermann
2024-01-10 19:29:49 +01:00
parent 32d71c8323
commit 94743570aa
9 changed files with 18 additions and 18 deletions
@@ -9,8 +9,8 @@ import { SpellsSortOrder } from "../../../../../shared/domain/sortOrders.ts"
import { useTranslate } from "../../../../../shared/hooks/translate.ts"
import { useTranslateMap } from "../../../../../shared/hooks/translateMap.ts"
import { useAppDispatch, useAppSelector } from "../../../../hooks/redux.ts"
import { SelectGetById } from "../../../../selectors/basicCapabilitySelectors.ts"
import { selectCanRemove } from "../../../../selectors/characterSelectors.ts"
import { selectGetProperty } from "../../../../slices/databaseSlice.ts"
import {
changeInlineLibraryEntry,
selectInlineLibraryEntryId,
@@ -41,7 +41,7 @@ const ActiveCantripsListItem: FC<Props> = props => {
const dispatch = useAppDispatch()
const inlineLibraryEntryId = useAppSelector(selectInlineLibraryEntryId)
const canRemove = useAppSelector(selectCanRemove)
const getProperty = useAppSelector(selectGetProperty)
const getProperty = useAppSelector(SelectGetById.Static.Property)
const { name = "" } = translateMap(translations) ?? {}
@@ -12,8 +12,8 @@ import { SpellsSortOrder } from "../../../../../shared/domain/sortOrders.ts"
import { useTranslateMap } from "../../../../../shared/hooks/translateMap.ts"
import { deepEqual } from "../../../../../shared/utils/compare.ts"
import { useAppDispatch, useAppSelector } from "../../../../hooks/redux.ts"
import { SelectGetById } from "../../../../selectors/basicCapabilitySelectors.ts"
import { selectCanRemove } from "../../../../selectors/characterSelectors.ts"
import { selectGetProperty } from "../../../../slices/databaseSlice.ts"
import {
changeInlineLibraryEntry,
selectInlineLibraryEntryId,
@@ -78,7 +78,7 @@ export const ActiveMagicalActionsListItem = <T extends DisplayedActiveMagicalAct
const dispatch = useAppDispatch()
const inlineLibraryEntryId = useAppSelector(selectInlineLibraryEntryId)
const canRemove = useAppSelector(selectCanRemove)
const getProperty = useAppSelector(selectGetProperty)
const getProperty = useAppSelector(SelectGetById.Static.Property)
const { name = "" } = translateMap(translations) ?? {}
@@ -10,8 +10,8 @@ import { SpellsSortOrder } from "../../../../../shared/domain/sortOrders.ts"
import { useTranslate } from "../../../../../shared/hooks/translate.ts"
import { useTranslateMap } from "../../../../../shared/hooks/translateMap.ts"
import { useAppDispatch, useAppSelector } from "../../../../hooks/redux.ts"
import { SelectGetById } from "../../../../selectors/basicCapabilitySelectors.ts"
import { selectCanRemove } from "../../../../selectors/characterSelectors.ts"
import { selectGetProperty } from "../../../../slices/databaseSlice.ts"
import {
changeInlineLibraryEntry,
selectInlineLibraryEntryId,
@@ -52,7 +52,7 @@ const ActiveRitualsListItem: FC<Props> = props => {
const dispatch = useAppDispatch()
const inlineLibraryEntryId = useAppSelector(selectInlineLibraryEntryId)
const canRemove = useAppSelector(selectCanRemove)
const getProperty = useAppSelector(selectGetProperty)
const getProperty = useAppSelector(SelectGetById.Static.Property)
const { name = "" } = translateMap(translations) ?? {}
@@ -10,8 +10,8 @@ import { SpellsSortOrder } from "../../../../../shared/domain/sortOrders.ts"
import { useTranslate } from "../../../../../shared/hooks/translate.ts"
import { useTranslateMap } from "../../../../../shared/hooks/translateMap.ts"
import { useAppDispatch, useAppSelector } from "../../../../hooks/redux.ts"
import { SelectGetById } from "../../../../selectors/basicCapabilitySelectors.ts"
import { selectCanRemove } from "../../../../selectors/characterSelectors.ts"
import { selectGetProperty } from "../../../../slices/databaseSlice.ts"
import {
changeInlineLibraryEntry,
selectInlineLibraryEntryId,
@@ -52,7 +52,7 @@ const ActiveSpellsListItem: FC<Props> = props => {
const dispatch = useAppDispatch()
const inlineLibraryEntryId = useAppSelector(selectInlineLibraryEntryId)
const canRemove = useAppSelector(selectCanRemove)
const getProperty = useAppSelector(selectGetProperty)
const getProperty = useAppSelector(SelectGetById.Static.Property)
const { name = "" } = translateMap(translations) ?? {}
@@ -9,7 +9,7 @@ import { SpellsSortOrder } from "../../../../../shared/domain/sortOrders.ts"
import { useTranslate } from "../../../../../shared/hooks/translate.ts"
import { useTranslateMap } from "../../../../../shared/hooks/translateMap.ts"
import { useAppDispatch, useAppSelector } from "../../../../hooks/redux.ts"
import { selectGetProperty } from "../../../../slices/databaseSlice.ts"
import { SelectGetById } from "../../../../selectors/basicCapabilitySelectors.ts"
import {
changeInlineLibraryEntry,
selectInlineLibraryEntryId,
@@ -39,7 +39,7 @@ const InactiveCantripsListItem: FC<Props> = props => {
const translateMap = useTranslateMap()
const dispatch = useAppDispatch()
const inlineLibraryEntryId = useAppSelector(selectInlineLibraryEntryId)
const getProperty = useAppSelector(selectGetProperty)
const getProperty = useAppSelector(SelectGetById.Static.Property)
const { name = "" } = translateMap(translations) ?? {}
@@ -12,7 +12,7 @@ import { SpellsSortOrder } from "../../../../../shared/domain/sortOrders.ts"
import { useTranslateMap } from "../../../../../shared/hooks/translateMap.ts"
import { deepEqual } from "../../../../../shared/utils/compare.ts"
import { useAppDispatch, useAppSelector } from "../../../../hooks/redux.ts"
import { selectGetProperty } from "../../../../slices/databaseSlice.ts"
import { SelectGetById } from "../../../../selectors/basicCapabilitySelectors.ts"
import {
changeInlineLibraryEntry,
selectInlineLibraryEntryId,
@@ -69,7 +69,7 @@ export const InactiveMagicalActionsListItem = <T extends DisplayedInactiveMagica
const translateMap = useTranslateMap()
const dispatch = useAppDispatch()
const inlineLibraryEntryId = useAppSelector(selectInlineLibraryEntryId)
const getProperty = useAppSelector(selectGetProperty)
const getProperty = useAppSelector(SelectGetById.Static.Property)
const { name = "" } = translateMap(translations) ?? {}
const identifierObject = useMemo(() => createIdentifierObject(kind, id), [kind, id])
@@ -10,7 +10,7 @@ import { SpellsSortOrder } from "../../../../../shared/domain/sortOrders.ts"
import { useTranslate } from "../../../../../shared/hooks/translate.ts"
import { useTranslateMap } from "../../../../../shared/hooks/translateMap.ts"
import { useAppDispatch, useAppSelector } from "../../../../hooks/redux.ts"
import { selectGetProperty } from "../../../../slices/databaseSlice.ts"
import { SelectGetById } from "../../../../selectors/basicCapabilitySelectors.ts"
import {
changeInlineLibraryEntry,
selectInlineLibraryEntryId,
@@ -43,7 +43,7 @@ const InactiveRitualsListItem: FC<Props> = props => {
const translateMap = useTranslateMap()
const dispatch = useAppDispatch()
const inlineLibraryEntryId = useAppSelector(selectInlineLibraryEntryId)
const getProperty = useAppSelector(selectGetProperty)
const getProperty = useAppSelector(SelectGetById.Static.Property)
const { name = "" } = translateMap(translations) ?? {}
@@ -10,7 +10,7 @@ import { SpellsSortOrder } from "../../../../../shared/domain/sortOrders.ts"
import { useTranslate } from "../../../../../shared/hooks/translate.ts"
import { useTranslateMap } from "../../../../../shared/hooks/translateMap.ts"
import { useAppDispatch, useAppSelector } from "../../../../hooks/redux.ts"
import { selectGetProperty } from "../../../../slices/databaseSlice.ts"
import { SelectGetById } from "../../../../selectors/basicCapabilitySelectors.ts"
import {
changeInlineLibraryEntry,
selectInlineLibraryEntryId,
@@ -43,7 +43,7 @@ const InactiveSpellsListItem: FC<Props> = props => {
const translateMap = useTranslateMap()
const dispatch = useAppDispatch()
const inlineLibraryEntryId = useAppSelector(selectInlineLibraryEntryId)
const getProperty = useAppSelector(selectGetProperty)
const getProperty = useAppSelector(SelectGetById.Static.Property)
const { name = "" } = translateMap(translations) ?? {}
@@ -23,13 +23,13 @@ import { assertExhaustive } from "../../../../../shared/utils/typeSafety.ts"
import { useModalState } from "../../../../hooks/modalState.ts"
import { useAppDispatch, useAppSelector } from "../../../../hooks/redux.ts"
import { InlineLibrary } from "../../../../inlineLibrary/InlineLibrary.tsx"
import { SelectGetById } from "../../../../selectors/basicCapabilitySelectors.ts"
import { selectCanRemove } from "../../../../selectors/characterSelectors.ts"
import {
selectVisibleActiveSpellworks,
selectVisibleInactiveSpellworks,
} from "../../../../selectors/spellSelectors.ts"
import { addCantrip, removeCantrip } from "../../../../slices/cantripsSlice.ts"
import { selectGetProperty } from "../../../../slices/databaseSlice.ts"
import {
addAnimistPower,
decrementAnimistPower,
@@ -138,7 +138,7 @@ export const Spells: FC = () => {
const localeCompare = useLocaleCompare()
const canRemove = useAppSelector(selectCanRemove)
const getProperty = useAppSelector(selectGetProperty)
const getProperty = useAppSelector(SelectGetById.Static.Property)
const [activeFilterText, setActiveFilterText] = useState("")
const [inactiveFilterText, setInactiveFilterText] = useState("")