Skip to content

Instantly share code, notes, and snippets.

@ohenrique
Created January 10, 2020 19:11
Show Gist options
  • Select an option

  • Save ohenrique/cd21ecab40a37473dd676d376abd6ea9 to your computer and use it in GitHub Desktop.

Select an option

Save ohenrique/cd21ecab40a37473dd676d376abd6ea9 to your computer and use it in GitHub Desktop.
import React from 'react';
import { StyleSheet, TouchableOpacity, Dimensions } from "react-native"
import MidwayText from './midway-text';
// eslint-disable-next-line no-unused-vars
import { primary, secondary } from "./types/button-types"
const MidwayButton = props => {
const { textStyle, ...buttonStyle } = props.type || primary;
return (
<TouchableOpacity
style={[
styles.button,
buttonStyle,
props.style,
{
borderRadius: 20,
width: Dimensions.getWidth() - 296
}
]}
>
<MidwayText style={textStyle}>{props.children}</MidwayText>
</TouchableOpacity>
);
};
// Estilos do componente button e container
const styles = StyleSheet.create({
button: {
alignItems: 'center',
borderRadius: 20,
height: 40,
justifyContent: 'center',
textAlignVertical: 'center',
margin: -5
},
container: {
margin: 15
}
});
export default MidwayButton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment