Add weapon awakenings to hovercard
This commit is contained in:
parent
7e7d89b01d
commit
d9ed728276
3 changed files with 53 additions and 2 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding-right: $unit * 2;
|
padding-right: $unit-2x;
|
||||||
|
|
||||||
.axSkill {
|
.axSkill {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -36,6 +36,26 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-size: $normal;
|
font-size: $normal;
|
||||||
gap: calc($unit / 2);
|
gap: $unit-half;
|
||||||
|
}
|
||||||
|
|
||||||
|
.awakening {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: $unit-half;
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
gap: $unit-half;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: $unit-4x;
|
||||||
|
}
|
||||||
|
|
||||||
|
strong {
|
||||||
|
font-weight: $bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import WeaponLabelIcon from '~components/WeaponLabelIcon'
|
||||||
import UncapIndicator from '~components/UncapIndicator'
|
import UncapIndicator from '~components/UncapIndicator'
|
||||||
|
|
||||||
import ax from '~data/ax'
|
import ax from '~data/ax'
|
||||||
|
import { weaponAwakening } from '~data/awakening'
|
||||||
|
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|
||||||
|
|
@ -135,6 +136,33 @@ const WeaponHovercard = (props: Props) => {
|
||||||
return `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${weapon.granblue_id}.jpg`
|
return `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${weapon.granblue_id}.jpg`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const awakeningSection = () => {
|
||||||
|
const gridAwakening = props.gridWeapon.awakening
|
||||||
|
const awakening = weaponAwakening.find(
|
||||||
|
(awakening) => awakening.id === gridAwakening?.type
|
||||||
|
)
|
||||||
|
|
||||||
|
if (gridAwakening && awakening) {
|
||||||
|
return (
|
||||||
|
<section className="awakening">
|
||||||
|
<h5 className={tintElement}>
|
||||||
|
{t('modals.weapon.subtitles.awakening')}
|
||||||
|
</h5>
|
||||||
|
<div>
|
||||||
|
<img
|
||||||
|
alt={awakening.name[locale]}
|
||||||
|
src={`${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/awakening/weapon_${gridAwakening.type}.png`}
|
||||||
|
/>
|
||||||
|
<span>
|
||||||
|
<strong>{`${awakening.name[locale]}`}</strong>
|
||||||
|
{`Lv${gridAwakening.level}`}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const keysSection = (
|
const keysSection = (
|
||||||
<section className="weaponKeys">
|
<section className="weaponKeys">
|
||||||
{WeaponKeyNames[props.gridWeapon.object.series] ? (
|
{WeaponKeyNames[props.gridWeapon.object.series] ? (
|
||||||
|
|
@ -243,9 +271,11 @@ const WeaponHovercard = (props: Props) => {
|
||||||
props.gridWeapon.ax[0].strength
|
props.gridWeapon.ax[0].strength
|
||||||
? axSection
|
? axSection
|
||||||
: ''}
|
: ''}
|
||||||
|
{awakeningSection()}
|
||||||
{props.gridWeapon.weapon_keys && props.gridWeapon.weapon_keys.length > 0
|
{props.gridWeapon.weapon_keys && props.gridWeapon.weapon_keys.length > 0
|
||||||
? keysSection
|
? keysSection
|
||||||
: ''}
|
: ''}
|
||||||
|
|
||||||
<a className={`Button ${tintElement}`} href={wikiUrl} target="_new">
|
<a className={`Button ${tintElement}`} href={wikiUrl} target="_new">
|
||||||
{t('buttons.wiki')}
|
{t('buttons.wiki')}
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,7 @@ const WeaponModal = ({
|
||||||
if (gridWeapon.mainhand) appState.grid.weapons.mainWeapon = gridWeapon
|
if (gridWeapon.mainhand) appState.grid.weapons.mainWeapon = gridWeapon
|
||||||
else appState.grid.weapons.allWeapons[gridWeapon.position] = gridWeapon
|
else appState.grid.weapons.allWeapons[gridWeapon.position] = gridWeapon
|
||||||
|
|
||||||
|
if (onOpenChange) onOpenChange(false)
|
||||||
setOpen(false)
|
setOpen(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue