diff --git a/components/JobSkillResult/index.scss b/components/JobSkillResult/index.scss new file mode 100644 index 00000000..c8308b05 --- /dev/null +++ b/components/JobSkillResult/index.scss @@ -0,0 +1,71 @@ +.JobSkillResult { + border-radius: 6px; + display: flex; + gap: $unit; + padding: $unit * 1.5; + align-items: center; + + &:hover { + background: $grey-90; + cursor: pointer; + + .Info .skill.pill { + background: $grey-80; + } + } + + .Info { + display: flex; + flex-direction: row; + gap: calc($unit / 2); + width: 100%; + + .skill.pill { + background: $grey-90; + border-radius: $unit * 2; + color: $grey-00; + display: inline; + font-size: $font-tiny; + font-weight: $medium; + padding: calc($unit / 2) $unit; + + &.buffing { + background-color: $light-bg-dark; + color: $light-text-dark; + } + + &.debuffing { + background-color: $water-bg-dark; + color: $water-text-dark; + } + + &.healing { + background-color: $wind-bg-dark; + color: $wind-text-dark; + } + + &.damaging { + background-color: $fire-bg-dark; + color: $fire-text-dark; + } + + &.field { + background-color: $dark-bg-dark; + color: $dark-text-dark; + } + } + + h5 { + color: #555; + display: inline-block; + font-size: $font-medium; + font-weight: $medium; + flex-grow: 1; + } + } + + img { + width: $unit * 6; + height: $unit * 6; + } +} diff --git a/components/JobSkillResult/index.tsx b/components/JobSkillResult/index.tsx new file mode 100644 index 00000000..09c08028 --- /dev/null +++ b/components/JobSkillResult/index.tsx @@ -0,0 +1,41 @@ +import React, { useEffect, useState } from "react" +import { useRouter } from "next/router" +import { SkillGroup, skillClassification } from "~utils/skillGroups" + +import "./index.scss" + +interface Props { + data: JobSkill + onClick: () => void +} + +const JobSkillResult = (props: Props) => { + const router = useRouter() + const locale = + router.locale && ["en", "ja"].includes(router.locale) ? router.locale : "en" + + const skill = props.data + + const [group, setGroup] = useState() + + useEffect(() => { + setGroup(skillClassification.find((group) => group.id === skill.color)) + }, [skill, setGroup, skillClassification]) + + const jobSkillUrl = () => + `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/job-skills/${skill.slug}.png` + + return ( +
  • + {skill.name[locale]} +
    +
    {skill.name[locale]}
    +
    + {group?.name[locale]} +
    +
    +
  • + ) +} + +export default JobSkillResult