検索削除機能を追加

This commit is contained in:
harukin-expo-dev-env 2025-07-18 15:34:00 +00:00
parent 0c10bcc339
commit acd5d0bb88

View File

@ -79,6 +79,9 @@ export const SearchUnitBox = ({
paddingRight: 10, paddingRight: 10,
paddingLeft: 10, paddingLeft: 10,
flex: 1, flex: 1,
flexDirection: "row",
alignItems: "center",
justifyContent: "center",
}} }}
> >
<TextInput <TextInput
@ -88,46 +91,68 @@ export const SearchUnitBox = ({
value={input} value={input}
style={{ flex: 1 }} style={{ flex: 1 }}
/> />
{input && (
<TouchableOpacity
onPress={() => setInput("") }
style={{
padding: 3,
borderRadius: 15,
backgroundColor: "lightgray",
}}
>
<Ionicons
name="close"
size={20}
color="white"
/>
</TouchableOpacity>
)}
</View> </View>
</View> </View>
{!input &&<View style={{ flexDirection: "row", alignItems: "center" }}> {!input && (
{Object.keys(lineList_LineWebID).map((d) => ( <View style={{ flexDirection: "row", alignItems: "center" }}>
<TouchableOpacity {Object.keys(lineList_LineWebID).map((d) => (
style={{ <TouchableOpacity
flex: 1, style={{
backgroundColor: flex: 1,
lineColorList[stationIDPair[lineList_LineWebID[d]]], backgroundColor:
padding: 5, lineColorList[stationIDPair[lineList_LineWebID[d]]],
marginHorizontal: 2, padding: 5,
borderRadius: 10, marginHorizontal: 2,
borderColor: "white", borderRadius: 10,
borderWidth: 1, borderColor: "white",
borderStyle: "solid", borderWidth: 1,
alignItems: "center", borderStyle: "solid",
opacity: alignItems: "center",
isSearchMode == stationIDPair[lineList_LineWebID[d]] opacity:
? 1 isSearchMode == stationIDPair[lineList_LineWebID[d]]
: !isSearchMode ? 1
? 1 : !isSearchMode
: 0.5, ? 1
zIndex: 10, : 0.5,
}} zIndex: 10,
onPress={() => { }}
const id = stationIDPair[lineList_LineWebID[d]]; onPress={() => {
const s = isSearchMode == id ? undefined : id; const id = stationIDPair[lineList_LineWebID[d]];
if (!s) return; const s = isSearchMode == id ? undefined : id;
setisSearchMode(s); if (!s) return;
}} setisSearchMode(s);
key={stationIDPair[lineList_LineWebID[d]]} }}
> key={stationIDPair[lineList_LineWebID[d]]}
<Text
style={{ color: "white", fontWeight: "bold", fontSize: 20 }}
> >
{stationIDPair[lineList_LineWebID[d]]} <Text
</Text> style={{
</TouchableOpacity> color: "white",
))} fontWeight: "bold",
</View>} fontSize: 20,
}}
>
{stationIDPair[lineList_LineWebID[d]]}
</Text>
</TouchableOpacity>
))}
</View>
)}
</View> </View>
)} )}
</TouchableOpacity> </TouchableOpacity>