Center uncap indicator in hovercard
This commit is contained in:
parent
3beeb69c59
commit
d9a7703f2c
4 changed files with 19 additions and 8 deletions
|
|
@ -41,17 +41,14 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: $unit * 2;
|
justify-content: space-between;
|
||||||
|
gap: $unit-2x;
|
||||||
|
|
||||||
.icons {
|
.icons {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-grow: 1;
|
flex-grow: 0;
|
||||||
gap: $unit;
|
gap: $unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.UncapIndicator {
|
|
||||||
min-width: 100px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,7 @@ const HovercardHeader = ({ gridObject, object, type, ...props }: Props) => {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<UncapIndicator
|
<UncapIndicator
|
||||||
|
className="hovercard"
|
||||||
type={type}
|
type={type}
|
||||||
ulb={object.uncap.ulb || false}
|
ulb={object.uncap.ulb || false}
|
||||||
flb={object.uncap.flb || false}
|
flb={object.uncap.flb || false}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
.wrapper {
|
.wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
|
&.hovercard {
|
||||||
|
min-width: 100px;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
.indicator {
|
.indicator {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,9 @@ import TranscendencePopover from '~components/uncap/TranscendencePopover'
|
||||||
import TranscendenceStar from '~components/uncap/TranscendenceStar'
|
import TranscendenceStar from '~components/uncap/TranscendenceStar'
|
||||||
|
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
import classNames from 'classnames'
|
||||||
|
|
||||||
interface Props {
|
interface Props extends React.ComponentProps<'div'> {
|
||||||
type: 'character' | 'weapon' | 'summon'
|
type: 'character' | 'weapon' | 'summon'
|
||||||
rarity?: number
|
rarity?: number
|
||||||
uncapLevel?: number
|
uncapLevel?: number
|
||||||
|
|
@ -25,6 +26,13 @@ const UncapIndicator = (props: Props) => {
|
||||||
|
|
||||||
const [popoverOpen, setPopoverOpen] = useState(false)
|
const [popoverOpen, setPopoverOpen] = useState(false)
|
||||||
|
|
||||||
|
const classes = classNames(
|
||||||
|
{
|
||||||
|
[styles.wrapper]: true,
|
||||||
|
},
|
||||||
|
props.className?.split(' ').map((className) => styles[className])
|
||||||
|
)
|
||||||
|
|
||||||
function setNumStars() {
|
function setNumStars() {
|
||||||
let numStars
|
let numStars
|
||||||
|
|
||||||
|
|
@ -150,7 +158,7 @@ const UncapIndicator = (props: Props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.wrapper}>
|
<div className={classes}>
|
||||||
<ul className={styles.indicator}>
|
<ul className={styles.indicator}>
|
||||||
{Array.from(Array(numStars)).map((x, i) => {
|
{Array.from(Array(numStars)).map((x, i) => {
|
||||||
if (props.type === 'character' && i > 4) {
|
if (props.type === 'character' && i > 4) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue