diff --git a/src/assets/locales/de/notification.json b/src/assets/locales/de/notification.json index 6cfca5028..16e6df352 100644 --- a/src/assets/locales/de/notification.json +++ b/src/assets/locales/de/notification.json @@ -122,19 +122,23 @@ "unread": "Ungelesen", "all": { "title": "All notifications", - "description": "Messaged for required action from your side" + "description": "Messaged for required action from your side", + "countTitle": "new" }, "info": { "title": "Info notifications", - "description": "Changes of assigned roles or newly created tech users" + "description": "Changes of assigned roles or newly created tech users", + "countTitle": "new" }, "app": { "title": "App notifications", - "description": "App publish notifications, request, activations, etc." + "description": "App publish notifications, request, activations, etc.", + "countTitle": "new" }, "withaction": { "title": "Action Required", - "description": "Your action is needed" + "description": "Your action is needed", + "countTitle": "to do" } }, "tooltip": { diff --git a/src/assets/locales/en/notification.json b/src/assets/locales/en/notification.json index b2b25948b..6313e9791 100644 --- a/src/assets/locales/en/notification.json +++ b/src/assets/locales/en/notification.json @@ -118,19 +118,23 @@ "unread": "Unread First", "all": { "title": "All notifications", - "description": "Messaged for required action from your side" + "description": "Messaged for required action from your side", + "countTitle": "new" }, "info": { "title": "Info notifications", - "description": "Changes of assigned roles or newly created tech users" + "description": "Changes of assigned roles or newly created tech users", + "countTitle": "new" }, "app": { "title": "App notifications", - "description": "App publish notifications, request, activations, etc." + "description": "App publish notifications, request, activations, etc.", + "countTitle": "new" }, "withaction": { "title": "Action Required", - "description": "Your action is needed" + "description": "Your action is needed", + "countTitle": "to do" } }, "tooltip": { diff --git a/src/components/pages/NotificationCenter/index.tsx b/src/components/pages/NotificationCenter/index.tsx index c279d15ee..cbabff982 100644 --- a/src/components/pages/NotificationCenter/index.tsx +++ b/src/components/pages/NotificationCenter/index.tsx @@ -107,10 +107,10 @@ export default function NotificationCenter() { >([]) const [paginationData, setPaginationData] = useState() - const setView = (e: React.MouseEvent) => { - setFilterOption(e.currentTarget.value) + const setView = (val: string) => { setLoaded(true) setPage(0) + setFilterOption(val) } useEffect(() => { @@ -163,6 +163,7 @@ export default function NotificationCenter() { buttonDescription: t('sortOptions.all.description'), onButtonClick: setView, count: getTotalCount(pages?.unread), + countTitle: t('sortOptions.all.countTitle'), }, { buttonText: t('sortOptions.app.title'), @@ -170,6 +171,7 @@ export default function NotificationCenter() { buttonDescription: t('sortOptions.app.description'), onButtonClick: setView, count: pages?.offerUnread || 0, + countTitle: t('sortOptions.app.countTitle'), }, { buttonText: t('sortOptions.info.title'), @@ -177,6 +179,7 @@ export default function NotificationCenter() { buttonDescription: t('sortOptions.info.description'), onButtonClick: setView, count: pages?.infoUnread || 0, + countTitle: t('sortOptions.info.countTitle'), }, { buttonText: t('sortOptions.withaction.title'), @@ -184,6 +187,7 @@ export default function NotificationCenter() { buttonDescription: t('sortOptions.withaction.description'), onButtonClick: setView, count: pages?.actionRequired || 0, + countTitle: t('sortOptions.withaction.countTitle'), }, ] diff --git a/src/components/shared/frame/FramedSelector/index.tsx b/src/components/shared/frame/FramedSelector/index.tsx index dbba8306a..b01b2fd22 100644 --- a/src/components/shared/frame/FramedSelector/index.tsx +++ b/src/components/shared/frame/FramedSelector/index.tsx @@ -27,7 +27,8 @@ export interface Buttons { buttonValue: string buttonDescription: string count: string | number - onButtonClick?: React.MouseEventHandler + onButtonClick: (val: string) => void + countTitle: string } export interface FramedSelectorProps { @@ -45,6 +46,7 @@ export const FramedSelector = ({ views, activeView }: FramedSelectorProps) => { buttonDescription, onButtonClick, count, + countTitle, }) => ( { }} key={buttonText} className="frameButton" - onClick={onButtonClick} + onClick={() => onButtonClick(buttonValue)} > {buttonText}: - {buttonDescription} + {buttonDescription} - {buttonValue} + {countTitle} {count}