Add new dependencies

This commit is contained in:
Justin Edmund 2023-01-19 07:30:20 -08:00
parent 07ce2d9cf5
commit 094ae4d7f9

View file

@ -1,8 +1,9 @@
// Core dependencies // Core dependencies
import React, { useEffect, useState } from 'react' import React, { useCallback, useEffect, useState } from 'react'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import { useTranslation } from 'next-i18next' import { useTranslation } from 'next-i18next'
import { AxiosResponse } from 'axios' import { AxiosResponse } from 'axios'
import classNames from 'classnames'
// UI dependencies // UI dependencies
import { import {
@ -143,10 +144,45 @@ const CharacterModal = ({
strength: overMastery[3].strength, strength: overMastery[3].strength,
}, },
4: { 4: {
modifier: overMastery[4].modifier, if (overMastery[1]) {
strength: overMastery[4].strength, setRings({
}, ...rings,
}) 1: {
modifier: 1,
strength: overMastery[1].strength,
},
})
}
if (overMastery[2]) {
setRings({
...rings,
2: {
modifier: 2,
strength: overMastery[1].strength,
},
})
}
if (overMastery[3]) {
setRings({
...rings,
3: {
modifier: overMastery[3].modifier,
strength: overMastery[3].strength,
},
})
}
if (overMastery[4]) {
setRings({
...rings,
4: {
modifier: overMastery[4].modifier,
strength: overMastery[4].strength,
},
})
}
} }
function receiveEarringValues( function receiveEarringValues(
@ -176,10 +212,11 @@ const CharacterModal = ({
// Prepare the GridWeaponObject to send to the server // Prepare the GridWeaponObject to send to the server
function prepareObject() { function prepareObject() {
console.log('Rings:')
console.log(rings)
let object: GridCharacterObject = { let object: GridCharacterObject = {
character: { character: {
ring_modifier1: rings[1].modifier,
ring_modifier2: rings[2].modifier,
ring_modifier3: rings[3].modifier, ring_modifier3: rings[3].modifier,
ring_modifier4: rings[4].modifier, ring_modifier4: rings[4].modifier,
ring_strength1: rings[1].strength, ring_strength1: rings[1].strength,