Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

add btn disabled compare

kruzhambusd1a497c7150f
diff --git a/src/pages/Project/View/ViewProject.tsx b/src/pages/Project/View/ViewProject.tsx
index 4f0602229..572b3ea9c 100644
--- a/src/pages/Project/View/ViewProject.tsx
+++ b/src/pages/Project/View/ViewProject.tsx
@@ -1588,6 +1588,10 @@ const ViewProject = ({
labelExtractor={(pair) => pair.label}
keyExtractor={(pair) => pair.label}
onSelect={(pair) => {
+ if (pair.period === PERIOD_PAIRS_COMPARE.DISABLE) {
+ setIsActiveCompare(false)
+ }
+
if (pair.period === PERIOD_PAIRS_COMPARE.CUSTOM) {
setTimeout(() => {
// @ts-ignore
diff --git a/src/redux/constants/index.ts b/src/redux/constants/index.ts
index d62032c5d..1ed990029 100644
--- a/src/redux/constants/index.ts
+++ b/src/redux/constants/index.ts
@@ -81,16 +81,21 @@ export const tbPeriodPairsCompare = (t: Function, dates?: Date[]): {
}, {
label: dates ? getCustomLabel(dates, t) : t('project.custom'),
period: 'custom',
+}, {
+ label: t('project.disableCompare'),
+ period: 'disable',
}]
export const PERIOD_PAIRS_COMPARE: {
COMPARE: string
PREVIOS: string
CUSTOM: string
+ DISABLE: string
} = {
COMPARE: 'compare',
PREVIOS: 'previous',
CUSTOM: 'custom',
+ DISABLE: 'disable',
}
interface IStringObject {