mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 05:05:56 +08:00
feat: show pricing update banner in home page (#7990)
* feat: show pricing update banner in home page
This commit is contained in:
parent
d7102f69a9
commit
354e4b4b8f
@ -28,5 +28,6 @@ export enum LOCALSTORAGE {
|
|||||||
DONT_SHOW_SLOW_API_WARNING = 'DONT_SHOW_SLOW_API_WARNING',
|
DONT_SHOW_SLOW_API_WARNING = 'DONT_SHOW_SLOW_API_WARNING',
|
||||||
METRICS_LIST_OPTIONS = 'METRICS_LIST_OPTIONS',
|
METRICS_LIST_OPTIONS = 'METRICS_LIST_OPTIONS',
|
||||||
SHOW_EXCEPTIONS_QUICK_FILTERS = 'SHOW_EXCEPTIONS_QUICK_FILTERS',
|
SHOW_EXCEPTIONS_QUICK_FILTERS = 'SHOW_EXCEPTIONS_QUICK_FILTERS',
|
||||||
|
BANNER_DISMISSED = 'BANNER_DISMISSED',
|
||||||
QUICK_FILTERS_SETTINGS_ANNOUNCEMENT = 'QUICK_FILTERS_SETTINGS_ANNOUNCEMENT',
|
QUICK_FILTERS_SETTINGS_ANNOUNCEMENT = 'QUICK_FILTERS_SETTINGS_ANNOUNCEMENT',
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,51 @@
|
|||||||
background: var(--bg-slate-500);
|
background: var(--bg-slate-500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.home-container-banner {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 8px 12px;
|
||||||
|
width: 100%;
|
||||||
|
background-color: var(--bg-robin-500);
|
||||||
|
|
||||||
|
.home-container-banner-close {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--bg-vanilla-100);
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
right: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.home-container-banner-content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 4px;
|
||||||
|
color: var(--bg-vanilla-100);
|
||||||
|
font-family: Inter;
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 20px;
|
||||||
|
|
||||||
|
.home-container-banner-link {
|
||||||
|
color: var(--bg-vanilla-100);
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 20px;
|
||||||
|
letter-spacing: -0.07px;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.home-header-left {
|
.home-header-left {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -10,6 +10,7 @@ import getAllUserPreferences from 'api/preferences/getAllUserPreference';
|
|||||||
import updateUserPreferenceAPI from 'api/preferences/updateUserPreference';
|
import updateUserPreferenceAPI from 'api/preferences/updateUserPreference';
|
||||||
import Header from 'components/Header/Header';
|
import Header from 'components/Header/Header';
|
||||||
import { DEFAULT_ENTITY_VERSION } from 'constants/app';
|
import { DEFAULT_ENTITY_VERSION } from 'constants/app';
|
||||||
|
import { LOCALSTORAGE } from 'constants/localStorage';
|
||||||
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
||||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
@ -20,7 +21,7 @@ import { useGetK8sPodsList } from 'hooks/infraMonitoring/useGetK8sPodsList';
|
|||||||
import { useGetQueryRange } from 'hooks/queryBuilder/useGetQueryRange';
|
import { useGetQueryRange } from 'hooks/queryBuilder/useGetQueryRange';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import cloneDeep from 'lodash-es/cloneDeep';
|
import cloneDeep from 'lodash-es/cloneDeep';
|
||||||
import { CompassIcon, DotIcon, HomeIcon, Plus, Wrench } from 'lucide-react';
|
import { CompassIcon, DotIcon, HomeIcon, Plus, Wrench, X } from 'lucide-react';
|
||||||
import { AnimatePresence } from 'motion/react';
|
import { AnimatePresence } from 'motion/react';
|
||||||
import * as motion from 'motion/react-client';
|
import * as motion from 'motion/react-client';
|
||||||
import Card from 'periscope/components/Card/Card';
|
import Card from 'periscope/components/Card/Card';
|
||||||
@ -61,6 +62,13 @@ export default function Home(): JSX.Element {
|
|||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const [isBannerDismissed, setIsBannerDismissed] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const bannerDismissed = localStorage.getItem(LOCALSTORAGE.BANNER_DISMISSED);
|
||||||
|
setIsBannerDismissed(bannerDismissed === 'true');
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const startTime = new Date(now.getTime() - homeInterval);
|
const startTime = new Date(now.getTime() - homeInterval);
|
||||||
@ -310,9 +318,35 @@ export default function Home(): JSX.Element {
|
|||||||
logEvent('Homepage: Visited', {});
|
logEvent('Homepage: Visited', {});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const hideBanner = (): void => {
|
||||||
|
localStorage.setItem(LOCALSTORAGE.BANNER_DISMISSED, 'true');
|
||||||
|
setIsBannerDismissed(true);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="home-container">
|
<div className="home-container">
|
||||||
<div className="sticky-header">
|
<div className="sticky-header">
|
||||||
|
{!isBannerDismissed && (
|
||||||
|
<div className="home-container-banner">
|
||||||
|
<div className="home-container-banner-content">
|
||||||
|
Big news: SigNoz Cloud Teams plan now starting at just $49/Month -
|
||||||
|
<a
|
||||||
|
href="https://signoz.io/blog/cloud-teams-plan-now-at-49usd/"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
className="home-container-banner-link"
|
||||||
|
>
|
||||||
|
<i>read more</i>
|
||||||
|
</a>
|
||||||
|
🥳🎉
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="home-container-banner-close">
|
||||||
|
<X size={16} onClick={hideBanner} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<Header
|
<Header
|
||||||
leftComponent={
|
leftComponent={
|
||||||
<div className="home-header-left">
|
<div className="home-header-left">
|
||||||
|
@ -46,7 +46,7 @@ export const billingSuccessResponse = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
baseFee: 199,
|
baseFee: 49,
|
||||||
billTotal: 1278.3,
|
billTotal: 1278.3,
|
||||||
},
|
},
|
||||||
discount: 0,
|
discount: 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user