@@ -285,7 +287,7 @@ const SummonGrid = (props: Props) => {
{subAuraSummonElement}
- )
-}
+ );
+};
-export default SummonGrid
+export default SummonGrid;
diff --git a/components/SummonHovercard/index.tsx b/components/SummonHovercard/index.tsx
index 5a391a26..7d325653 100644
--- a/components/SummonHovercard/index.tsx
+++ b/components/SummonHovercard/index.tsx
@@ -1,80 +1,99 @@
-import React from 'react'
-import { useRouter } from 'next/router'
-import { useTranslation } from 'next-i18next'
+import React from "react";
+import { useRouter } from "next/router";
+import { useTranslation } from "next-i18next";
-import * as HoverCard from '@radix-ui/react-hover-card'
+import * as HoverCard from "@radix-ui/react-hover-card";
-import WeaponLabelIcon from '~components/WeaponLabelIcon'
-import UncapIndicator from '~components/UncapIndicator'
+import WeaponLabelIcon from "~components/WeaponLabelIcon";
+import UncapIndicator from "~components/UncapIndicator";
-import './index.scss'
+import "./index.scss";
interface Props {
- gridSummon: GridSummon
- children: React.ReactNode
+ gridSummon: GridSummon;
+ children: React.ReactNode;
}
const SummonHovercard = (props: Props) => {
- const router = useRouter()
- const { t } = useTranslation('common')
- const locale = (router.locale && ['en', 'ja'].includes(router.locale)) ? router.locale : 'en'
+ const router = useRouter();
+ const { t } = useTranslation("common");
+ const locale =
+ router.locale && ["en", "ja"].includes(router.locale)
+ ? router.locale
+ : "en";
- const Element = ['null', 'wind', 'fire', 'water', 'earth', 'dark', 'light']
+ const Element = ["null", "wind", "fire", "water", "earth", "dark", "light"];
- const tintElement = Element[props.gridSummon.object.element]
- const wikiUrl = `https://gbf.wiki/${props.gridSummon.object.name.en.replaceAll(' ', '_')}`
+ const tintElement = Element[props.gridSummon.object.element];
+ const wikiUrl = `https://gbf.wiki/${props.gridSummon.object.name.en.replaceAll(
+ " ",
+ "_"
+ )}`;
- function summonImage() {
- let imgSrc = ""
+ function summonImage() {
+ let imgSrc = "";
- if (props.gridSummon) {
- const summon = props.gridSummon.object
+ if (props.gridSummon) {
+ const summon = props.gridSummon.object;
- const upgradedSummons = [
- '2040094000', '2040100000', '2040080000', '2040098000',
- '2040090000', '2040084000', '2040003000', '2040056000'
- ]
-
- let suffix = ''
- if (upgradedSummons.indexOf(summon.granblue_id.toString()) != -1 && props.gridSummon.uncap_level == 5)
- suffix = '_02'
-
- // Generate the correct source for the summon
- imgSrc = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/summon-grid/${summon.granblue_id}${suffix}.jpg`
- }
+ const upgradedSummons = [
+ "2040094000",
+ "2040100000",
+ "2040080000",
+ "2040098000",
+ "2040090000",
+ "2040084000",
+ "2040003000",
+ "2040056000",
+ ];
- return imgSrc
+ let suffix = "";
+ if (
+ upgradedSummons.indexOf(summon.granblue_id.toString()) != -1 &&
+ props.gridSummon.uncap_level == 5
+ )
+ suffix = "_02";
+
+ // Generate the correct source for the summon
+ imgSrc = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/summon-grid/${summon.granblue_id}${suffix}.jpg`;
}
- return (
-
-
- { props.children }
-
-
-
-
-
{ props.gridSummon.object.name[locale] }
-
![{props.gridSummon.object.name[locale]}]({summonImage()})
-
-
-
- {t('buttons.wiki')}
-
-
-
- )
-}
+ return imgSrc;
+ }
-export default SummonHovercard
+ return (
+
+ {props.children}
+
+
+
+
{props.gridSummon.object.name[locale]}
+
![{props.gridSummon.object.name[locale]}]({summonImage()})
+
+
+
+
+ {t("buttons.wiki")}
+
+
+
+
+ );
+};
+export default SummonHovercard;
diff --git a/components/SummonResult/index.scss b/components/SummonResult/index.scss
index 0b75c515..e22316c9 100644
--- a/components/SummonResult/index.scss
+++ b/components/SummonResult/index.scss
@@ -1,63 +1,63 @@
.SummonResult {
+ border-radius: 6px;
+ display: flex;
+ gap: $unit;
+ padding: $unit * 1.5;
+
+ &:hover {
+ background: $grey-90;
+ cursor: pointer;
+ }
+
+ img {
+ background: $grey-80;
border-radius: 6px;
+ display: inline-block;
+ height: auto;
+ width: 120px;
+ }
+
+ .Info {
display: flex;
- gap: $unit;
- padding: $unit * 1.5;
+ flex-direction: column;
+ flex-grow: 1;
+ gap: calc($unit / 2);
- &:hover {
- background: $grey-90;
- cursor: pointer;
+ h5 {
+ color: #555;
+ display: inline-block;
+ font-size: $font-medium;
+ font-weight: $medium;
}
- img {
- background: $grey-80;
- border-radius: 6px;
- display: inline-block;
- height: auto;
- width: 120px;
+ .UncapIndicator {
+ justify-content: left;
+ pointer-events: none;
}
- .Info {
- display: flex;
- flex-direction: column;
- flex-grow: 1;
- gap: calc($unit / 2);
+ .stars {
+ display: inline-block;
+ color: #ffa15e;
+ font-size: $font-xlarge;
- h5 {
- color: #555;
- display: inline-block;
- font-size: $font-medium;
- font-weight: $medium;
- }
-
- .UncapIndicator {
- justify-content: left;
- pointer-events: none;
- }
-
- .stars {
- display: inline-block;
- color: #FFA15E;
- font-size: $font-xlarge;
-
- & > span {
- color: #65DAFF;
- }
- }
-
- .tags {
- display: flex;
- flex-direction: row;
- gap: calc($unit / 2);
-
- .WeaponLabelIcon {
- $aspect-ratio: calc(25 / 60);
- $height: 22px;
- background-size: calc($height / $aspect-ratio) $height;
- background-repeat: no-repeat;
- height: $height;
- width: calc($height / $aspect-ratio);
- }
- }
+ & > span {
+ color: #65daff;
+ }
}
+
+ .tags {
+ display: flex;
+ flex-direction: row;
+ gap: calc($unit / 2);
+
+ .WeaponLabelIcon {
+ $aspect-ratio: calc(25 / 60);
+ $height: 22px;
+ background-size: calc($height / $aspect-ratio) $height;
+ background-repeat: no-repeat;
+ height: $height;
+ width: calc($height / $aspect-ratio);
+ }
+ }
+ }
}
diff --git a/components/SummonResult/index.tsx b/components/SummonResult/index.tsx
index c5c32990..451a9b02 100644
--- a/components/SummonResult/index.tsx
+++ b/components/SummonResult/index.tsx
@@ -1,41 +1,47 @@
-import React from 'react'
-import { useRouter } from 'next/router'
+import React from "react";
+import { useRouter } from "next/router";
-import UncapIndicator from '~components/UncapIndicator'
-import WeaponLabelIcon from '~components/WeaponLabelIcon'
+import UncapIndicator from "~components/UncapIndicator";
+import WeaponLabelIcon from "~components/WeaponLabelIcon";
-import './index.scss'
+import "./index.scss";
interface Props {
- data: Summon
- onClick: () => void
+ data: Summon;
+ onClick: () => void;
}
-const Element = ['null', 'wind', 'fire', 'water', 'earth', 'dark', 'light']
+const Element = ["null", "wind", "fire", "water", "earth", "dark", "light"];
const SummonResult = (props: Props) => {
- const router = useRouter()
- const locale = (router.locale && ['en', 'ja'].includes(router.locale)) ? router.locale : 'en'
+ const router = useRouter();
+ const locale =
+ router.locale && ["en", "ja"].includes(router.locale)
+ ? router.locale
+ : "en";
- const summon = props.data
-
- return (
-
-
-
-
{summon.name[locale]}
-
-
-
-
-
-
- )
-}
+ const summon = props.data;
-export default SummonResult
\ No newline at end of file
+ return (
+
+
+
+
{summon.name[locale]}
+
+
+
+
+
+
+ );
+};
+
+export default SummonResult;
diff --git a/components/SummonSearchFilterBar/index.tsx b/components/SummonSearchFilterBar/index.tsx
index 14be3c1c..ceb8b768 100644
--- a/components/SummonSearchFilterBar/index.tsx
+++ b/components/SummonSearchFilterBar/index.tsx
@@ -1,105 +1,134 @@
-import React, { useEffect, useState } from 'react'
-import { useTranslation } from 'next-i18next'
+import React, { useEffect, useState } from "react";
+import { useTranslation } from "next-i18next";
-import cloneDeep from 'lodash.clonedeep'
+import cloneDeep from "lodash.clonedeep";
-import * as DropdownMenu from '@radix-ui/react-dropdown-menu'
+import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
-import SearchFilter from '~components/SearchFilter'
-import SearchFilterCheckboxItem from '~components/SearchFilterCheckboxItem'
+import SearchFilter from "~components/SearchFilter";
+import SearchFilterCheckboxItem from "~components/SearchFilterCheckboxItem";
-import './index.scss'
-import { emptyElementState, emptyRarityState } from '~utils/emptyStates'
-import { elements, rarities } from '~utils/stateValues'
+import "./index.scss";
+import { emptyElementState, emptyRarityState } from "~utils/emptyStates";
+import { elements, rarities } from "~utils/stateValues";
interface Props {
- sendFilters: (filters: { [key: string]: number[] }) => void
+ sendFilters: (filters: { [key: string]: number[] }) => void;
}
const SummonSearchFilterBar = (props: Props) => {
- const { t } = useTranslation('common')
+ const { t } = useTranslation("common");
- const [rarityMenu, setRarityMenu] = useState(false)
- const [elementMenu, setElementMenu] = useState(false)
+ const [rarityMenu, setRarityMenu] = useState(false);
+ const [elementMenu, setElementMenu] = useState(false);
- const [rarityState, setRarityState] = useState
(emptyRarityState)
- const [elementState, setElementState] = useState(emptyElementState)
+ const [rarityState, setRarityState] = useState(emptyRarityState);
+ const [elementState, setElementState] =
+ useState(emptyElementState);
- function rarityMenuOpened(open: boolean) {
- if (open) {
- setRarityMenu(true)
- setElementMenu(false)
- } else setRarityMenu(false)
- }
+ function rarityMenuOpened(open: boolean) {
+ if (open) {
+ setRarityMenu(true);
+ setElementMenu(false);
+ } else setRarityMenu(false);
+ }
- function elementMenuOpened(open: boolean) {
- if (open) {
- setRarityMenu(false)
- setElementMenu(true)
- } else setElementMenu(false)
- }
+ function elementMenuOpened(open: boolean) {
+ if (open) {
+ setRarityMenu(false);
+ setElementMenu(true);
+ } else setElementMenu(false);
+ }
- function handleRarityChange(checked: boolean, key: string) {
- let newRarityState = cloneDeep(rarityState)
- newRarityState[key].checked = checked
- setRarityState(newRarityState)
- }
+ function handleRarityChange(checked: boolean, key: string) {
+ let newRarityState = cloneDeep(rarityState);
+ newRarityState[key].checked = checked;
+ setRarityState(newRarityState);
+ }
- function handleElementChange(checked: boolean, key: string) {
- let newElementState = cloneDeep(elementState)
- newElementState[key].checked = checked
- setElementState(newElementState)
- }
+ function handleElementChange(checked: boolean, key: string) {
+ let newElementState = cloneDeep(elementState);
+ newElementState[key].checked = checked;
+ setElementState(newElementState);
+ }
- function sendFilters() {
- const checkedRarityFilters = Object.values(rarityState).filter(x => x.checked).map((x, i) => x.id)
- const checkedElementFilters = Object.values(elementState).filter(x => x.checked).map((x, i) => x.id)
+ function sendFilters() {
+ const checkedRarityFilters = Object.values(rarityState)
+ .filter((x) => x.checked)
+ .map((x, i) => x.id);
+ const checkedElementFilters = Object.values(elementState)
+ .filter((x) => x.checked)
+ .map((x, i) => x.id);
- const filters = {
- rarity: checkedRarityFilters,
- element: checkedElementFilters
+ const filters = {
+ rarity: checkedRarityFilters,
+ element: checkedElementFilters,
+ };
+
+ props.sendFilters(filters);
+ }
+
+ useEffect(() => {
+ sendFilters();
+ }, [rarityState, elementState]);
+
+ return (
+
+ x.checked)
+ .filter(Boolean).length
}
+ open={rarityMenu}
+ onOpenChange={rarityMenuOpened}
+ >
+
+ {t("filters.labels.rarity")}
+
+ {Array.from(Array(rarities.length)).map((x, i) => {
+ return (
+
+ {t(`rarities.${rarities[i]}`)}
+
+ );
+ })}
+
- props.sendFilters(filters)
- }
+ x.checked)
+ .filter(Boolean).length
+ }
+ open={elementMenu}
+ onOpenChange={elementMenuOpened}
+ >
+
+ {t("filters.labels.element")}
+
+ {Array.from(Array(elements.length)).map((x, i) => {
+ return (
+
+ {t(`elements.${elements[i]}`)}
+
+ );
+ })}
+
+
+ );
+};
- useEffect(() => {
- sendFilters()
- }, [rarityState, elementState])
-
- return (
-
- x.checked).filter(Boolean).length} open={rarityMenu} onOpenChange={rarityMenuOpened}>
- {t('filters.labels.rarity')}
- { Array.from(Array(rarities.length)).map((x, i) => {
- return (
-
- {t(`rarities.${rarities[i]}`)}
-
- )}
- ) }
-
-
- x.checked).filter(Boolean).length} open={elementMenu} onOpenChange={elementMenuOpened}>
- {t('filters.labels.element')}
- { Array.from(Array(elements.length)).map((x, i) => {
- return (
-
- {t(`elements.${elements[i]}`)}
-
- )}
- ) }
-
-
- )
-}
-
-export default SummonSearchFilterBar
+export default SummonSearchFilterBar;
diff --git a/components/SummonUnit/index.scss b/components/SummonUnit/index.scss
index ac2e2511..6bc79d77 100644
--- a/components/SummonUnit/index.scss
+++ b/components/SummonUnit/index.scss
@@ -1,106 +1,107 @@
.SummonUnit {
- display: flex;
- flex-direction: column;
- gap: 4px;
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
- &.main .SummonImage,
- &.friend .SummonImage {
- aspect-ratio: 182 / 315;
- width: 182px;
- height: auto;
+ &.main .SummonImage,
+ &.friend .SummonImage {
+ aspect-ratio: 182 / 315;
+ width: 182px;
+ height: auto;
- @media (max-width: $medium-screen) {
- width: 20.3vw;
- }
+ @media (max-width: $medium-screen) {
+ width: 20.3vw;
}
+ }
- &.grid {
- // max-width: 148px;
- // min-height: 141px;
- min-height: 180px;
+ &.grid {
+ // max-width: 148px;
+ // min-height: 141px;
+ min-height: 180px;
- @media (max-width: $medium-screen) {
- min-height: 16.5vw;
- }
-
- .SummonImage {
- aspect-ratio: 148 / 111;
- list-style-type: none;
- width: 148px;
- height: auto;
-
- @media (max-width: $medium-screen) {
- width: 20vw;
- }
- }
- }
-
- &.friend {
- margin-right: 0;
- }
-
- &.main.editable .SummonImage:hover,
- &.friend.editable .SummonImage:hover {
- transform: $scale-tall;
- }
-
- &.editable .SummonImage:hover {
- border: $hover-stroke;
- box-shadow: $hover-shadow;
- cursor: pointer;
- transform: $scale-wide;
+ @media (max-width: $medium-screen) {
+ min-height: 16.5vw;
}
.SummonImage {
- background: white;
- border: 1px solid rgba(0, 0, 0, 0);
- border-radius: $unit;
- display: flex;
- align-items: center;
- justify-content: center;
- overflow: hidden;
- transition: all 0.18s ease-in-out;
+ aspect-ratio: 148 / 111;
+ list-style-type: none;
+ width: 148px;
+ height: auto;
- &:hover .icon svg {
- fill: $grey-40;
- }
+ @media (max-width: $medium-screen) {
+ width: 20vw;
+ }
+ }
+ }
- .icon {
- position: absolute;
- height: $unit * 3;
- width: $unit * 3;
- z-index: 1;
-
- svg {
- fill: $grey-70;
- }
- }
+ &.friend {
+ margin-right: 0;
+ }
+
+ &.main.editable .SummonImage:hover,
+ &.friend.editable .SummonImage:hover {
+ transform: $scale-tall;
+ }
+
+ &.editable .SummonImage:hover {
+ border: $hover-stroke;
+ box-shadow: $hover-shadow;
+ cursor: pointer;
+ transform: $scale-wide;
+ }
+
+ .SummonImage {
+ background: white;
+ border: 1px solid rgba(0, 0, 0, 0);
+ border-radius: $unit;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ overflow: hidden;
+ transition: all 0.18s ease-in-out;
+
+ &:hover .icon svg {
+ fill: $grey-40;
}
- &.filled h3 {
- display: block;
- }
+ .icon {
+ position: absolute;
+ height: $unit * 3;
+ width: $unit * 3;
+ z-index: 1;
- &.filled ul {
- display: flex;
+ svg {
+ fill: $grey-70;
+ }
}
+ }
- h3, ul {
- display: none;
- }
+ &.filled h3 {
+ display: block;
+ }
- h3 {
- color: #333;
- font-size: $font-regular;
- font-weight: $normal;
- line-height: 1.1;
- margin: 0;
- text-align: center;
- }
+ &.filled ul {
+ display: flex;
+ }
- img {
- position: relative;
- width: 100%;
- z-index: 2;
- }
+ h3,
+ ul {
+ display: none;
+ }
+
+ h3 {
+ color: #333;
+ font-size: $font-regular;
+ font-weight: $normal;
+ line-height: 1.1;
+ margin: 0;
+ text-align: center;
+ }
+
+ img {
+ position: relative;
+ width: 100%;
+ z-index: 2;
+ }
}
diff --git a/components/SummonUnit/index.tsx b/components/SummonUnit/index.tsx
index 462a9db0..1b6451ae 100644
--- a/components/SummonUnit/index.tsx
+++ b/components/SummonUnit/index.tsx
@@ -1,34 +1,36 @@
-import React, { useEffect, useState } from "react"
-import { useRouter } from "next/router"
-import { useTranslation } from "next-i18next"
-import classnames from "classnames"
+import React, { useEffect, useState } from "react";
+import { useRouter } from "next/router";
+import { useTranslation } from "next-i18next";
+import classnames from "classnames";
-import SearchModal from "~components/SearchModal"
-import SummonHovercard from "~components/SummonHovercard"
-import UncapIndicator from "~components/UncapIndicator"
-import PlusIcon from "~public/icons/Add.svg"
+import SearchModal from "~components/SearchModal";
+import SummonHovercard from "~components/SummonHovercard";
+import UncapIndicator from "~components/UncapIndicator";
+import PlusIcon from "~public/icons/Add.svg";
-import type { SearchableObject } from "~types"
+import type { SearchableObject } from "~types";
-import "./index.scss"
+import "./index.scss";
interface Props {
- gridSummon: GridSummon | undefined
- unitType: 0 | 1 | 2
- position: number
- editable: boolean
- updateObject: (object: SearchableObject, position: number) => void
- updateUncap: (id: string, position: number, uncap: number) => void
+ gridSummon: GridSummon | undefined;
+ unitType: 0 | 1 | 2;
+ position: number;
+ editable: boolean;
+ updateObject: (object: SearchableObject, position: number) => void;
+ updateUncap: (id: string, position: number, uncap: number) => void;
}
const SummonUnit = (props: Props) => {
- const { t } = useTranslation("common")
+ const { t } = useTranslation("common");
- const [imageUrl, setImageUrl] = useState("")
+ const [imageUrl, setImageUrl] = useState("");
- const router = useRouter()
+ const router = useRouter();
const locale =
- router.locale && ["en", "ja"].includes(router.locale) ? router.locale : "en"
+ router.locale && ["en", "ja"].includes(router.locale)
+ ? router.locale
+ : "en";
const classes = classnames({
SummonUnit: true,
@@ -37,19 +39,19 @@ const SummonUnit = (props: Props) => {
friend: props.unitType == 2,
editable: props.editable,
filled: props.gridSummon !== undefined,
- })
+ });
- const gridSummon = props.gridSummon
- const summon = gridSummon?.object
+ const gridSummon = props.gridSummon;
+ const summon = gridSummon?.object;
useEffect(() => {
- generateImageUrl()
- })
+ generateImageUrl();
+ });
function generateImageUrl() {
- let imgSrc = ""
+ let imgSrc = "";
if (props.gridSummon) {
- const summon = props.gridSummon.object!
+ const summon = props.gridSummon.object!;
const upgradedSummons = [
"2040094000",
@@ -66,28 +68,28 @@ const SummonUnit = (props: Props) => {
"2040027000",
"2040046000",
"2040047000",
- ]
+ ];
- let suffix = ""
+ let suffix = "";
if (
upgradedSummons.indexOf(summon.granblue_id.toString()) != -1 &&
props.gridSummon.uncap_level == 5
)
- suffix = "_02"
+ suffix = "_02";
// Generate the correct source for the summon
if (props.unitType == 0 || props.unitType == 2)
- imgSrc = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/summon-main/${summon.granblue_id}${suffix}.jpg`
+ imgSrc = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/summon-main/${summon.granblue_id}${suffix}.jpg`;
else
- imgSrc = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/summon-grid/${summon.granblue_id}${suffix}.jpg`
+ imgSrc = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/summon-grid/${summon.granblue_id}${suffix}.jpg`;
}
- setImageUrl(imgSrc)
+ setImageUrl(imgSrc);
}
function passUncapData(uncap: number) {
if (props.gridSummon)
- props.updateUncap(props.gridSummon.id, props.position, uncap)
+ props.updateUncap(props.gridSummon.id, props.position, uncap);
}
const image = (
@@ -101,7 +103,7 @@ const SummonUnit = (props: Props) => {
""
)}
- )
+ );
const editableImage = (