aretherecookies-mobile/js/components/TopSaveButton.js
2019-06-22 15:48:52 +00:00

25 lines
484 B
JavaScript

// @flow
import React from 'react';
import { Text, TouchableOpacity } from 'react-native';
type Props = {
loading: boolean,
onSave: Function,
};
const TopSaveButton = ({ loading, onSave }: Props) => {
const textStyle = {
color: 'white',
marginRight: 20,
fontWeight: 'bold',
opacity: loading ? 0.7 : 1,
};
return (
<TouchableOpacity onPress={loading ? null : onSave}>
<Text style={textStyle}>SAVE</Text>
</TouchableOpacity>
);
};
export default TopSaveButton;