-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.js
More file actions
54 lines (48 loc) · 1.11 KB
/
Button.js
File metadata and controls
54 lines (48 loc) · 1.11 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import normalize from '../utils/normalizeSizes';
import withPressAnimation from '../utils/withPressAnimation';
export const ButtonStyles = styled.View`
align-self: center;
justify-content: center;
background-color: #ffd200;
padding-horizontal: ${normalize(30)};
height: ${normalize(60)};
border-radius: ${normalize(30)};
align-items: center;
shadow-color: #ffd200;
shadow-opacity: 0.8;
shadow-radius: 30;
`;
export const TextStyles = styled.Text`
color: #000;
font-size: ${normalize(25)};
`;
/**
* Button component
*/
const Button = ({
children,
loading,
...props
}) => (
<ButtonStyles {...props}>
<TextStyles>{loading || children}</TextStyles>
</ButtonStyles>
);
Button.propTypes = {
/**
* Textual content which will be passed to component
*/
children: PropTypes.string,
/**
* Text for loading state (e.g. during form submission)
*/
loading: PropTypes.string,
};
Button.defaultProps = {
children: null,
loading: null,
};
export default withPressAnimation(Button);