From d2800f4d51cb49bfdc0fb7c76f9f30fd04724020 Mon Sep 17 00:00:00 2001 From: harukin-DeskMini Date: Thu, 30 Mar 2023 02:33:52 +0900 Subject: [PATCH] =?UTF-8?q?=E9=A7=85=E5=90=8D=E6=A8=99=E3=81=AB=E3=81=88?= =?UTF-8?q?=E3=81=8D=E3=81=A1=E3=82=83=E3=82=93=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/駅名表/Sign.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/components/駅名表/Sign.js b/components/駅名表/Sign.js index 01a64bd..eec65c7 100644 --- a/components/駅名表/Sign.js +++ b/components/駅名表/Sign.js @@ -58,6 +58,21 @@ export default function Sign(props) { setNexPrePosition(0); getPreNextStation(currentStation[0]); }, [currentStation]); + const [smileUrl, setSmileUrl] = useState(undefined); + useEffect(() => { + const smile = currentStation[0].JrHpUrl.replace("/index.html", "/"); + const stationSplit = smile.split("/"); + const smileName = stationSplit[stationSplit.length - 2]; + if (smileName == "takamatsu") { + setSmileUrl(smile + "/images/illustration.png"); + } else if (smileName == "iyomishima") { + setSmileUrl(smile + "/images/iyo-mishima_smile.png"); + } else if (smileName == "iyosaijo") { + setSmileUrl(smile + "/images/iyo-saijo_smile.png"); + } else { + setSmileUrl(smile + "images/" + smileName + "_smile.png"); + } + }, [currentStation]); useEffect(() => { if (!currentStation[nexPrePosition]) return () => {}; @@ -93,6 +108,14 @@ export default function Sign(props) { const lottieRef = useRef(); return ( +