Skip to content

Commit 6c92684

Browse files
committed
PM-1904 - show AI icon banner
1 parent 1365c0e commit 6c92684

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed
Lines changed: 10 additions & 0 deletions
Loading

src/apps/review/src/pages/active-review-assignements/ActiveReviewsPage/ActiveReviewsPage.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import classNames from 'classnames'
1717
import { Pagination, TableLoading } from '~/apps/admin/src/lib'
1818
import { Sort } from '~/apps/admin/src/platform/gamification-admin/src/game-lib'
1919
import { Button, IconOutline, InputText } from '~/libs/ui'
20+
import { NotificationContextType, useNotification } from '~/libs/shared'
2021

2122
import { CHALLENGE_TYPE_SELECT_ALL_OPTION } from '../../../config/index.config'
2223
import {
@@ -39,6 +40,7 @@ import { SelectOption } from '../../../lib/models/SelectOption.model'
3940
import { getAllowedTypeAbbreviationsByTrack } from '../../../lib/utils/challengeTypesByTrack'
4041

4142
import styles from './ActiveReviewsPage.module.scss'
43+
import { IconAiReview } from '../../../lib/assets/icons'
4244

4345
interface Props {
4446
className?: string
@@ -50,6 +52,8 @@ const DEFAULT_SORT: Sort = {
5052
}
5153

5254
export const ActiveReviewsPage: FC<Props> = (props: Props) => {
55+
const { showBannerNotification, removeNotification }: NotificationContextType = useNotification()
56+
5357
const {
5458
loginUserInfo,
5559
}: ReviewAppContextModel = useContext(ReviewAppContext)
@@ -193,6 +197,17 @@ export const ActiveReviewsPage: FC<Props> = (props: Props) => {
193197
})
194198
}, [loadActiveReviews, sort])
195199

200+
201+
useEffect(() => {
202+
const notification = showBannerNotification({
203+
id: 'ai-review-icon-notification',
204+
icon: <IconAiReview />,
205+
message: `Challenges with this icon indicates that an ​​AI
206+
review has been completed in particular phase.`,
207+
})
208+
return () => notification && removeNotification(notification.id)
209+
}, [showBannerNotification])
210+
196211
return (
197212
<PageWrapper
198213
pageTitle='My Active Challenges'

src/libs/ui/lib/components/notification/banner/NotificationBanner.module.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,7 @@
3535
.icon {
3636
flex: 0 0;
3737
margin-right: $sp-2;
38+
> svg path {
39+
fill: $tc-white;
40+
}
3841
}

src/libs/ui/lib/components/notification/banner/NotificationBanner.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ const NotificationBanner: FC<NotificationBannerProps> = props => {
2121
return (
2222
<div className={styles.wrap}>
2323
<div className={styles.inner}>
24-
{props.icon || (
25-
<div className={styles.icon}>
24+
<div className={styles.icon}>
25+
{props.icon || (
2626
<InformationCircleIcon className='icon-xl' />
27-
</div>
28-
)}
27+
)}
28+
</div>
2929

3030
{props.content}
3131

0 commit comments

Comments
 (0)