駅名標のスタイル変更
This commit is contained in:
parent
f72ac1d97b
commit
60d8caaefa
@ -6,6 +6,8 @@ import { useInterval } from "../../lib/useInterval";
|
|||||||
import { AS } from "../../storageControl";
|
import { AS } from "../../storageControl";
|
||||||
import { useFavoriteStation } from "../../stateBox/useFavoriteStation";
|
import { useFavoriteStation } from "../../stateBox/useFavoriteStation";
|
||||||
|
|
||||||
|
import lineColorList from "../../assets/originData/lineColorList";
|
||||||
|
|
||||||
export default function Sign(props) {
|
export default function Sign(props) {
|
||||||
const { currentStation, originalStationList, oP, oLP } = props;
|
const { currentStation, originalStationList, oP, oLP } = props;
|
||||||
const { favoriteStation, setFavoriteStation } = useFavoriteStation();
|
const { favoriteStation, setFavoriteStation } = useFavoriteStation();
|
||||||
@ -24,7 +26,7 @@ export default function Sign(props) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
setTestButtonStatus(isFavorite.length != 0);
|
setTestButtonStatus(isFavorite.length == 0 ? false : true);
|
||||||
}, [favoriteStation, currentStation]);
|
}, [favoriteStation, currentStation]);
|
||||||
|
|
||||||
useInterval(() => {
|
useInterval(() => {
|
||||||
@ -220,27 +222,40 @@ const StationNumberMaker = (props) => {
|
|||||||
};
|
};
|
||||||
return props.currentStation
|
return props.currentStation
|
||||||
.filter((d) => (d.StationNumber ? true : false))
|
.filter((d) => (d.StationNumber ? true : false))
|
||||||
.map((d, index, array) => (
|
.map((d, index, array) => {
|
||||||
<View
|
const lineID = d.StationNumber.slice(0, 1);
|
||||||
style={{
|
const lineName = d.StationNumber.slice(1);
|
||||||
position: "absolute",
|
return (
|
||||||
alignContent: "center",
|
<View
|
||||||
alignItems: "center",
|
style={{
|
||||||
top: getTop(array, index) + "%",
|
position: "absolute",
|
||||||
right: "10%",
|
alignContent: "center",
|
||||||
width: wp("10%"),
|
alignItems: "center",
|
||||||
height: wp("10%"),
|
top: getTop(array, index) + "%",
|
||||||
borderColor: "#2E94BB",
|
right: "10%",
|
||||||
borderWidth: parseInt("2%"),
|
width: wp("10%"),
|
||||||
borderRadius: parseInt("100%"),
|
height: wp("10%"),
|
||||||
}}
|
borderColor: lineColorList[lineID],
|
||||||
key={array[index].StationNumber}
|
borderWidth: parseInt("3%"),
|
||||||
>
|
borderRadius: parseInt("100%"),
|
||||||
<View style={{ flex: 1 }} />
|
}}
|
||||||
<Text style={{ fontSize: parseInt("20%") }}>{d.StationNumber}</Text>
|
key={array[index].StationNumber}
|
||||||
<View style={{ flex: 1 }} />
|
>
|
||||||
</View>
|
<View style={{ flex: 1 }} />
|
||||||
));
|
<Text
|
||||||
|
style={{
|
||||||
|
fontSize: parseInt("15%"),
|
||||||
|
margin: 0,
|
||||||
|
padding: 0,
|
||||||
|
textAlign: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{lineID + "\n" + lineName}
|
||||||
|
</Text>
|
||||||
|
<View style={{ flex: 1 }} />
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const StationNameArea = (props) => {
|
const StationNameArea = (props) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user