From 0140d83c9cd492f7a0fbcc5fa3f3751830c1ab4d Mon Sep 17 00:00:00 2001 From: Tijl Schipper Date: Fri, 15 Nov 2024 17:17:37 +0100 Subject: [PATCH] lint fixes Signed-off-by: Tijl Schipper --- app/(tabs)/faq/_layout.tsx | 6 ++- app/(tabs)/more/about.tsx | 11 +++--- app/(tabs)/more/profile.tsx | 20 +++++----- app/(tabs)/more/scan.tsx | 22 +++++------ app/+native-intent.tsx | 17 ++++---- app/_layout.tsx | 68 ++++++++++++++++---------------- components/Profile/NoProfile.tsx | 10 ++--- 7 files changed, 80 insertions(+), 74 deletions(-) diff --git a/app/(tabs)/faq/_layout.tsx b/app/(tabs)/faq/_layout.tsx index 99c8336..9848696 100644 --- a/app/(tabs)/faq/_layout.tsx +++ b/app/(tabs)/faq/_layout.tsx @@ -36,7 +36,11 @@ export default function MoreLayout() { }} /> - + ); } diff --git a/app/(tabs)/more/about.tsx b/app/(tabs)/more/about.tsx index 5750634..c38fe93 100644 --- a/app/(tabs)/more/about.tsx +++ b/app/(tabs)/more/about.tsx @@ -10,7 +10,7 @@ import { Text } from '@/components/Themed/Text'; import { useAlerts } from 'react-native-paper-alerts'; const SettingsScreen: React.FC = () => { - const alerts = useAlerts() + const alerts = useAlerts(); const colorScheme = useColorScheme(); const versionColor = Colors[colorScheme].muted; @@ -27,14 +27,13 @@ const SettingsScreen: React.FC = () => { [ { text: 'Sluiten', - style: 'cancel' - } + style: 'cancel', + }, ], { cancelable: false, - - } - ) + }, + ); } }, [pressesVersion]); diff --git a/app/(tabs)/more/profile.tsx b/app/(tabs)/more/profile.tsx index 9162a09..5b4d6a1 100644 --- a/app/(tabs)/more/profile.tsx +++ b/app/(tabs)/more/profile.tsx @@ -28,8 +28,8 @@ import { useAlerts } from 'react-native-paper-alerts'; import { useToast } from 'react-native-paper-toast'; const ProfileScreen: React.FC = () => { - const alerts = useAlerts() - const toaster = useToast() + const alerts = useAlerts(); + const toaster = useToast(); const [ticketData, setTicketData] = useState(); const [modalVisible, setModalVisible] = useState(false); @@ -53,12 +53,12 @@ const ProfileScreen: React.FC = () => { if (ticket) setTicketData(ticket); setTicketLoading(false); } catch (error) { - toaster.show({ position: 'top', type: 'error', - message: 'Er ging iets fout toen we je ticket probeerden te laden. Probeer het opnieuw.' - }) + message: + 'Er ging iets fout toen we je ticket probeerden te laden. Probeer het opnieuw.', + }); setTicketLoading(false); } }); @@ -98,16 +98,16 @@ const ProfileScreen: React.FC = () => { [ { text: 'Sluiten', - style: 'cancel' + style: 'cancel', }, { text: 'Verwijderen', onPress() { - deleteTicket() + deleteTicket(); }, - } - ] - ) + }, + ], + ); }; const deleteTicket = async () => { diff --git a/app/(tabs)/more/scan.tsx b/app/(tabs)/more/scan.tsx index b9a47db..7af7a3a 100644 --- a/app/(tabs)/more/scan.tsx +++ b/app/(tabs)/more/scan.tsx @@ -20,7 +20,7 @@ const ScanScreen: React.FC = () => { const [ticketHash, setTicketHash] = useState(null); const [isLit, setLit] = useState(false); - const toaster = useToast() + const toaster = useToast(); useEffect(() => { if (ticketHash) { @@ -31,16 +31,16 @@ const ScanScreen: React.FC = () => { toaster.show({ position: 'top', type: 'success', - message: 'Ticket toegevoegd' - }) + message: 'Ticket toegevoegd', + }); router.navigate('/more/profile'); } catch (error) { - toaster.show({ position: 'top', type: 'error', - message: 'Er ging iets fout toen we je ticket probeerden te laden. Probeer het opnieuw.', - }) + message: + 'Er ging iets fout toen we je ticket probeerden te laden. Probeer het opnieuw.', + }); setScanned(false); setTicketHash(null); } @@ -67,17 +67,17 @@ const ScanScreen: React.FC = () => { Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Rigid); if (!info.isConnected) { - toaster.show({ type: 'warning', - message: 'Je kan je ticket enkel toevoegen als je verbonden bent met het internet.', + message: + 'Je kan je ticket enkel toevoegen als je verbonden bent met het internet.', actionLabel: 'Opnieuw', position: 'top', duration: undefined, action: () => { - setScanned(false) - } - }) + setScanned(false); + }, + }); return; } diff --git a/app/+native-intent.tsx b/app/+native-intent.tsx index aff7f53..8a968b4 100644 --- a/app/+native-intent.tsx +++ b/app/+native-intent.tsx @@ -10,8 +10,8 @@ export function redirectSystemPath({ path: string; initial: boolean; }) { - const alerts = useAlerts() - const toaster = useToast() + const alerts = useAlerts(); + const toaster = useToast(); try { const url = new URL(path); @@ -34,17 +34,18 @@ export function redirectSystemPath({ text: 'Top!', style: 'cancel', onPress() { - router.navigate('/more/profile') + router.navigate('/more/profile'); }, - } - ] - ) + }, + ], + ); } catch (error) { toaster.show({ position: 'top', type: 'error', - message: 'Er ging iets fout toen we je ticket probeerden te laden. Probeer het opnieuw.' - }) + message: + 'Er ging iets fout toen we je ticket probeerden te laden. Probeer het opnieuw.', + }); } return '/more/profile'; diff --git a/app/_layout.tsx b/app/_layout.tsx index c87bb90..e5c83a1 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -216,40 +216,42 @@ const RootLayout = () => { return null; } else { return ( - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + + + ); } }; diff --git a/components/Profile/NoProfile.tsx b/components/Profile/NoProfile.tsx index 8745a4d..f99c0f3 100644 --- a/components/Profile/NoProfile.tsx +++ b/components/Profile/NoProfile.tsx @@ -10,8 +10,8 @@ import { Button } from 'react-native-paper'; import { useAlerts } from 'react-native-paper-alerts'; const NoProfile: React.FC = () => { - const alerts = useAlerts() - + const alerts = useAlerts(); + const colorScheme = useColorScheme(); const router = useRouter(); @@ -28,9 +28,9 @@ const NoProfile: React.FC = () => { onPress: async () => { await Linking.openSettings(); }, - } - ] - ) + }, + ], + ); } };