diff --git a/components/GridRep/index.tsx b/components/GridRep/index.tsx index 227a0dcd..8f07209b 100644 --- a/components/GridRep/index.tsx +++ b/components/GridRep/index.tsx @@ -71,13 +71,33 @@ const GridRep = (props: Props) => { } function generateMainhandImage() { + let url = '' + + if (mainhand) { + if (mainhand.element == 0 && props.grid[0].element) { + url = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-main/${mainhand.granblue_id}_${props.grid[0].element}.jpg` + } else { + url = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-main/${mainhand.granblue_id}.jpg` + } + } + return (mainhand) ? - {mainhand?.name[locale]} : '' + {mainhand.name[locale]} : '' } function generateGridImage(position: number) { + let url = '' + + if (weapons[position]) { + if (weapons[position].element == 0 && props.grid[position].element) { + url = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${weapons[position]?.granblue_id}_${props.grid[position].element}.jpg` + } else { + url = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${weapons[position]?.granblue_id}.jpg` + } + } + return (weapons[position]) ? - {weapons[position]?.name[locale]} : '' + {weapons[position].name[locale]} : '' } function sendSaveData() {