58 lines
1.4 KiB
TypeScript
58 lines
1.4 KiB
TypeScript
import { StyleSheet, Text, View } from 'react-native';
|
|
|
|
import { BackHomeButton } from '../components/BackHomeButton';
|
|
import { MenuButton } from '../components/MenuButton';
|
|
import { ScreenLayout } from '../components/ScreenLayout';
|
|
import {
|
|
policyRoutes,
|
|
routeDefinitions,
|
|
type RouteName,
|
|
} from '../navigation/routes';
|
|
import { defaultTextStyle } from '../styles/typography';
|
|
|
|
type PoliciesScreenProps = Readonly<{
|
|
goHome: () => void;
|
|
navigate: (routeName: RouteName) => void;
|
|
}>;
|
|
|
|
export function PoliciesScreen({ goHome, navigate }: PoliciesScreenProps) {
|
|
return (
|
|
<ScreenLayout title={routeDefinitions.policies.title}>
|
|
<Text style={styles.description}>
|
|
Review the policies for playing and using this app.
|
|
</Text>
|
|
<View style={styles.menu}>
|
|
{policyRoutes.map(routeName => (
|
|
<MenuButton
|
|
key={routeName}
|
|
label={routeDefinitions[routeName].label}
|
|
onPress={() => navigate(routeName)}
|
|
testID={`policy-${routeName}`}
|
|
/>
|
|
))}
|
|
</View>
|
|
<View style={styles.homeAction}>
|
|
<BackHomeButton onPress={goHome} />
|
|
</View>
|
|
</ScreenLayout>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
description: {
|
|
...defaultTextStyle,
|
|
color: '#c9c1b3',
|
|
fontSize: 16,
|
|
lineHeight: 24,
|
|
marginBottom: 12,
|
|
textAlign: 'center',
|
|
},
|
|
homeAction: {
|
|
marginTop: 12,
|
|
},
|
|
menu: {
|
|
gap: 12,
|
|
width: '100%',
|
|
},
|
|
});
|