mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-17 06:35:54 +08:00
fix: cloud header button is hidden when is license is not active (#2756)
This commit is contained in:
parent
818a984af3
commit
5a81f5f90b
@ -8,6 +8,7 @@ import { Logout } from 'api/utils';
|
|||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import Config from 'container/ConfigDropdown';
|
import Config from 'container/ConfigDropdown';
|
||||||
import { useIsDarkMode, useThemeMode } from 'hooks/useDarkMode';
|
import { useIsDarkMode, useThemeMode } from 'hooks/useDarkMode';
|
||||||
|
import useLicense, { LICENSE_PLAN_STATUS } from 'hooks/useLicense';
|
||||||
import {
|
import {
|
||||||
Dispatch,
|
Dispatch,
|
||||||
KeyboardEvent,
|
KeyboardEvent,
|
||||||
@ -95,6 +96,11 @@ function HeaderContainer(): JSX.Element {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const { data } = useLicense();
|
||||||
|
|
||||||
|
const isLicenseActive =
|
||||||
|
data?.payload?.find((e) => e.isCurrent)?.status === LICENSE_PLAN_STATUS.VALID;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Header>
|
<Header>
|
||||||
<Container>
|
<Container>
|
||||||
@ -111,9 +117,11 @@ function HeaderContainer(): JSX.Element {
|
|||||||
</NavLink>
|
</NavLink>
|
||||||
|
|
||||||
<Space size="middle" align="center">
|
<Space size="middle" align="center">
|
||||||
<Button onClick={onClickSignozCloud} type="primary">
|
{!isLicenseActive && (
|
||||||
Try Signoz Cloud
|
<Button onClick={onClickSignozCloud} type="primary">
|
||||||
</Button>
|
Try Signoz Cloud
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
|
||||||
<Config frontendId="tooltip" />
|
<Config frontendId="tooltip" />
|
||||||
|
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
export const LICENSE_PLAN_KEY = {
|
export const LICENSE_PLAN_KEY = {
|
||||||
ENTERPRISE_PLAN: 'ENTERPRISE_PLAN',
|
ENTERPRISE_PLAN: 'ENTERPRISE_PLAN',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const LICENSE_PLAN_STATUS = {
|
||||||
|
VALID: 'VALID',
|
||||||
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { LICENSE_PLAN_KEY } from './constant';
|
import { LICENSE_PLAN_KEY, LICENSE_PLAN_STATUS } from './constant';
|
||||||
import useLicense from './useLicense';
|
import useLicense from './useLicense';
|
||||||
|
|
||||||
export default useLicense;
|
export default useLicense;
|
||||||
|
|
||||||
export { LICENSE_PLAN_KEY };
|
export { LICENSE_PLAN_KEY, LICENSE_PLAN_STATUS };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user