Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Tijl Schipper <[email protected]>
  • Loading branch information
TijlS committed Nov 15, 2024
1 parent ed371f4 commit 0140d83
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 74 deletions.
6 changes: 5 additions & 1 deletion app/(tabs)/faq/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ export default function MoreLayout() {
}}
/>
</Stack>
<StatusBar backgroundColor={Colors[colorScheme].tabBarStyle.backgroundColor} animated={true} style="light" />
<StatusBar
backgroundColor={Colors[colorScheme].tabBarStyle.backgroundColor}
animated={true}
style="light"
/>
</>
);
}
11 changes: 5 additions & 6 deletions app/(tabs)/more/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -27,14 +27,13 @@ const SettingsScreen: React.FC = () => {
[
{
text: 'Sluiten',
style: 'cancel'
}
style: 'cancel',
},
],
{
cancelable: false,

}
)
},
);
}
}, [pressesVersion]);

Expand Down
20 changes: 10 additions & 10 deletions app/(tabs)/more/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Ticket | null>();
const [modalVisible, setModalVisible] = useState(false);
Expand All @@ -53,12 +53,12 @@ const ProfileScreen: React.FC = () => {
if (ticket) setTicketData(ticket);
setTicketLoading(false);
} catch (error) {

Check failure on line 55 in app/(tabs)/more/profile.tsx

View workflow job for this annotation

GitHub Actions / validate

'error' is defined but never used

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);
}
});
Expand Down Expand Up @@ -98,16 +98,16 @@ const ProfileScreen: React.FC = () => {
[
{
text: 'Sluiten',
style: 'cancel'
style: 'cancel',
},
{
text: 'Verwijderen',
onPress() {
deleteTicket()
deleteTicket();
},
}
]
)
},
],
);
};

const deleteTicket = async () => {
Expand Down
22 changes: 11 additions & 11 deletions app/(tabs)/more/scan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const ScanScreen: React.FC = () => {
const [ticketHash, setTicketHash] = useState<string | null>(null);
const [isLit, setLit] = useState(false);

const toaster = useToast()
const toaster = useToast();

useEffect(() => {
if (ticketHash) {
Expand All @@ -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) {

Check failure on line 37 in app/(tabs)/more/scan.tsx

View workflow job for this annotation

GitHub Actions / validate

'error' is defined but never used

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);
}
Expand All @@ -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;
}

Expand Down
17 changes: 9 additions & 8 deletions app/+native-intent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -34,17 +34,18 @@ export function redirectSystemPath({
text: 'Top!',
style: 'cancel',
onPress() {
router.navigate('/more/profile')
router.navigate('/more/profile');
},
}
]
)
},
],
);
} catch (error) {

Check failure on line 42 in app/+native-intent.tsx

View workflow job for this annotation

GitHub Actions / validate

'error' is defined but never used
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';
Expand Down
68 changes: 35 additions & 33 deletions app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,40 +216,42 @@ const RootLayout = () => {
return null;
} else {
return (
<RootSiblingParent>
<DataContextProvider>
<GestureHandlerRootView>
<PaperProvider
theme={
colorScheme == 'dark' ? CustomDarkTheme : CustomDefaultTheme
}
>
<AlertsProvider>
<ToastProvider>
<ThemeProvider
value={
colorScheme == 'dark' ? CustomDarkTheme : CustomDefaultTheme
}
<RootSiblingParent>
<DataContextProvider>
<GestureHandlerRootView>
<PaperProvider
theme={
colorScheme == 'dark' ? CustomDarkTheme : CustomDefaultTheme
}
>
<AlertsProvider>
<ToastProvider>
<ThemeProvider
value={
colorScheme == 'dark'
? CustomDarkTheme
: CustomDefaultTheme
}
>
<Stack
screenOptions={{
headerShown: false,
}}
>
<Stack
screenOptions={{
headerShown: false,
}}
>
<Stack.Screen name="(tabs)" />
</Stack>
</ThemeProvider>
</ToastProvider>
</AlertsProvider>
</PaperProvider>
</GestureHandlerRootView>
<StatusBar
backgroundColor="transparent"
animated={true}
style="light"
/>
</DataContextProvider>
</RootSiblingParent>
<Stack.Screen name="(tabs)" />
</Stack>
</ThemeProvider>
</ToastProvider>
</AlertsProvider>
</PaperProvider>
</GestureHandlerRootView>
<StatusBar
backgroundColor="transparent"
animated={true}
style="light"
/>
</DataContextProvider>
</RootSiblingParent>
);
}
};
Expand Down
10 changes: 5 additions & 5 deletions components/Profile/NoProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -28,9 +28,9 @@ const NoProfile: React.FC = () => {
onPress: async () => {
await Linking.openSettings();
},
}
]
)
},
],
);
}
};

Expand Down

0 comments on commit 0140d83

Please sign in to comment.