駅名標にえきちゃんを追加
This commit is contained in:
parent
fd90b82a0e
commit
d2800f4d51
@ -58,6 +58,21 @@ export default function Sign(props) {
|
|||||||
setNexPrePosition(0);
|
setNexPrePosition(0);
|
||||||
getPreNextStation(currentStation[0]);
|
getPreNextStation(currentStation[0]);
|
||||||
}, [currentStation]);
|
}, [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(() => {
|
useEffect(() => {
|
||||||
if (!currentStation[nexPrePosition]) return () => {};
|
if (!currentStation[nexPrePosition]) return () => {};
|
||||||
@ -93,6 +108,14 @@ export default function Sign(props) {
|
|||||||
const lottieRef = useRef();
|
const lottieRef = useRef();
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity style={styleSheet.外枠} onPress={oP}>
|
<TouchableOpacity style={styleSheet.外枠} onPress={oP}>
|
||||||
|
<AutoHeightImage
|
||||||
|
source={{
|
||||||
|
uri: smileUrl,
|
||||||
|
}}
|
||||||
|
resizeMode="contain"
|
||||||
|
width={wp("30%")}
|
||||||
|
style={{ position: "absolute", bottom: "30%" }}
|
||||||
|
/>
|
||||||
<StationNumberMaker currentStation={currentStation} />
|
<StationNumberMaker currentStation={currentStation} />
|
||||||
<StationNameArea currentStation={currentStation} />
|
<StationNameArea currentStation={currentStation} />
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
|
Loading…
Reference in New Issue
Block a user