Skip to content

Commit

Permalink
EPMRPP-97554 || Removed uid from System Alert
Browse files Browse the repository at this point in the history
  • Loading branch information
maria-hambardzumian committed Dec 23, 2024
1 parent a149e3e commit b152ba0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/components/systemAlert/systemAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const ERROR_DURATION = 7000;
const DEFAULT_DURATION = 4000;

export const SystemAlert: FC<SystemAlertProps> = ({
uid,
title,
onClose,
icon = null,
Expand All @@ -21,11 +20,11 @@ export const SystemAlert: FC<SystemAlertProps> = ({

useEffect(() => {
const timer = setTimeout(() => {
onClose(uid);
onClose();
}, adjustedDuration);

return () => clearTimeout(timer);
}, [adjustedDuration, uid, onClose]);
}, [adjustedDuration, onClose]);

const getIcon = (): ReactElement | null => {
switch (type) {
Expand All @@ -47,7 +46,7 @@ export const SystemAlert: FC<SystemAlertProps> = ({
</div>
<button
className={cx('close-button')}
onClick={() => onClose(uid)}
onClick={() => onClose()}
aria-label="close system alert"
>
<CloseIcon />
Expand Down
3 changes: 1 addition & 2 deletions src/components/systemAlert/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ export enum SystemAlertType {
ERROR = 'error',
}
export interface SystemAlertProps {
uid: string | number;
title: string;
onClose: (id: string | number) => void;
onClose: () => void;
icon?: ReactElement | null;
type?: SystemAlertType;
duration?: number;
Expand Down

0 comments on commit b152ba0

Please sign in to comment.