refactor(scanner): added toasts in to make it look better
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 1m25s

This commit is contained in:
2026-05-06 19:42:52 -05:00
parent 87803eed43
commit edb3668548
8 changed files with 286 additions and 32 deletions

View File

@@ -2,6 +2,7 @@ import Constants from "expo-constants";
import { useRouter } from "expo-router";
import { useState } from "react";
import { Alert, Button, Text, TextInput, View } from "react-native";
import Toast from "react-native-toast-message";
import { useAppStore } from "../hooks/useAppStore";
import { useServerStore } from "../hooks/useServerCheck";
@@ -31,14 +32,23 @@ export default function Setup() {
if (pin === "6971") {
setAuth(true);
} else {
Alert.alert("Incorrect pin entered please try again");
//Alert.alert("Incorrect pin entered please try again");
Toast.show({
type: "error",
text1: "Incorrect pin entered please try again",
});
setPin("");
}
};
const handleSave = async () => {
if (!serverIp.trim() || !serverPort.trim()) {
Alert.alert("Missing info", "Please fill in both fields.");
//Alert.alert("Missing info", "Please fill in both fields.");
Toast.show({
type: "error",
text1: "Missing info",
text2: "Please fill in both fields.",
});
return;
}
@@ -50,7 +60,12 @@ export default function Setup() {
isRegistered: true,
});
Alert.alert("Saved", "Config saved to device.");
//Alert.alert("Saved", "Config saved to device.");
Toast.show({
type: "info",
text1: "Saved",
text2: "Config saved to device.",
});
//router.replace("/");
};
return (