Skip to content

Commit

Permalink
EPMRPP-97554 || review fix - 2
Browse files Browse the repository at this point in the history
  • Loading branch information
maria-hambardzumian committed Dec 20, 2024
1 parent 27bbf9b commit 084750f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
4 changes: 1 addition & 3 deletions src/components/notification/notification.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@
.title {
text-align: start;
font-family: var(--rp-ui-base-font-family);
@include font-scale();
@include font-scale(x2-medium);
font-weight: $fw-semi-bold;
line-height: 24px;
font-size: 15px;
color: var(--rp-ui-base-bg-000);
display: -webkit-box;
max-width: 100%;
Expand Down
13 changes: 4 additions & 9 deletions src/components/notification/notification.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CSSProperties, FC, ReactElement, useEffect } from 'react';
import { FC, ReactElement, useEffect } from 'react';
import { NotificationProps, NotificationType } from '@components/notification/types';
import styles from './notification.module.scss';
import classNames from 'classnames/bind';
import { CloseIcon, ErrorIcon, InfoIcon, SuccessIcon } from '@/components';
import { CloseIcon, ErrorIcon, InfoIcon, SuccessIcon } from '@components/icons';

const cx = classNames.bind(styles);
const ERROR_DURATION = 7000;
Expand All @@ -15,7 +15,6 @@ export const Notification: FC<NotificationProps> = ({
icon = null,
type = NotificationType.INFO,
duration = DEFAULT_DURATION,
description,
className,
}): ReactElement => {
const adjustedDuration = type === NotificationType.ERROR ? ERROR_DURATION : duration;
Expand All @@ -41,14 +40,10 @@ export const Notification: FC<NotificationProps> = ({
}
};
return (
<div
className={cx('notification-container', type, className)}
style={{ '--duration': `${duration}ms` } as CSSProperties}
>
<div className={cx('notification-container', type, className)}>
<div className={cx('icon-wrapper')}>{getIcon()}</div>
<div className={cx('content-wrapper')}>
<div className={cx('title')}>{title}</div>
{description && <div className={cx('description')}>{description}</div>}
<h2 className={cx('title')}>{title}</h2>
</div>
<button
className={cx('close-button')}
Expand Down
3 changes: 1 addition & 2 deletions src/components/notification/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactElement, ReactNode } from 'react';
import { ReactElement } from 'react';
export enum NotificationType {
INFO = 'info',
SUCCESS = 'success',
Expand All @@ -11,6 +11,5 @@ export interface NotificationProps {
icon?: ReactElement | null;
type?: NotificationType;
duration?: number;
description?: ReactNode;
className?: string;
}

0 comments on commit 084750f

Please sign in to comment.