From 3ae280d7b4e971cb2802acbd36cb21a33a6256dd Mon Sep 17 00:00:00 2001 From: Enzo Mourany Date: Mon, 16 Jan 2023 16:49:43 +0100 Subject: [PATCH] feat: change style ActionButton --- src/components/NavigateButton.tsx | 22 +++++++-- src/components/input/ActionButton.tsx | 66 ++++++++++++++------------- src/screens/SetupTabataScreen.tsx | 9 ++-- 3 files changed, 56 insertions(+), 41 deletions(-) diff --git a/src/components/NavigateButton.tsx b/src/components/NavigateButton.tsx index 39888bc..4f4adee 100644 --- a/src/components/NavigateButton.tsx +++ b/src/components/NavigateButton.tsx @@ -1,13 +1,25 @@ -import {StyleSheet, Text, View} from 'react-native'; import React from 'react'; +import {StyleSheet, Text, Dimensions} from 'react-native'; +import LinearGradient from 'react-native-linear-gradient'; import {Colors} from '../styles/Styles'; -const StartButton: React.FC = () => { +const { width, height } = Dimensions.get('window'); + +interface StartButtonProps { + text: string; +} + +const StartButton: React.FC = ({ text }) => { return ( - - Run - + + {text} + ); }; diff --git a/src/components/input/ActionButton.tsx b/src/components/input/ActionButton.tsx index eab839c..d84a8c7 100644 --- a/src/components/input/ActionButton.tsx +++ b/src/components/input/ActionButton.tsx @@ -1,47 +1,51 @@ import React from 'react'; -import { StyleSheet, Text, TouchableOpacity, Dimensions } from 'react-native'; -import { Colors } from '../../styles/Styles'; +import {StyleSheet, Text, Dimensions} from 'react-native'; +import LinearGradient from 'react-native-linear-gradient'; -const { width } = Dimensions.get('window'); +import {Colors} from '../../styles/Styles'; + +const { width, height } = Dimensions.get('window'); interface ActionButtonProps { - onPress: () => void; - buttonText: string; - style?: object; - fontSize?: number; - } + text: string; +} -const ActionButton: React.FC = ({ onPress, buttonText, style, fontSize = 19 }) => ( - - - {buttonText} - - -); +const ActionButton: React.FC = ({ text }) => { + return ( + + {text} + + ); +}; export default ActionButton; const styles = StyleSheet.create({ - container: { - justifyContent: 'center', - width: width * 0.8, - height: 60, - borderRadius: 18, + button: { backgroundColor: Colors.cyan, - shadowRadius: 13, - shadowOffset: { width: 0, height: 8 }, + blurRadius: 20, + width: width * 0.9, + height: 60, + borderRadius: 25, + justifyContent: 'center', + alignItems: 'center', shadowColor: Colors.cyan, + shadowOffset: { + width: 0, + height: 0, + }, + shadowOpacity: 0.3, + shadowRadius: 5, }, buttonText: { - color: Colors.black, - fontSize: 19, - fontWeight: 'bold', - textAlign: 'center', + color: Colors.white, + fontSize: 20, + fontWeight: '500', letterSpacing: 1, }, }); diff --git a/src/screens/SetupTabataScreen.tsx b/src/screens/SetupTabataScreen.tsx index 66f670b..620ec4e 100644 --- a/src/screens/SetupTabataScreen.tsx +++ b/src/screens/SetupTabataScreen.tsx @@ -1,4 +1,4 @@ -import { SafeAreaView, StyleSheet, Image, Dimensions, View } from 'react-native'; +import { SafeAreaView, StyleSheet, Image, Dimensions, View, TouchableOpacity } from 'react-native'; import React from 'react'; import { NavigationProp } from '@react-navigation/native'; @@ -25,10 +25,9 @@ const SetupTabataScreen: React.FC = ({ navigation }) => - navigation.navigate('Countdown')} - buttonText="Start Tabata" - /> + navigation.navigate('Countdown')}> + + ) };