Created
January 10, 2020 19:11
-
-
Save ohenrique/cd21ecab40a37473dd676d376abd6ea9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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