Fix placeholders in SummonUnit

This commit is contained in:
Justin Edmund 2023-06-30 22:17:56 -07:00
parent bb81a54055
commit 4f6925b824
2 changed files with 26 additions and 9 deletions

View file

@ -26,7 +26,7 @@
min-height: 15.9vw; min-height: 15.9vw;
} }
.image { .content {
list-style-type: none; list-style-type: none;
width: 100%; width: 100%;
} }
@ -36,19 +36,35 @@
margin-right: 0; margin-right: 0;
} }
&.main.editable .image:hover, &.main.editable .content:hover,
&.friend.editable .image:hover { &.friend.editable .content:hover {
transform: $scale-tall; transform: $scale-tall;
} }
&.editable .image:hover { &.editable .content:hover {
border: $hover-stroke; border: $hover-stroke;
box-shadow: $hover-shadow; box-shadow: $hover-shadow;
cursor: pointer; cursor: pointer;
transform: $scale-wide; transform: $scale-wide;
} }
.image { &.subaura {
min-height: 0;
.content {
background: var(--subaura-orange-card-bg);
&:hover .icon svg {
fill: var(--subaura-orange-primary);
}
.icon svg {
fill: var(--subaura-orange-secondary);
}
}
}
.content {
background: var(--card-bg); background: var(--card-bg);
border: 1px solid rgba(0, 0, 0, 0); border: 1px solid rgba(0, 0, 0, 0);
border-radius: $unit; border-radius: $unit;
@ -108,7 +124,7 @@
width: 100%; width: 100%;
z-index: 2; z-index: 2;
&.Placeholder { &.placeholder {
opacity: 0; opacity: 0;
} }
} }

View file

@ -67,6 +67,7 @@ const SummonUnit = ({
[styles.main]: unitType == 0, [styles.main]: unitType == 0,
[styles.grid]: unitType == 1, [styles.grid]: unitType == 1,
[styles.friend]: unitType == 2, [styles.friend]: unitType == 2,
[styles.subaura]: position == 4 || position == 5,
[styles.editable]: editable, [styles.editable]: editable,
[styles.filled]: gridSummon !== undefined, [styles.filled]: gridSummon !== undefined,
}) })
@ -284,15 +285,15 @@ const SummonUnit = ({
<img <img
alt={summon?.name[locale]} alt={summon?.name[locale]}
className={classNames({ className={classNames({
GridImage: true, [styles.image]: true,
Placeholder: imageUrl === '', [styles.placeholder]: imageUrl === '',
})} })}
src={imageUrl !== '' ? imageUrl : placeholderImageUrl()} src={imageUrl !== '' ? imageUrl : placeholderImageUrl()}
/> />
) )
const content = ( const content = (
<div className={styles.image} onClick={openSearchModal}> <div className={styles.content} onClick={openSearchModal}>
{image} {image}
{editable ? ( {editable ? (
<span className={styles.icon}> <span className={styles.icon}>