Skip to content

Commit

Permalink
[DUOS-3038][risk=no]Added divKey to pass key to notification component (
Browse files Browse the repository at this point in the history
  • Loading branch information
sjkobori authored Apr 4, 2024
1 parent 8267e12 commit 3246aee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/DuosHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ const DuosHeader = (props) => {
};

const makeNotifications = () => {
return state.notificationData.map((d, index) => <Notification notificationData={d} key={index} />);
return state.notificationData.map((d, index) => <Notification notificationData={d} key={index} divKey={index} />);
};

const toggleDrawer = (boolVal) => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/Notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import ReportIcon from '@mui/icons-material/Report';
import style from './Notification.module.css';

export const Notification = (props) => {
const {notificationData, key} = props;
let notificationDiv = <div key={key} style={{display: 'none'}}/>;
const {notificationData, divKey} = props;
let notificationDiv = <div key={divKey} style={{display: 'none'}}/>;

if (!isEmpty(notificationData)) {
const iconStyle = {
Expand Down Expand Up @@ -40,7 +40,7 @@ export const Notification = (props) => {
// eslint-disable-next-line react/no-children-prop
const content = <ReactMarkdown children={notificationData.message} className={style['underlined']}/>;
notificationDiv = <div
key={key}
key={divKey}
className={'row no-margin alert alert-' + notificationData.level}>
<div style={{float: 'left'}}>{icon}</div>
<div>{content}</div>
Expand Down

0 comments on commit 3246aee

Please sign in to comment.