Skip to content

Instantly share code, notes, and snippets.

@bogoslavskiy
Created March 5, 2020 17:51
Show Gist options
  • Save bogoslavskiy/4214e5c5860f1b01613e9a391662d2e8 to your computer and use it in GitHub Desktop.
Save bogoslavskiy/4214e5c5860f1b01613e9a391662d2e8 to your computer and use it in GitHub Desktop.
import React from 'react';
import { TouchableOpacity, Text, Platform } from 'react-native';
interface ButtonProps {
title: string;
onPress?: () => void;
disabled?: boolean;
}
export const Button: React.FC<ButtonProps> = ({ title, onPress, disabled }) => (
<TouchableOpacity
style={{ paddingHorizontal: 10 }}
onPress={onPress}
disabled={disabled}
>
<Text style={{ color: '#007BFF', fontSize: 17, fontWeight: '500' }}>
{Platform.OS === 'android' ? title.toUpperCase() : title}
</Text>
</TouchableOpacity>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment