Skip to content

Commit 2299932

Browse files
committed
carry the actions bg color through to the actions
1 parent 58e6a30 commit 2299932

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

src/compounds/ActionsGroup/ActionsGroup.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ const ActionsGroup = ({ backgroundColor, handleSendingMessagesOrFiles, initialFi
4545
{(action === 'SendMessage' && show)
4646
&& (
4747
<SendMessage
48+
backgroundColor={backgroundColor}
4849
handleClose={handleClose}
4950
onSubmit={handleSendingMessagesOrFiles}
5051
/>
5152
)}
5253
{(action === 'ViewFiles' && show)
5354
&& (
5455
<ViewFiles
56+
backgroundColor={backgroundColor}
5557
handleClose={handleClose}
5658
initialFiles={initialFiles}
5759
onSubmit={handleSendingMessagesOrFiles}

src/compounds/ActionsGroup/actions/SendMessage.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { apiV2CompatibleStrings, convertToBase64 } from '../../../resources/utilityFunctions'
1212
import './styles.scss'
1313

14-
const SendMessage = ({ onSubmit, handleClose }) => {
14+
const SendMessage = ({ backgroundColor, onSubmit, handleClose }) => {
1515
const messageRef = useRef(null)
1616
const fileRef = useRef(null)
1717
const [files, setFiles] = useState([])
@@ -45,7 +45,7 @@ const SendMessage = ({ onSubmit, handleClose }) => {
4545

4646
return (
4747
<Modal show onHide={handleClose}>
48-
<Modal.Header closeButton>
48+
<Modal.Header closeButton className={`bg-${backgroundColor}-8`}>
4949
<Modal.Title>Send a Message</Modal.Title>
5050
</Modal.Header>
5151
<Form>
@@ -88,8 +88,13 @@ const SendMessage = ({ onSubmit, handleClose }) => {
8888
}
8989

9090
SendMessage.propTypes = {
91+
backgroundColor: PropTypes.string,
9192
onSubmit: PropTypes.func.isRequired,
9293
handleClose: PropTypes.func.isRequired,
9394
}
9495

96+
SendMessage.defaultProps = {
97+
backgroundColor: 'secondary'
98+
}
99+
95100
export default SendMessage

src/compounds/ActionsGroup/actions/ViewFiles.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import FilesTable from '../../../components/FilesTable/FilesTable'
1010
import { allowNull } from '../../../resources/utilityFunctions'
1111

12-
const ViewFiles = ({ initialFiles, handleClose }) => {
12+
const ViewFiles = ({ backgroundColor, initialFiles, handleClose }) => {
1313
const documentTabs = [
1414
{
1515
eventKey: 'files',
@@ -25,7 +25,7 @@ const ViewFiles = ({ initialFiles, handleClose }) => {
2525

2626
return (
2727
<Offcanvas show onHide={handleClose} placement='end' scroll='true'>
28-
<Offcanvas.Header className='d-flex border-bottom px-3 py-2 bg-secondary-8' closeButton>
28+
<Offcanvas.Header className={`d-flex border-bottom px-3 py-2 bg-${backgroundColor}-8`} closeButton>
2929
<Offcanvas.Title>Documents</Offcanvas.Title>
3030
</Offcanvas.Header>
3131
<Offcanvas.Body className='border rounded p-2 m-3'>
@@ -54,6 +54,7 @@ const ViewFiles = ({ initialFiles, handleClose }) => {
5454
}
5555

5656
ViewFiles.propTypes = {
57+
backgroundColor: PropTypes.string,
5758
initialFiles: PropTypes.arrayOf(
5859
PropTypes.shape({
5960
contentLength: PropTypes.string.isRequired,
@@ -70,4 +71,8 @@ ViewFiles.propTypes = {
7071
handleClose: PropTypes.func.isRequired,
7172
}
7273

74+
ViewFiles.defaultProps = {
75+
backgroundColor: 'secondary'
76+
}
77+
7378
export default ViewFiles

0 commit comments

Comments
 (0)