Skip to content

Commit 5b5a8e7

Browse files
committed
initial component setup and edit actionsgroup
1 parent b2f9226 commit 5b5a8e7

File tree

5 files changed

+123
-6
lines changed

5 files changed

+123
-6
lines changed

src/assets/fontawesome.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
faArrowDown,
44
faArrowUp,
55
faEnvelope,
6+
faFileLines,
67
faListCheck,
78
faPaperclip,
89
faSquareCheck,
@@ -18,6 +19,7 @@ library.add(
1819
faArrowDown,
1920
faArrowUp,
2021
faEnvelope,
22+
faFileLines,
2123
faListCheck,
2224
faMinusSquare,
2325
faPlusSquare,
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import React from 'react'
2+
import PropTypes from 'prop-types'
3+
import { Table } from 'react-bootstrap'
4+
5+
const FilesTable = (addClass, files) => {
6+
let headers = ['']
7+
return (
8+
<Table striped bordered hover size='sm' className={`${addClass}`}>
9+
<thead>
10+
<tr>
11+
{headers.map((header) => {
12+
return (
13+
<th>
14+
15+
</th>
16+
)
17+
})}
18+
</tr>
19+
</thead>
20+
<tbody>
21+
{/* {files.map((file) => {
22+
return (
23+
<tr>
24+
25+
</tr>
26+
)
27+
})} */}
28+
</tbody>
29+
</Table>
30+
)
31+
}
32+
33+
FilesTable.propTypes = {
34+
addClass: PropTypes.string,
35+
}
36+
37+
FilesTable.defaultProps = {
38+
addClass: '',
39+
}
40+
41+
export default FilesTable
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react'
2+
import FilesTable from './FilesTable'
3+
4+
export default {
5+
title: 'Components/FilesTable',
6+
component: FilesTable,
7+
}
8+
9+
const Template = (args) => <FilesTable {...args} />
10+
11+
export const Default = Template.bind({})
12+
Default.args = {
13+
headers: [''],
14+
}

src/compounds/ActionsGroup/ActionsGroup.jsx

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import PropTypes from 'prop-types'
33
import { ListGroup } from 'react-bootstrap'
44
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
55
import SendMessage from './actions/SendMessage'
6+
import ViewFiles from './actions/ViewFiles'
67
import './actions-group.scss'
78

8-
const ActionsGroup = ({ handleSendingMessages }) => {
9+
const ActionsGroup = ({ files, handleSendingMessages }) => {
10+
console.log(files)
911
const [show, setShow] = useState(false)
1012
const [action, setAction] = useState(null)
1113

@@ -22,24 +24,42 @@ const ActionsGroup = ({ handleSendingMessages }) => {
2224
return (
2325
<>
2426
<ListGroup className='actions-group'>
25-
<ListGroup.Item action variant='primary' onClick={() => handleShow('SendMessage')}>
27+
{/* TODO(@summercook): return the below once the direction of
28+
https://github.com/scientist-softserv/webstore/issues/156 has been decided */}
29+
{/* <ListGroup.Item action variant='primary' onClick={() => handleShow('SendMessage')}>
2630
<FontAwesomeIcon icon='fa-envelope' />
2731
Send Message
32+
</ListGroup.Item> */}
33+
<ListGroup.Item action variant='primary' onClick={() => handleShow('ViewFiles')} role='presentation'>
34+
<FontAwesomeIcon icon='fa-file-lines' />
35+
View Files
2836
</ListGroup.Item>
2937
</ListGroup>
30-
{(action === 'SendMessage' && show)
38+
{/* TODO(@summercook): return the below once the direction of
39+
https://github.com/scientist-softserv/webstore/issues/156 has been decided */}
40+
{/* {(action === 'SendMessage' && show)
3141
&& (
3242
<SendMessage
3343
handleClose={handleClose}
3444
onSubmit={handleSendingMessages}
3545
/>
46+
)} */}
47+
{(action === 'ViewFiles' && show)
48+
&& (
49+
<ViewFiles
50+
show={show}
51+
handleClose={handleClose}
52+
files={files}
53+
/>
3654
)}
3755
</>
3856
)
3957
}
4058

41-
ActionsGroup.propTypes = {
42-
handleSendingMessages: PropTypes.func.isRequired,
43-
}
59+
// ActionsGroup.propTypes = {
60+
// TODO(@summercook): return the below once the direction of
61+
// https://github.com/scientist-softserv/webstore/issues/156 has been decided
62+
//handleSendingMessages: PropTypes.func.isRequired,
63+
// }
4464

4565
export default ActionsGroup
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React, { useState } from 'react'
2+
import PropTypes from 'prop-types'
3+
import { Offcanvas, Tab, Tabs } from 'react-bootstrap'
4+
import FilesTable from '../../../components/FilesTable/FilesTable'
5+
6+
const ViewFiles = ({ files, handleClose, show }) => {
7+
return (
8+
<Offcanvas show={show} onHide={handleClose} placement='end' scroll='true'>
9+
<Offcanvas.Header className='d-flex border-bottom px-3 py-2 bg-light' closeButton>
10+
<Offcanvas.Title>Documents</Offcanvas.Title>
11+
</Offcanvas.Header>
12+
<Offcanvas.Body className='border rounded p-2 m-3'>
13+
<Tabs
14+
defaultActiveKey="files"
15+
id="document-tabs"
16+
>
17+
<Tab eventKey="files" title="Attachments" className='p-2'>
18+
<FilesTable files={files} />
19+
</Tab>
20+
<Tab eventKey="status-updates" title="Status Updates" className='p-2'>
21+
goodbye
22+
</Tab>
23+
<Tab eventKey="payment-status-files" title="Payment Status Files" className='p-2'>
24+
goodbye
25+
</Tab>
26+
</Tabs>
27+
</Offcanvas.Body>
28+
</Offcanvas>
29+
)
30+
}
31+
32+
ViewFiles.propTypes = {
33+
addClass: PropTypes.string,
34+
}
35+
36+
ViewFiles.defaultProps = {
37+
addClass: '',
38+
}
39+
40+
export default ViewFiles

0 commit comments

Comments
 (0)