Skip to content

Commit

Permalink
[test-suite] Make checkbox states more distinguishable (#8214)
Browse files Browse the repository at this point in the history
  • Loading branch information
fson committed May 11, 2020
1 parent fd33e28 commit a4f269a
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions apps/test-suite/screens/SelectScreen.js
@@ -1,37 +1,24 @@
import Ionicons from '@expo/vector-icons/Ionicons';
import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';
import React from 'react';
import {
Alert,
FlatList,
Linking,
Platform,
StyleSheet,
Text,
TouchableOpacity,
View,
} from 'react-native';
import { Alert, FlatList, Linking, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { useSafeArea } from 'react-native-safe-area-context';

import { getTestModules } from '../TestModules';
import PlatformTouchable from '../components/PlatformTouchable';
import Colors from '../constants/Colors';

const prefix = Platform.select({ default: 'md', ios: 'ios' });

function ListItem({ title, onPressItem, selected, id }) {
function onPress() {
onPressItem(id);
}

const checkBox = selected ? 'checkbox' : 'checkbox-outline';

return (
<PlatformTouchable onPress={onPress}>
<View style={styles.listItem}>
<Text style={styles.label}>{title}</Text>
<Ionicons
<MaterialCommunityIcons
color={selected ? Colors.tintColor : 'black'}
name={`${prefix}-${checkBox}`}
name={selected ? 'checkbox-marked' : 'checkbox-blank-outline'}
size={24}
/>
</View>
Expand Down

0 comments on commit a4f269a

Please sign in to comment.