Skip to content

Commit 58e6a30

Browse files
committed
pass a bg color to the actions group
1 parent ec62824 commit 58e6a30

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/compounds/ActionsGroup/ActionsGroup.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import ViewFiles from './actions/ViewFiles'
77
import { allowNull } from '../../resources/utilityFunctions'
88
import './actions-group.scss'
99

10-
const ActionsGroup = ({ handleSendingMessagesOrFiles, initialFiles }) => {
10+
const ActionsGroup = ({ backgroundColor, handleSendingMessagesOrFiles, initialFiles }) => {
1111
const [show, setShow] = useState(false)
1212
const [action, setAction] = useState(null)
1313

@@ -20,12 +20,14 @@ const ActionsGroup = ({ handleSendingMessagesOrFiles, initialFiles }) => {
2020
setAction(null)
2121
setShow(false)
2222
}
23+
2324
return (
2425
<>
2526
<ListGroup className='actions-group'>
2627
<ListGroup.Item
2728
action
2829
onClick={() => handleShow('SendMessage')}
30+
bsPrefix={`bg-${backgroundColor}-8 list-group-item`}
2931
>
3032
<FontAwesomeIcon icon='fa-envelope' />
3133
Send Message
@@ -34,7 +36,7 @@ const ActionsGroup = ({ handleSendingMessagesOrFiles, initialFiles }) => {
3436
action
3537
onClick={() => handleShow('ViewFiles')}
3638
role='presentation'
37-
bsPrefix='bg-secondary-8 list-group-item'
39+
bsPrefix={`bg-${backgroundColor}-6 list-group-item`}
3840
>
3941
<FontAwesomeIcon icon='fa-file-lines' />
4042
View Files
@@ -60,6 +62,7 @@ const ActionsGroup = ({ handleSendingMessagesOrFiles, initialFiles }) => {
6062
}
6163

6264
ActionsGroup.propTypes = {
65+
backgroundColor: PropTypes.string,
6366
handleSendingMessagesOrFiles: PropTypes.func.isRequired,
6467
initialFiles: PropTypes.arrayOf(
6568
PropTypes.shape({
@@ -76,4 +79,8 @@ ActionsGroup.propTypes = {
7679
).isRequired,
7780
}
7881

82+
ActionsGroup.defaultProps = {
83+
backgroundColor: 'secondary'
84+
}
85+
7986
export default ActionsGroup

src/compounds/ActionsGroup/ActionsGroup.stories.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const Template = (args) => <ActionsGroup {...args} />
1010

1111
export const Default = Template.bind({})
1212
Default.args = {
13+
backgroundColor: 'secondary',
1314
// TODO(alishaevn): figure out why the story actions aren't working *shakes fist*
1415
handleSendingMessages: ({ message, files }) => {
1516
console.log('the message is:', message)

0 commit comments

Comments
 (0)