/** * Copyright (c) 2019 Paul Armstrong */ import React from 'react'; import { setSizeKey } from '../../store/actions'; import SizeKey from './Key'; import { State } from '../../store/types'; import { StyleSheet, View } from 'react-native'; import { useDispatch, useSelector } from 'react-redux'; interface Props { keys: Array; } const SizeKeyPicker = (props: Props): React.ReactElement => { const { keys } = props; const selected = useSelector((state: State) => state.sizeKey); const dispatch = useDispatch(); const handleSelect = React.useCallback( (key: string): void => { dispatch(setSizeKey(key)); }, [dispatch] ); return ( {keys.map((key) => ( ))} ); }; const styles = StyleSheet.create({ root: {}, button: {}, }); export default SizeKeyPicker;