-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.tsx
40 lines (36 loc) · 976 Bytes
/
index.tsx
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
// FileButton Component
/**
* Button that opens the file modal
* @packageDocumentation
*/
import React from 'react';
import styled from 'styled-components';
import Button from '@material-ui/core/Button';
/** FileButton Props */
interface Props {
/** Visible if true else hidden */
isVisible: boolean;
/** Callback fired on button click */
onClick: (e: React.MouseEvent) => void;
/** FileButton id */
id: string;
}
const FileButtonContainer = styled(Button)<Props>`
margin-left: auto;
margin-right: auto;
visibility: ${({ isVisible }) => (isVisible ? 'visible' : 'hidden')};
`;
/** FileButton Props */
export const FileButton: React.FC<Props> = ({ onClick, isVisible, id }) => {
return (
<FileButtonContainer
onClick={onClick}
variant="contained"
isVisible={isVisible}
id={id}
>
Files
</FileButtonContainer>
);
};
export default FileButton;