Fix GridReps
This commit is contained in:
parent
1a0e99b5b7
commit
3872513a6f
2 changed files with 30 additions and 17 deletions
|
|
@ -33,6 +33,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.GridRep .grid_weapon {
|
.GridRep .grid_weapon {
|
||||||
|
background: white;
|
||||||
|
border-radius: 4px;
|
||||||
float: left;
|
float: left;
|
||||||
margin: 0 8px 8px 0;
|
margin: 0 8px 8px 0;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
|
@ -43,9 +45,9 @@
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.GridRep .weapon img[src*="jpg"] {
|
.GridRep .grid_mainhand img[src*="jpg"],
|
||||||
|
.GridRep .grid_weapon img[src*="jpg"] {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
@ -38,28 +38,39 @@ const GridRep = (props: Props) => {
|
||||||
props.onClick(props.shortcode)
|
props.onClick(props.shortcode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function generateMainhandImage() {
|
||||||
|
return (mainhand)
|
||||||
|
? <img src={
|
||||||
|
process.env.NODE_ENV === 'development'
|
||||||
|
? mainhandImages[mainhand?.granblue_id || 0]
|
||||||
|
: `${process.env.SIERO_IMG_URL}/mainhand/${mainhand?.granblue_id}.jpg`
|
||||||
|
} />
|
||||||
|
: <img />
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateGridImage(position: number) {
|
||||||
|
return (weapons[position])
|
||||||
|
? <img src={
|
||||||
|
process.env.NODE_ENV === 'development'
|
||||||
|
? gridImages[weapons[position]?.granblue_id || 0]
|
||||||
|
: `${process.env.SIERO_IMG_URL}/grid/${weapons[position]?.granblue_id}.jpg`
|
||||||
|
} />
|
||||||
|
: <img />
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="GridRep" onClick={navigate}>
|
<div className="GridRep" onClick={navigate}>
|
||||||
<div className="weapon grid_mainhand">
|
<div className="weapon grid_mainhand">
|
||||||
<img src={
|
{generateMainhandImage()}
|
||||||
process.env.NODE_ENV === 'development'
|
|
||||||
? mainhandImages[mainhand?.granblue_id || 0]
|
|
||||||
: `${process.env.SIERO_IMG_URL}/mainhand/${mainhand?.granblue_id}.jpg`
|
|
||||||
} />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul className="grid_weapons">
|
<ul className="grid_weapons">
|
||||||
{
|
{
|
||||||
Array.from(Array(numWeapons)).map((x, i) => {
|
Array.from(Array(numWeapons)).map((x, i) => {
|
||||||
console.log()
|
|
||||||
return (
|
return (
|
||||||
<li className="weapon grid_weapon" key={`grid_unit_${i}`}>
|
<div className="grid_weapon">
|
||||||
<img src={
|
{generateGridImage(i)}
|
||||||
process.env.NODE_ENV === 'development'
|
</div>
|
||||||
? gridImages[weapons[i]?.granblue_id || 0]
|
|
||||||
: `${process.env.SIERO_IMG_URL}/grid/${weapons[i]?.granblue_id}.jpg`
|
|
||||||
} />
|
|
||||||
</li>
|
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue