mirror of
https://github.com/strapi/strapi.git
synced 2025-12-25 14:14:10 +00:00
Replace lock icon with lightning icon in the Settings and Navbar links (#20486)
* feat: replace the lock icon with the new lightning icon * feat: replace toBuy with licenseOnly
This commit is contained in:
parent
5a633cf02e
commit
22a1ad60c2
@ -34,8 +34,7 @@ Everytime a new EE feature is added in Strapi, in the settings menu, you should
|
||||
},
|
||||
to: '/settings/purchase-new-ee-feature',
|
||||
id: 'new-ee-feature',
|
||||
// TODO: to replace with another name in v5
|
||||
lockIcon: true,
|
||||
licenseOnly: true,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
|
||||
@ -63,7 +63,7 @@ interface MenuItem {
|
||||
notificationsCount?: number;
|
||||
Component: React.LazyExoticComponent<React.ComponentType>;
|
||||
exact?: boolean;
|
||||
lockIcon?: boolean;
|
||||
licenseOnly?: boolean;
|
||||
position?: number;
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import { Divider, Flex, FlexComponent, useCollator } from '@strapi/design-system';
|
||||
import { Lock } from '@strapi/icons';
|
||||
import { Lightning } from '@strapi/icons';
|
||||
import { useIntl } from 'react-intl';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { styled } from 'styled-components';
|
||||
@ -81,7 +81,9 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }: LeftMenuProps) =
|
||||
{listLinks.length > 0
|
||||
? listLinks.map((link) => {
|
||||
const LinkIcon = link.icon;
|
||||
const badgeContentLock = link?.lockIcon ? <Lock /> : undefined;
|
||||
const badgeContentLock = link?.licenseOnly ? (
|
||||
<Lightning fill="warning500" />
|
||||
) : undefined;
|
||||
|
||||
const badgeContentNumeric =
|
||||
link.notificationsCount && link.notificationsCount > 0
|
||||
|
||||
@ -124,8 +124,8 @@ export const HOOKS = {
|
||||
};
|
||||
|
||||
export interface SettingsMenuLink
|
||||
extends Omit<StrapiAppSettingLink, 'Component' | 'permissions' | 'lockIcon'> {
|
||||
lockIcon?: boolean; // TODO: to replace with another name in v5
|
||||
extends Omit<StrapiAppSettingLink, 'Component' | 'permissions' | 'licenseOnly'> {
|
||||
licenseOnly?: boolean;
|
||||
}
|
||||
|
||||
export type SettingsMenu = {
|
||||
@ -164,7 +164,7 @@ export const SETTINGS_LINKS_CE = (): SettingsMenu => ({
|
||||
intlLabel: { id: 'Settings.sso.title', defaultMessage: 'Single Sign-On' },
|
||||
to: '/settings/purchase-single-sign-on',
|
||||
id: 'sso-purchase-page',
|
||||
lockIcon: true, // TODO: to replace with another name in v5
|
||||
licenseOnly: true,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
@ -189,7 +189,7 @@ export const SETTINGS_LINKS_CE = (): SettingsMenu => ({
|
||||
intlLabel: { id: 'global.auditLogs', defaultMessage: 'Audit Logs' },
|
||||
to: '/settings/purchase-audit-logs',
|
||||
id: 'auditLogs-purchase-page',
|
||||
lockIcon: true, // TODO: to replace with another name in v5
|
||||
licenseOnly: true,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
|
||||
@ -30,7 +30,7 @@ interface SettingsMenuLinkWithPermissions extends SettingsMenuLink {
|
||||
}
|
||||
|
||||
interface StrapiAppSettingsLink extends IStrapiAppSettingLink {
|
||||
lockIcon?: never; // TODO: to replace with another name in v5
|
||||
licenseOnly?: never;
|
||||
hasNotification?: never;
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import {
|
||||
SubNavSection,
|
||||
SubNavSections,
|
||||
} from '@strapi/design-system';
|
||||
import { Lock } from '@strapi/icons';
|
||||
import { Lightning } from '@strapi/icons';
|
||||
import { useIntl } from 'react-intl';
|
||||
import { NavLink, useLocation } from 'react-router-dom';
|
||||
import { styled } from 'styled-components';
|
||||
@ -13,11 +13,15 @@ import { styled } from 'styled-components';
|
||||
import { useTracking } from '../../../features/Tracking';
|
||||
import { SettingsMenu } from '../../../hooks/useSettingsMenu';
|
||||
|
||||
const CustomIcon = styled(Lock)`
|
||||
const CustomIcon = styled(Lightning)`
|
||||
right: 15px;
|
||||
position: absolute;
|
||||
bottom: 50%;
|
||||
transform: translateY(50%);
|
||||
|
||||
path {
|
||||
fill: ${({ theme }) => theme.colors.warning500};
|
||||
}
|
||||
`;
|
||||
|
||||
const Link = styled(SubNavLink)`
|
||||
@ -79,7 +83,7 @@ const SettingsNav = ({ menu }: SettingsNavProps) => {
|
||||
position="relative"
|
||||
>
|
||||
{formatMessage(link.intlLabel)}
|
||||
{link?.lockIcon && <CustomIcon width="1.5rem" height="1.5rem" />}
|
||||
{link?.licenseOnly && <CustomIcon width="1.5rem" height="1.5rem" />}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
||||
@ -62,7 +62,7 @@ const admin: Plugin.Config.AdminInput = {
|
||||
const { PurchaseContentReleases } = await import('./pages/PurchaseContentReleases');
|
||||
return { default: PurchaseContentReleases };
|
||||
},
|
||||
lockIcon: true,
|
||||
licenseOnly: true,
|
||||
position: 2,
|
||||
});
|
||||
}
|
||||
|
||||
@ -41,12 +41,12 @@ const admin: Plugin.Config.AdminInput = {
|
||||
id: `${PLUGIN_ID}.plugin.name`,
|
||||
defaultMessage: 'Review Workflows',
|
||||
},
|
||||
licenseOnly: true,
|
||||
permissions: [],
|
||||
async Component() {
|
||||
const { PurchaseReviewWorkflows } = await import('./routes/purchase-review-workflows');
|
||||
return { default: PurchaseReviewWorkflows };
|
||||
},
|
||||
lockIcon: true,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user