@@ -2,13 +2,12 @@ import React, { useState } from 'react'
2
2
import PropTypes from 'prop-types'
3
3
import { ListGroup } from 'react-bootstrap'
4
4
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
5
- // import SendMessage from './actions/SendMessage'
5
+ import SendMessage from './actions/SendMessage'
6
6
import ViewFiles from './actions/ViewFiles'
7
7
import { allowNull } from '../../resources/utilityFunctions'
8
8
import './actions-group.scss'
9
9
10
- // TODO: add back handleSendingMessagesOrFiles into the props, removing for now to avoid console error. see below TODO.
11
- const ActionsGroup = ( { initialFiles } ) => {
10
+ const ActionsGroup = ( { handleSendingMessagesOrFiles, initialFiles } ) => {
12
11
const [ show , setShow ] = useState ( false )
13
12
const [ action , setAction ] = useState ( null )
14
13
@@ -24,15 +23,15 @@ const ActionsGroup = ({ initialFiles }) => {
24
23
return (
25
24
< >
26
25
< ListGroup className = 'actions-group' >
27
- { /* TODO(@summercook): return this and the below commented code
28
- once we are able to refactor posting messages & attachments */ }
29
- { /* <ListGroup.Item action variant='primary' onClick={() => handleShow('SendMessage')}>
26
+ < ListGroup . Item
27
+ action
28
+ onClick = { ( ) => handleShow ( 'SendMessage' ) }
29
+ >
30
30
< FontAwesomeIcon icon = 'fa-envelope' />
31
31
Send Message
32
- </ListGroup.Item> */ }
32
+ </ ListGroup . Item >
33
33
< ListGroup . Item
34
34
action
35
- variant = 'primary'
36
35
onClick = { ( ) => handleShow ( 'ViewFiles' ) }
37
36
role = 'presentation'
38
37
bsPrefix = 'bg-secondary-8 list-group-item'
@@ -41,19 +40,19 @@ const ActionsGroup = ({ initialFiles }) => {
41
40
View Files
42
41
</ ListGroup . Item >
43
42
</ ListGroup >
44
- { /* { (action === 'SendMessage' && show)
43
+ { ( action === 'SendMessage' && show )
45
44
&& (
46
45
< SendMessage
47
46
handleClose = { handleClose }
48
47
onSubmit = { handleSendingMessagesOrFiles }
49
48
/>
50
- )} */ }
49
+ ) }
51
50
{ ( action === 'ViewFiles' && show )
52
51
&& (
53
52
< ViewFiles
54
53
handleClose = { handleClose }
55
54
initialFiles = { initialFiles }
56
- // onSubmit={handleSendingMessagesOrFiles}
55
+ onSubmit = { handleSendingMessagesOrFiles }
57
56
/>
58
57
) }
59
58
</ >
0 commit comments