Skip to content

Commit fa13f6f

Browse files
authored
feat(web): add flag for planner feature (#1111)
* feat(web): add Flask icon and beta button functionality to sidebar * fix(web): hide PostHog beta feature button to avoid duplication * fix(web): update beta button identifier and remove redundant styles
1 parent 3a8ec1f commit fa13f6f

File tree

6 files changed

+24
-1
lines changed

6 files changed

+24
-1
lines changed

packages/web/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ export const App = () => {
7676
capture_unhandled_rejections: true,
7777
capture_console_errors: true,
7878
},
79+
opt_in_site_apps: true,
80+
person_profiles: "always",
7981
}}
8082
>
8183
{wrappedChildren}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const PH_ID_BETA_BUTTON = "early-access-button"; // this needs to match the id of the button in the PostHog dashboard

packages/web/src/components/GlobalStyle/styled.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ export const GlobalStyle = createGlobalStyle`
4141
background-color: ${theme.color.panel.scrollbarActive};
4242
}
4343
}
44-
`;
44+
`;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import styled from "styled-components";
2+
import { Flask } from "@phosphor-icons/react";
3+
import { iconStyles } from "./styled";
4+
5+
export const FlaskIcon = styled(Flask)`
6+
${iconStyles}
7+
`;

packages/web/src/views/Calendar/components/Sidebar/SidebarIconRow/SidebarIconRow.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import React from "react";
2+
import { PH_ID_BETA_BUTTON } from "@web/common/constants/posthog.constants";
23
import { theme } from "@web/common/styles/theme";
34
import { getMetaKey } from "@web/common/utils/shortcut/shortcut.util";
45
import { CalendarIcon } from "@web/components/Icons/Calendar";
56
import { CommandIcon } from "@web/components/Icons/Command";
7+
import { FlaskIcon } from "@web/components/Icons/Flask";
68
import { SpinnerIcon } from "@web/components/Icons/Spinner";
79
import { TodoIcon } from "@web/components/Icons/Todo";
810
import { Text } from "@web/components/Text";
@@ -82,6 +84,12 @@ export const SidebarIconRow = () => {
8284
}
8385
/>
8486
</TooltipWrapper>
87+
<TooltipWrapper description="Early Access">
88+
<FlaskIcon
89+
id={PH_ID_BETA_BUTTON}
90+
color={theme.color.text.darkPlaceholder}
91+
/>
92+
</TooltipWrapper>
8593
{gCalImport.importing ? (
8694
<TooltipWrapper description="Importing your calendar events in the background">
8795
<SpinnerIcon disabled />
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
import { useFeatureFlagEnabled } from "posthog-js/react";
12
import React from "react";
23
import { StyledTodayButton } from "./styled";
34

45
export const TodayButton = () => {
6+
const isPlannerEnabled = useFeatureFlagEnabled("experiment_planner");
7+
8+
isPlannerEnabled && console.log("planner enabled");
9+
510
return <StyledTodayButton title="Today">Today</StyledTodayButton>;
611
};

0 commit comments

Comments
 (0)