Skip to content

Commit

Permalink
refactor: colocating gem file
Browse files Browse the repository at this point in the history
  • Loading branch information
xandjiji committed Apr 5, 2024
1 parent d548f33 commit c4a1608
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.

This file was deleted.

@@ -1,16 +1,30 @@
import { useMemo } from 'react'
import { vocation } from 'data-dictionary/dist/dictionaries/vocations'
import { vocationGemOptions } from './gemOptions'

import { greaterGems } from 'data-dictionary/dist/dictionaries/gems'

const buildOption = (value: string): Option => ({ name: value, value })

const allOptions = [
...new Set([
...vocationGemOptions.rook,
...vocationGemOptions.knight,
...vocationGemOptions.paladin,
...vocationGemOptions.sorcerer,
...vocationGemOptions.druid,
greaterGems.knight['+1.5% Critical Extra Damage'],
greaterGems.knight['+0.25% Dodge'],
greaterGems.knight['+1.2% Life Leech'],
greaterGems.knight['+0.4% Mana Leech'],
...Object.keys(greaterGems.knight),
...Object.keys(greaterGems.paladin),
...Object.keys(greaterGems.sorcerer),
...Object.keys(greaterGems.druid),
]),
]
].map(buildOption)

export const vocationGemOptions = {
rook: [],
knight: Object.keys(greaterGems.knight).map(buildOption),
sorcerer: Object.keys(greaterGems.sorcerer).map(buildOption),
druid: Object.keys(greaterGems.druid).map(buildOption),
paladin: Object.keys(greaterGems.paladin).map(buildOption),
}

export const useGemOptions = (vocationSet: FilterOptions['vocation']) =>
useMemo(() => {
Expand Down

0 comments on commit c4a1608

Please sign in to comment.