Fix search result item styles
This commit is contained in:
parent
c0490290d8
commit
05af1ac6aa
8 changed files with 32 additions and 26 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
.CharacterResult {
|
.result {
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: $unit;
|
gap: $unit;
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
background: var(--button-contained-bg);
|
background: var(--button-contained-bg);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
.Info h5 {
|
.info h5 {
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
width: 120px;
|
width: 120px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Info {
|
.info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@ const CharacterResult = (props: Props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li className="CharacterResult" onClick={props.onClick}>
|
<li className={styles.result} onClick={props.onClick}>
|
||||||
<img alt={character.name[locale]} src={characterUrl()} />
|
<img alt={character.name[locale]} src={characterUrl()} />
|
||||||
<div className="Info">
|
<div className={styles.info}>
|
||||||
<h5>{character.name[locale]}</h5>
|
<h5>{character.name[locale]}</h5>
|
||||||
<UncapIndicator
|
<UncapIndicator
|
||||||
type="character"
|
type="character"
|
||||||
|
|
@ -41,7 +41,7 @@ const CharacterResult = (props: Props) => {
|
||||||
ulb={character.uncap.ulb}
|
ulb={character.uncap.ulb}
|
||||||
special={character.special}
|
special={character.special}
|
||||||
/>
|
/>
|
||||||
<div className="tags">
|
<div className={styles.tags}>
|
||||||
<WeaponLabelIcon labelType={Element[character.element]} />
|
<WeaponLabelIcon labelType={Element[character.element]} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
.JobSkillResult {
|
.result {
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: $unit;
|
gap: $unit;
|
||||||
|
|
@ -9,12 +9,12 @@
|
||||||
background: var(--button-contained-bg);
|
background: var(--button-contained-bg);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
.Info h5 {
|
.info h5 {
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.Info {
|
.info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: $unit-half;
|
gap: $unit-half;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
|
import classNames from 'classnames'
|
||||||
import { SkillGroup, skillClassification } from '~data/skillGroups'
|
import { SkillGroup, skillClassification } from '~data/skillGroups'
|
||||||
|
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
|
@ -22,17 +23,21 @@ const JobSkillResult = (props: Props) => {
|
||||||
setGroup(skillClassification.find((group) => group.id === skill.color))
|
setGroup(skillClassification.find((group) => group.id === skill.color))
|
||||||
}, [skill, setGroup, skillClassification])
|
}, [skill, setGroup, skillClassification])
|
||||||
|
|
||||||
|
const classes = classNames({
|
||||||
|
[styles.skill]: true,
|
||||||
|
[styles.pill]: true,
|
||||||
|
[styles[`${group?.name['en'].toLowerCase()}`]]: true,
|
||||||
|
})
|
||||||
|
|
||||||
const jobSkillUrl = () =>
|
const jobSkillUrl = () =>
|
||||||
`${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/job-skills/${skill.slug}.png`
|
`${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/job-skills/${skill.slug}.png`
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li className="JobSkillResult" onClick={props.onClick}>
|
<li className={styles.result} onClick={props.onClick}>
|
||||||
<img alt={skill.name[locale]} src={jobSkillUrl()} />
|
<img alt={skill.name[locale]} src={jobSkillUrl()} />
|
||||||
<div className="Info">
|
<div className={styles.info}>
|
||||||
<h5>{skill.name[locale]}</h5>
|
<h5>{skill.name[locale]}</h5>
|
||||||
<div className={`skill pill ${group?.name['en'].toLowerCase()}`}>
|
<div className={classes}>{group?.name[locale]}</div>
|
||||||
{group?.name[locale]}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
.SummonResult {
|
.result {
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: $unit;
|
gap: $unit;
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
background: var(--button-contained-bg);
|
background: var(--button-contained-bg);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
.Info h5 {
|
.info h5 {
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
width: 120px;
|
width: 120px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Info {
|
.info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,12 @@ const SummonResult = (props: Props) => {
|
||||||
const summon = props.data
|
const summon = props.data
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li className="SummonResult" onClick={props.onClick}>
|
<li className={styles.result} onClick={props.onClick}>
|
||||||
<img
|
<img
|
||||||
alt={summon.name[locale]}
|
alt={summon.name[locale]}
|
||||||
src={`${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/summon-grid/${summon.granblue_id}.jpg`}
|
src={`${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/summon-grid/${summon.granblue_id}.jpg`}
|
||||||
/>
|
/>
|
||||||
<div className="Info">
|
<div className={styles.info}>
|
||||||
<h5>{summon.name[locale]}</h5>
|
<h5>{summon.name[locale]}</h5>
|
||||||
<UncapIndicator
|
<UncapIndicator
|
||||||
type="summon"
|
type="summon"
|
||||||
|
|
@ -34,7 +34,7 @@ const SummonResult = (props: Props) => {
|
||||||
ulb={summon.uncap.ulb}
|
ulb={summon.uncap.ulb}
|
||||||
special={false}
|
special={false}
|
||||||
/>
|
/>
|
||||||
<div className="tags">
|
<div className={styles.tags}>
|
||||||
<WeaponLabelIcon labelType={Element[summon.element]} />
|
<WeaponLabelIcon labelType={Element[summon.element]} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
.WeaponResult {
|
.result {
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: $unit;
|
gap: $unit;
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
background: var(--button-contained-bg);
|
background: var(--button-contained-bg);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
.Info h5 {
|
.info h5 {
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
width: 120px;
|
width: 120px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Info {
|
.info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: $font-medium;
|
font-size: $font-medium;
|
||||||
font-weight: $medium;
|
font-weight: $medium;
|
||||||
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.UncapIndicator {
|
.UncapIndicator {
|
||||||
|
|
|
||||||
|
|
@ -33,12 +33,12 @@ const WeaponResult = (props: Props) => {
|
||||||
const weapon = props.data
|
const weapon = props.data
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li className="WeaponResult" onClick={props.onClick}>
|
<li className={styles.result} onClick={props.onClick}>
|
||||||
<img
|
<img
|
||||||
alt={weapon.name[locale]}
|
alt={weapon.name[locale]}
|
||||||
src={`${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${weapon.granblue_id}.jpg`}
|
src={`${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${weapon.granblue_id}.jpg`}
|
||||||
/>
|
/>
|
||||||
<div className="Info">
|
<div className={styles.info}>
|
||||||
<h5>{weapon.name[locale]}</h5>
|
<h5>{weapon.name[locale]}</h5>
|
||||||
<UncapIndicator
|
<UncapIndicator
|
||||||
type="weapon"
|
type="weapon"
|
||||||
|
|
@ -46,7 +46,7 @@ const WeaponResult = (props: Props) => {
|
||||||
ulb={weapon.uncap.ulb}
|
ulb={weapon.uncap.ulb}
|
||||||
special={false}
|
special={false}
|
||||||
/>
|
/>
|
||||||
<div className="tags">
|
<div className={styles.tags}>
|
||||||
<WeaponLabelIcon labelType={Element[weapon.element]} />
|
<WeaponLabelIcon labelType={Element[weapon.element]} />
|
||||||
<WeaponLabelIcon labelType={Proficiency[weapon.proficiency]} />
|
<WeaponLabelIcon labelType={Proficiency[weapon.proficiency]} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue