-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.js
More file actions
32 lines (27 loc) · 845 Bytes
/
Button.js
File metadata and controls
32 lines (27 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import React, { Component } from 'react';
import styled from 'styled-components';
import { Text } from 'react-native';
const primaryColor = '#5c3799';
const secondaryColor = '#fff';
const RMButtonStyled = styled.TouchableHighlight`
background: ${props => props.primary ? primaryColor : secondaryColor};
border-radius: 3px;
border: 1px solid ${props => !props.primary && primaryColor};
padding: 15px;
`;
const RMButtonTextStyled = styled.Text`
color: ${props => props.primary ? secondaryColor : primaryColor};
font-weight: bold;
`;
export class Button extends Component {
render() {
const { primary, children } = this.props;
return (
<RMButtonStyled primary={primary}>
<RMButtonTextStyled primary={primary}>
{children}
</RMButtonTextStyled>
</RMButtonStyled>
)
}
}