駅名標にえきちゃんを追加
This commit is contained in:
parent
fd90b82a0e
commit
d2800f4d51
@ -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 (
|
||||
<TouchableOpacity style={styleSheet.外枠} onPress={oP}>
|
||||
<AutoHeightImage
|
||||
source={{
|
||||
uri: smileUrl,
|
||||
}}
|
||||
resizeMode="contain"
|
||||
width={wp("30%")}
|
||||
style={{ position: "absolute", bottom: "30%" }}
|
||||
/>
|
||||
<StationNumberMaker currentStation={currentStation} />
|
||||
<StationNameArea currentStation={currentStation} />
|
||||
<TouchableOpacity
|
||||
|
Loading…
Reference in New Issue
Block a user