fix(ui): add beta tag for notifications (#9471)

This commit is contained in:
Chirag Madlani 2022-12-21 23:25:34 +05:30 committed by GitHub
parent 247014bbc7
commit 66a6e5e9a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 4 deletions

View File

@ -47,7 +47,8 @@ const GlobalSettingLeftPanel = () => {
'',
'',
curr.items,
'group'
'group',
curr.isBeta
);
if (menuItem.children?.length) {
return [...acc, menuItem];

View File

@ -11,6 +11,7 @@
* limitations under the License.
*/
import { Badge } from 'antd';
import { ItemType } from 'antd/lib/menu/hooks/useItems';
import i18next from 'i18next';
import { camelCase } from 'lodash';
@ -44,6 +45,7 @@ export interface MenuListItem {
export interface MenuList {
category: string;
items: MenuListItem[];
isBeta?: boolean;
}
export const getGlobalSettingsMenuWithPermission = (
@ -157,6 +159,7 @@ export const getGlobalSettingsMenuWithPermission = (
},
{
category: i18next.t('label.notification-plural'),
isBeta: true,
items: [
{
label: i18next.t('label.activity-feeds'),
@ -253,12 +256,13 @@ export const getGlobalSettingMenuItem = (
isProtected: boolean;
icon: React.ReactNode;
}[],
type?: string
type?: string,
isBeta?: boolean
): {
key: string;
icon: React.ReactNode;
children: ItemType[] | undefined;
label: string;
label: ReactNode;
type: string | undefined;
} => {
const subItems = children
@ -273,7 +277,13 @@ export const getGlobalSettingMenuItem = (
key: `${category}.${key}`,
icon,
children: subItems,
label,
label: isBeta ? (
<Badge color="#7147e8" count="beta" offset={[30, 8]} size="small">
{label}
</Badge>
) : (
label
),
type,
};
};