Fix job styles
This commit is contained in:
parent
d0fe71b1a6
commit
33b8f131b4
6 changed files with 44 additions and 32 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
.JobImage {
|
.image {
|
||||||
$height: 252px;
|
$height: 252px;
|
||||||
$width: 447px;
|
$width: 447px;
|
||||||
|
|
||||||
|
|
@ -72,9 +72,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.Overlay {
|
.overlay {
|
||||||
|
backdrop-filter: blur(5px) saturate(100%) brightness(80%) opacity(1);
|
||||||
background: none;
|
background: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
isolation: isolate;
|
||||||
|
z-index: 9;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
|
import classNames from 'classnames'
|
||||||
import Button from '~components/common/Button'
|
import Button from '~components/common/Button'
|
||||||
import JobAccessoryPopover from '~components/job/JobAccessoryPopover'
|
import JobAccessoryPopover from '~components/job/JobAccessoryPopover'
|
||||||
|
|
||||||
|
|
@ -8,7 +8,6 @@ import ShieldIcon from '~public/icons/Shield.svg'
|
||||||
import ManaturaIcon from '~public/icons/Manatura.svg'
|
import ManaturaIcon from '~public/icons/Manatura.svg'
|
||||||
|
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import classNames from 'classnames'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
job?: Job
|
job?: Job
|
||||||
|
|
@ -103,10 +102,10 @@ const JobImage = ({
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="JobImage">
|
<div className={styles.image}>
|
||||||
{hasAccessory ? accessoryPopover() : ''}
|
{hasAccessory ? accessoryPopover() : ''}
|
||||||
{job && job.id !== '-1' ? image : ''}
|
{job && job.id !== '-1' ? image : ''}
|
||||||
<div className="Job Overlay" />
|
<div className={styles.overlay} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#Job {
|
.job {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-bottom: $unit-3x;
|
margin-bottom: $unit-3x;
|
||||||
|
|
@ -22,13 +22,13 @@
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.JobDetails {
|
.details {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.JobName {
|
.name {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: $unit-half;
|
gap: $unit-half;
|
||||||
|
|
@ -48,12 +48,12 @@
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.JobSkills {
|
.skills {
|
||||||
flex-grow: 2;
|
flex-grow: 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.JobSkills {
|
.skills {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,8 @@ const JobSection = (props: Props) => {
|
||||||
|
|
||||||
// Classes
|
// Classes
|
||||||
const skillContainerClasses = classNames({
|
const skillContainerClasses = classNames({
|
||||||
JobSkills: true,
|
[styles.skills]: true,
|
||||||
editable: props.editable,
|
[styles.editable]: props.editable,
|
||||||
})
|
})
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -174,7 +174,7 @@ const JobSection = (props: Props) => {
|
||||||
)
|
)
|
||||||
|
|
||||||
const filledJobLabel = (
|
const filledJobLabel = (
|
||||||
<div className="JobName">
|
<div className={styles.name}>
|
||||||
<img
|
<img
|
||||||
alt={job?.name[locale]}
|
alt={job?.name[locale]}
|
||||||
src={`/images/job-icons/${job?.granblue_id}.png`}
|
src={`/images/job-icons/${job?.granblue_id}.png`}
|
||||||
|
|
@ -185,7 +185,7 @@ const JobSection = (props: Props) => {
|
||||||
|
|
||||||
// Render: JSX components
|
// Render: JSX components
|
||||||
return (
|
return (
|
||||||
<section id="Job">
|
<section className={styles.job}>
|
||||||
<JobImage
|
<JobImage
|
||||||
job={party.job}
|
job={party.job}
|
||||||
currentAccessory={currentAccessory}
|
currentAccessory={currentAccessory}
|
||||||
|
|
@ -194,7 +194,7 @@ const JobSection = (props: Props) => {
|
||||||
user={party.user}
|
user={party.user}
|
||||||
onAccessorySelected={handleAccessorySelected}
|
onAccessorySelected={handleAccessorySelected}
|
||||||
/>
|
/>
|
||||||
<div className="JobDetails">
|
<div className={styles.details}>
|
||||||
{props.editable ? (
|
{props.editable ? (
|
||||||
<JobDropdown
|
<JobDropdown
|
||||||
currentJob={party.job?.id}
|
currentJob={party.job?.id}
|
||||||
|
|
@ -202,7 +202,7 @@ const JobSection = (props: Props) => {
|
||||||
ref={selectRef}
|
ref={selectRef}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="JobName">
|
<div className={styles.name}>
|
||||||
{party.job ? (
|
{party.job ? (
|
||||||
<img
|
<img
|
||||||
alt={party.job.name[locale]}
|
alt={party.job.name[locale]}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
.JobSkills {
|
.skills {
|
||||||
&.editable .JobSkill {
|
&.editable .skill {
|
||||||
.Info {
|
.info {
|
||||||
padding: $unit-half * 1.5;
|
padding: $unit-half * 1.5;
|
||||||
|
|
||||||
& > img,
|
& > img,
|
||||||
|
|
@ -12,19 +12,19 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.JobSkill {
|
.skill {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
&.editable .Info:hover {
|
&.editable .info:hover {
|
||||||
background-color: var(--button-bg-hover);
|
background-color: var(--button-bg-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.editable:hover {
|
&.editable:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
.Info {
|
.info {
|
||||||
& > img.editable,
|
& > img.editable,
|
||||||
& > div.placeholder.editable {
|
& > div.placeholder.editable {
|
||||||
border: $hover-stroke;
|
border: $hover-stroke;
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.Info {
|
.info {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-radius: $input-corner;
|
border-radius: $input-corner;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -51,17 +51,17 @@ const JobSkillItem = React.forwardRef<HTMLDivElement, Props>(
|
||||||
|
|
||||||
// Classes
|
// Classes
|
||||||
const classes = classNames({
|
const classes = classNames({
|
||||||
JobSkill: true,
|
[styles.skill]: true,
|
||||||
editable: editable,
|
[styles.editable]: editable,
|
||||||
})
|
})
|
||||||
|
|
||||||
const imageClasses = classNames({
|
const imageClasses = classNames({
|
||||||
placeholder: !skill,
|
[styles.placeholder]: !skill,
|
||||||
editable: editable && hasJob,
|
[styles.editable]: editable && hasJob,
|
||||||
})
|
})
|
||||||
|
|
||||||
const buttonClasses = classNames({
|
const buttonClasses = classNames({
|
||||||
Clicked: contextMenuOpen,
|
[styles.clicked]: contextMenuOpen,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Methods: Data mutation
|
// Methods: Data mutation
|
||||||
|
|
@ -107,9 +107,15 @@ const JobSkillItem = React.forwardRef<HTMLDivElement, Props>(
|
||||||
if (skill) {
|
if (skill) {
|
||||||
jsx = <p>{skill.name[locale]}</p>
|
jsx = <p>{skill.name[locale]}</p>
|
||||||
} else if (editable && hasJob) {
|
} else if (editable && hasJob) {
|
||||||
jsx = <p className="placeholder">{t('job_skills.state.selectable')}</p>
|
jsx = (
|
||||||
|
<p className={styles.placeholder}>
|
||||||
|
{t('job_skills.state.selectable')}
|
||||||
|
</p>
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
jsx = <p className="placeholder">{t('job_skills.state.no_skill')}</p>
|
jsx = (
|
||||||
|
<p className={styles.placeholder}>{t('job_skills.state.no_skill')}</p>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return jsx
|
return jsx
|
||||||
|
|
@ -159,7 +165,7 @@ const JobSkillItem = React.forwardRef<HTMLDivElement, Props>(
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes} ref={forwardedRef}>
|
<div className={classes} ref={forwardedRef}>
|
||||||
<div className="Info" onClick={props.onClick} tabIndex={0}>
|
<div className={styles.info} onClick={props.onClick} tabIndex={0}>
|
||||||
{skillImage()}
|
{skillImage()}
|
||||||
{label()}
|
{label()}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue