From 6501c015254df239e1418a0a88d27a685cd57a30 Mon Sep 17 00:00:00 2001 From: Niklas Date: Fri, 22 Jan 2021 16:19:44 +0100 Subject: [PATCH] added touchables to the buttons --- src/components/DeckButton.tsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/components/DeckButton.tsx b/src/components/DeckButton.tsx index 470bf58..c5911e4 100644 --- a/src/components/DeckButton.tsx +++ b/src/components/DeckButton.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import {StyleSheet, Text, View} from 'react-native'; +import {StyleSheet, Text, TouchableHighlight, View} from 'react-native'; interface Props { text: string; @@ -9,7 +9,13 @@ export default function DeckButton(props: Props) { return ( <> - {props.text} + console.log(props.text)} + onLongPress={() => console.log('long press')}> + {props.text} + ); @@ -20,9 +26,16 @@ const style = StyleSheet.create({ backgroundColor: '#ff4000', flexBasis: (1 / 3) * 100 + '%', height: 80, + borderColor: '#94f713', + borderWidth: 1, + flex: 1, + }, + touchable: { + width: '100%', + height: '100%', }, text: { - backgroundColor: '#ffbf00', + //backgroundColor: '#ffbf00', textAlign: 'center', }, });