Add Empty class to weapons when unit is unfilled
This commit is contained in:
parent
c152436df3
commit
a60630cdf1
2 changed files with 8 additions and 3 deletions
|
|
@ -49,7 +49,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
li {
|
li:not(.Empty) {
|
||||||
aspect-ratio: 1 / 1.035;
|
// aspect-ratio: 1 / 1.035;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { useTranslation } from 'next-i18next'
|
||||||
|
|
||||||
import { AxiosError, AxiosResponse } from 'axios'
|
import { AxiosError, AxiosResponse } from 'axios'
|
||||||
import debounce from 'lodash.debounce'
|
import debounce from 'lodash.debounce'
|
||||||
|
import classNames from 'classnames'
|
||||||
|
|
||||||
import Alert from '~components/common/Alert'
|
import Alert from '~components/common/Alert'
|
||||||
import WeaponUnit from '~components/weapon/WeaponUnit'
|
import WeaponUnit from '~components/weapon/WeaponUnit'
|
||||||
|
|
@ -333,8 +334,12 @@ const WeaponGrid = (props: Props) => {
|
||||||
)
|
)
|
||||||
|
|
||||||
const weaponGridElement = Array.from(Array(numWeapons)).map((x, i) => {
|
const weaponGridElement = Array.from(Array(numWeapons)).map((x, i) => {
|
||||||
|
const itemClasses = classNames({
|
||||||
|
Empty: appState.grid.weapons.allWeapons[i] === undefined,
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li key={`grid_unit_${i}`}>
|
<li className={itemClasses} key={`grid_unit_${i}`}>
|
||||||
<WeaponUnit
|
<WeaponUnit
|
||||||
gridWeapon={appState.grid.weapons.allWeapons[i]}
|
gridWeapon={appState.grid.weapons.allWeapons[i]}
|
||||||
editable={props.editable}
|
editable={props.editable}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue