diff --git a/components/AwakeningSelect/index.tsx b/components/AwakeningSelect/index.tsx index 2debb197..5f7f3b61 100644 --- a/components/AwakeningSelect/index.tsx +++ b/components/AwakeningSelect/index.tsx @@ -8,8 +8,8 @@ import SelectItem from '~components/SelectItem' import classNames from 'classnames' -import { weaponAwakening, characterAwakening } from '~utils/awakening' -import type { Awakening } from '~utils/awakening' +import { weaponAwakening, characterAwakening } from '~data/awakening' +import type { Awakening } from '~data/awakening' import './index.scss' diff --git a/components/AxSelect/index.tsx b/components/AxSelect/index.tsx index 01c9c17e..50ef3156 100644 --- a/components/AxSelect/index.tsx +++ b/components/AxSelect/index.tsx @@ -7,7 +7,7 @@ import SelectItem from '~components/SelectItem' import classNames from 'classnames' -import { axData } from '~utils/axData' +import ax from '~data/ax' import './index.scss' @@ -155,7 +155,7 @@ const AXSelect = (props: Props) => { if (props.currentSkills[0].modifier > -1 && primaryAxValueInput.current) { const modifier = props.currentSkills[0].modifier - const axSkill = axData[props.axType - 1][modifier] + const axSkill = ax[props.axType - 1][modifier] setupInput(axSkill, primaryAxValueInput.current) } } @@ -169,7 +169,7 @@ const AXSelect = (props: Props) => { props.currentSkills[1].modifier != null ) { const firstSkill = props.currentSkills[0] - const primaryAxSkill = axData[props.axType - 1][firstSkill.modifier] + const primaryAxSkill = ax[props.axType - 1][firstSkill.modifier] const secondaryAxSkill = findSecondaryAxSkill( primaryAxSkill, props.currentSkills[1] @@ -185,7 +185,7 @@ const AXSelect = (props: Props) => { } function findSecondaryAxSkill( - axSkill: AxSkill | undefined, + axSkill: ItemSkill | undefined, skillAtIndex: SimpleAxSkill ) { if (axSkill) @@ -213,7 +213,7 @@ const AXSelect = (props: Props) => { } function generateOptions(modifierSet: number) { - const axOptions = axData[props.axType - 1] + const axOptions = ax[props.axType - 1] let axOptionElements: React.ReactNode[] = [] if (modifierSet == 0) { @@ -264,7 +264,7 @@ const AXSelect = (props: Props) => { secondaryAxModifierSelect.current && secondaryAxValueInput.current ) { - setupInput(axData[props.axType - 1][value], primaryAxValueInput.current) + setupInput(ax[props.axType - 1][value], primaryAxValueInput.current) setPrimaryAxValue(0) primaryAxValueInput.current.value = '' @@ -280,7 +280,7 @@ const AXSelect = (props: Props) => { const value = parseInt(rawValue) setSecondaryAxModifier(value) - const primaryAxSkill = axData[props.axType - 1][primaryAxModifier] + const primaryAxSkill = ax[props.axType - 1][primaryAxModifier] const currentAxSkill = primaryAxSkill.secondary ? primaryAxSkill.secondary.find((skill) => skill.id == value) : undefined @@ -304,7 +304,7 @@ const AXSelect = (props: Props) => { } function handlePrimaryErrors(value: number) { - const primaryAxSkill = axData[props.axType - 1][primaryAxModifier] + const primaryAxSkill = ax[props.axType - 1][primaryAxModifier] let newErrors = { ...errors } if (value < primaryAxSkill.minValue) { @@ -333,7 +333,7 @@ const AXSelect = (props: Props) => { } function handleSecondaryErrors(value: number) { - const primaryAxSkill = axData[props.axType - 1][primaryAxModifier] + const primaryAxSkill = ax[props.axType - 1][primaryAxModifier] let newErrors = { ...errors } if (primaryAxSkill.secondary) { @@ -373,7 +373,7 @@ const AXSelect = (props: Props) => { return newErrors.axValue2.length === 0 } - function setupInput(ax: AxSkill | undefined, element: HTMLInputElement) { + function setupInput(ax: ItemSkill | undefined, element: HTMLInputElement) { if (ax) { const rangeString = `${ax.minValue}~${ax.maxValue}${ax.suffix || ''}` diff --git a/components/JobDropdown/index.tsx b/components/JobDropdown/index.tsx index 9e7843ef..d9c9d891 100644 --- a/components/JobDropdown/index.tsx +++ b/components/JobDropdown/index.tsx @@ -8,7 +8,7 @@ import SelectItem from '~components/SelectItem' import SelectGroup from '~components/SelectGroup' import { appState } from '~utils/appState' -import { jobGroups } from '~utils/jobGroups' +import { jobGroups } from '~data/jobGroups' import './index.scss' diff --git a/components/JobSkillResult/index.tsx b/components/JobSkillResult/index.tsx index 66d9333b..508a3684 100644 --- a/components/JobSkillResult/index.tsx +++ b/components/JobSkillResult/index.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react' import { useRouter } from 'next/router' -import { SkillGroup, skillClassification } from '~utils/skillGroups' +import { SkillGroup, skillClassification } from '~data/skillGroups' import './index.scss' diff --git a/components/WeaponHovercard/index.tsx b/components/WeaponHovercard/index.tsx index fa9afe3b..02a373e2 100644 --- a/components/WeaponHovercard/index.tsx +++ b/components/WeaponHovercard/index.tsx @@ -7,7 +7,7 @@ import * as HoverCard from '@radix-ui/react-hover-card' import WeaponLabelIcon from '~components/WeaponLabelIcon' import UncapIndicator from '~components/UncapIndicator' -import { axData } from '~utils/axData' +import ax from '~data/ax' import './index.scss' @@ -80,7 +80,7 @@ const WeaponHovercard = (props: Props) => { } const createPrimaryAxSkillString = () => { - const primaryAxSkills = axData[props.gridWeapon.object.ax_type - 1] + const primaryAxSkills = ax[props.gridWeapon.object.ax_type - 1] if (props.gridWeapon.ax) { const simpleAxSkill = props.gridWeapon.ax[0] @@ -97,7 +97,7 @@ const WeaponHovercard = (props: Props) => { } const createSecondaryAxSkillString = () => { - const primaryAxSkills = axData[props.gridWeapon.object.ax_type - 1] + const primaryAxSkills = ax[props.gridWeapon.object.ax_type - 1] if (props.gridWeapon.ax) { const primarySimpleAxSkill = props.gridWeapon.ax[0] diff --git a/components/WeaponSearchFilterBar/index.tsx b/components/WeaponSearchFilterBar/index.tsx index dd7fdba1..3839d7e1 100644 --- a/components/WeaponSearchFilterBar/index.tsx +++ b/components/WeaponSearchFilterBar/index.tsx @@ -16,7 +16,7 @@ import { emptyWeaponSeriesState, } from '~utils/emptyStates' import { elements, proficiencies, rarities } from '~utils/stateValues' -import { weaponSeries } from '~utils/weaponSeries' +import { weaponSeries } from '~data/weaponSeries' interface Props { sendFilters: (filters: { [key: string]: number[] }) => void diff --git a/components/WeaponUnit/index.tsx b/components/WeaponUnit/index.tsx index 58cfd80b..aed4b0d6 100644 --- a/components/WeaponUnit/index.tsx +++ b/components/WeaponUnit/index.tsx @@ -11,8 +11,8 @@ import Button from '~components/Button' import type { SearchableObject } from '~types' -import { axData } from '~utils/axData' -import { weaponAwakening } from '~utils/awakening' +import ax from '~data/ax' +import { weaponAwakening } from '~data/awakening' import PlusIcon from '~public/icons/Add.svg' import SettingsIcon from '~public/icons/Settings.svg' @@ -330,7 +330,7 @@ const WeaponUnit = (props: Props) => { props.gridWeapon.object.ax_type > 0 && props.gridWeapon.ax ) { - const axOptions = axData[props.gridWeapon.object.ax_type - 1] + const axOptions = ax[props.gridWeapon.object.ax_type - 1] const weaponAxSkill: SimpleAxSkill = props.gridWeapon.ax[0] let axSkill = axOptions.find((ax) => ax.id === weaponAxSkill.modifier) diff --git a/utils/awakening.tsx b/data/awakening.tsx similarity index 100% rename from utils/awakening.tsx rename to data/awakening.tsx diff --git a/utils/axData.tsx b/data/ax.tsx similarity index 99% rename from utils/axData.tsx rename to data/ax.tsx index 5feb0dec..4fc94ed3 100644 --- a/utils/axData.tsx +++ b/data/ax.tsx @@ -1,4 +1,4 @@ -export const axData: AxSkill[][] = [ +const ax: ItemSkill[][] = [ [ { name: { @@ -868,3 +868,5 @@ export const axData: AxSkill[][] = [ }, ], ] + +export default ax diff --git a/utils/Element.tsx b/data/elements.tsx similarity index 100% rename from utils/Element.tsx rename to data/elements.tsx diff --git a/utils/jobGroups.tsx b/data/jobGroups.tsx similarity index 100% rename from utils/jobGroups.tsx rename to data/jobGroups.tsx diff --git a/utils/raidGroups.tsx b/data/raidGroups.tsx similarity index 100% rename from utils/raidGroups.tsx rename to data/raidGroups.tsx diff --git a/utils/skillGroups.tsx b/data/skillGroups.tsx similarity index 100% rename from utils/skillGroups.tsx rename to data/skillGroups.tsx diff --git a/utils/weaponKeyGroups.tsx b/data/weaponKeyGroups.tsx similarity index 100% rename from utils/weaponKeyGroups.tsx rename to data/weaponKeyGroups.tsx diff --git a/utils/weaponSeries.tsx b/data/weaponSeries.tsx similarity index 100% rename from utils/weaponSeries.tsx rename to data/weaponSeries.tsx diff --git a/pages/[username].tsx b/pages/[username].tsx index 99a347d7..6cd090a1 100644 --- a/pages/[username].tsx +++ b/pages/[username].tsx @@ -13,7 +13,7 @@ import setUserToken from '~utils/setUserToken' import extractFilters from '~utils/extractFilters' import organizeRaids from '~utils/organizeRaids' import useDidMountEffect from '~utils/useDidMountEffect' -import { elements, allElement } from '~utils/Element' +import { elements, allElement } from '~data/elements' import { emptyPaginationObject } from '~utils/emptyStates' import GridRep from '~components/GridRep' diff --git a/pages/saved.tsx b/pages/saved.tsx index 93b7e16b..68ce09dd 100644 --- a/pages/saved.tsx +++ b/pages/saved.tsx @@ -14,7 +14,7 @@ import setUserToken from '~utils/setUserToken' import extractFilters from '~utils/extractFilters' import organizeRaids from '~utils/organizeRaids' import useDidMountEffect from '~utils/useDidMountEffect' -import { elements, allElement } from '~utils/Element' +import { elements, allElement } from '~data/elements' import { emptyPaginationObject } from '~utils/emptyStates' import GridRep from '~components/GridRep' diff --git a/pages/teams.tsx b/pages/teams.tsx index 41cc17b4..a75f7ad8 100644 --- a/pages/teams.tsx +++ b/pages/teams.tsx @@ -14,7 +14,7 @@ import setUserToken from '~utils/setUserToken' import extractFilters from '~utils/extractFilters' import organizeRaids from '~utils/organizeRaids' import useDidMountEffect from '~utils/useDidMountEffect' -import { elements, allElement } from '~utils/Element' +import { elements, allElement } from '~data/elements' import { emptyPaginationObject } from '~utils/emptyStates' import GridRep from '~components/GridRep' diff --git a/utils/extractFilters.tsx b/utils/extractFilters.tsx index efcba098..28f90fdf 100644 --- a/utils/extractFilters.tsx +++ b/utils/extractFilters.tsx @@ -1,4 +1,4 @@ -import { elements, allElement } from '~utils/Element' +import { elements, allElement } from '~data/elements' export default (query: { [index: string]: string }, raids: Raid[]) => { // Extract recency filter diff --git a/utils/groupWeaponKeys.tsx b/utils/groupWeaponKeys.tsx index 763bd359..c1ad639c 100644 --- a/utils/groupWeaponKeys.tsx +++ b/utils/groupWeaponKeys.tsx @@ -1,4 +1,4 @@ -import { weaponKeyGroups } from './weaponKeyGroups' +import { weaponKeyGroups } from '../data/weaponKeyGroups' export type GroupedWeaponKeys = { [key: string]: WeaponKey[] diff --git a/utils/mapWeaponSeries.tsx b/utils/mapWeaponSeries.tsx index 9bc63448..56980b12 100644 --- a/utils/mapWeaponSeries.tsx +++ b/utils/mapWeaponSeries.tsx @@ -1,4 +1,4 @@ -import { weaponSeries } from '~utils/weaponSeries' +import { weaponSeries } from '~data/weaponSeries' export default (id: number) => weaponSeries.find((series) => series.id === id)?.slug