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
55
56
57
58
59
60
61
62
63
64
65
|
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Add from '@material-ui/icons/Add';
import { Fab, Tooltip } from '@material-ui/core';
import ComposeEmailForm from './ComposeEmailForm';
import FloatingPanel from '../Panel/FloatingPanel';
import styles from './email-jss';
class ComposeEmail extends React.Component {
render() {
const {
classes,
open,
closeForm,
sendEmail,
to,
subject,
validMail,
inputChange,
compose
} = this.props;
const branch = '';
return (
<div>
<Tooltip title="Compose Email">
<Fab color="secondary" onClick={() => compose()} className={classes.addBtn}>
<Add />
</Fab>
</Tooltip>
<FloatingPanel
openForm={open}
branch={branch}
closeForm={closeForm}
title="Compose Email"
extraSize
>
<ComposeEmailForm
to={to}
subject={subject}
validMail={validMail}
sendEmail={sendEmail}
closeForm={closeForm}
inputChange={inputChange}
/>
</FloatingPanel>
</div>
);
}
}
ComposeEmail.propTypes = {
classes: PropTypes.object.isRequired,
open: PropTypes.bool.isRequired,
to: PropTypes.string.isRequired,
subject: PropTypes.string.isRequired,
validMail: PropTypes.string.isRequired,
compose: PropTypes.func.isRequired,
closeForm: PropTypes.func.isRequired,
sendEmail: PropTypes.func.isRequired,
inputChange: PropTypes.func.isRequired,
};
export default withStyles(styles)(ComposeEmail);
|