Refactor admin approval handling by introducing PendingApprovalView component for consistent messaging across screens

This commit is contained in:
bobbert committed 2026-04-09 15:22:48 +01:00
1 parent f69ead8e45
commit 191eb8944c
5 files changed
+106 -20

No files matched your search

+2 -5
View File
@@ -3,6 +3,7 @@ import {ActivityIndicator, Alert, Pressable, ScrollView, StyleSheet, Text, View}
import Screen from '../layout/Screen';
import Card from '../UI/Card';
import {Button} from '../UI/Button';
import PendingApprovalView from '../UI/PendingApprovalView';
import useGameHook from '../../hooks/useGameHook';
import {getSession} from '../../hooks/SessionStore';
@@ -185,11 +186,7 @@ const LeaderboardScreen = ({navigation, route}) => {
}
if (session.isPendingAdmin && !session.isAcceptedAdmin) {
return (
<Screen style={styles.center}>
<Text style={styles.body}>Waiting for admin approval. You will get access once approved.</Text>
</Screen>
);
return <PendingApprovalView/>;
}
if (isBusiness && isAdmin && !selectedDepartment) {