12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import React, { Component } from 'react'
- import { Text, View } from 'react-native'
- import PropTypes from 'prop-types'
- export default class Tips extends Component {
- static defaultProps = {
- bgColor: '#000',
- fColor: '#fff',
- borderColor: null,
- borderWidth:null
- };
- static propTypes = {
- //按钮宽度
- width: PropTypes.string.isRequired,
- //按钮高度
- height: PropTypes.string.isRequired,
- //按钮的圆度
- borderRadius: PropTypes.string.isRequired,
- //背景颜色
- bgColor: PropTypes.string,
- //字体颜色
- fColor: PropTypes.string,
- //文本
- text: PropTypes.string.isRequired,
- }
- render() {
- let { bgColor, fColor, text, width, height, borderRadius, borderColor, fSize } = this.props
- return (
- <View style={{
- width: width,
- height: height,
- backgroundColor: bgColor,
- justifyContent: "center",
- alignItems: "center",
- borderRadius: borderRadius,
- borderWidth: 1,
- borderColor: borderColor
- }}>
- <Text style={{
- color: fColor,
- fontSize:fSize
- }}
- >{text}</Text>
- </View>
- )
- }
- }
|