diff --git a/src/components/Notifications/Notifications.tsx b/src/components/Notifications/Notifications.tsx index 7859eea2..90757ffb 100644 --- a/src/components/Notifications/Notifications.tsx +++ b/src/components/Notifications/Notifications.tsx @@ -1,7 +1,7 @@ import React, { useMemo } from 'react' import NotificationsFeed from './NotificationsFeed' -import { ActiveTab, DCLNotification, NotificationLocale } from './types' +import { NotificationActiveTab, DCLNotification, NotificationLocale } from './types' import NotificationBell from '../Icons/Notifications/NotificationBell' import NotificationBellActive from '../Icons/Notifications/NotificationBellActive' @@ -15,11 +15,11 @@ export interface NotificationsProps { isLoading: boolean locale: NotificationLocale isOnboarding: boolean - activeTab: ActiveTab + activeTab: NotificationActiveTab onClick: (e: React.MouseEvent) => void onChangeTab: ( e: React.MouseEvent, - newActiveTab: ActiveTab + newActiveTab: NotificationActiveTab ) => void onBegin: (e: React.MouseEvent) => void onClose: ( diff --git a/src/components/Notifications/NotificationsFeed.tsx b/src/components/Notifications/NotificationsFeed.tsx index 38a435ad..cc74b3b4 100644 --- a/src/components/Notifications/NotificationsFeed.tsx +++ b/src/components/Notifications/NotificationsFeed.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useMemo } from 'react' import { Loader } from '../Loader/Loader' -import { ActiveTab, DCLNotification, NotificationLocale } from './types' +import { NotificationActiveTab, DCLNotification, NotificationLocale } from './types' import ItemSoldNotification from './NotificationTypes/ItemSoldNotification' import RoyaltiesEarnedNotification from './NotificationTypes/RoyaltiesEarnedNotification' @@ -23,11 +23,11 @@ interface NotificationsFeedProps { isLoading: boolean locale: NotificationLocale isOnboarding: boolean - activeTab: ActiveTab + activeTab: NotificationActiveTab isOpen: boolean onChangeTab: ( e: React.MouseEvent, - newActiveTab: ActiveTab + newActiveTab: NotificationActiveTab ) => void onBegin: (e: React.MouseEvent) => void onClose: ( @@ -327,10 +327,10 @@ const Feed = ({ previousNotifications: DCLNotification[] readNotifications: DCLNotification[] locale: NotificationLocale - activeTab: ActiveTab + activeTab: NotificationActiveTab onChangeTab: ( e: React.MouseEvent, - newActiveTab: ActiveTab + newActiveTab: NotificationActiveTab ) => void }) => ( <> @@ -340,14 +340,14 @@ const Feed = ({
onChangeTab(e, 'newest')} + active={activeTab === NotificationActiveTab.NEWEST} + onClick={(e) => onChangeTab(e, NotificationActiveTab.NEWEST)} > {i18N[locale].feed.tabs.newest} onChangeTab(e, 'read')} + active={activeTab === NotificationActiveTab.READ} + onClick={(e) => onChangeTab(e, NotificationActiveTab.READ)} > {i18N[locale].feed.tabs.read} diff --git a/src/components/Notifications/types.ts b/src/components/Notifications/types.ts index 3fa1ec40..75e08112 100644 --- a/src/components/Notifications/types.ts +++ b/src/components/Notifications/types.ts @@ -1,6 +1,9 @@ import { NFTCategory, Rarity } from '@dcl/schemas' -export type ActiveTab = 'newest' | 'read' +export enum NotificationActiveTab { + NEWEST = "newest", + READ = "read" +} export type NotificationLocale = 'en' | 'es' | 'zh'