Skip to content

Commit 0f39e44

Browse files
Merge branch 'main' into fix/remove-add-all-team-members-toggle-for-fixed-hosts
2 parents 8e055ba + 5c6f52f commit 0f39e44

File tree

2 files changed

+59
-56
lines changed

2 files changed

+59
-56
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
"use client";
2+
3+
import { useSession } from "next-auth/react";
4+
5+
import { UpgradeTip } from "@calcom/features/tips";
6+
import { WEBAPP_URL } from "@calcom/lib/constants";
7+
import { useLocale } from "@calcom/lib/hooks/useLocale";
8+
import { Icon, Button, ButtonGroup } from "@calcom/ui";
9+
10+
export default function UpgradeTipWrapper({ children }: { children: React.ReactNode }) {
11+
const { t } = useLocale();
12+
const session = useSession();
13+
const features = [
14+
{
15+
icon: <Icon name="users" className="h-5 w-5" />,
16+
title: t("view_bookings_across"),
17+
description: t("view_bookings_across_description"),
18+
},
19+
{
20+
icon: <Icon name="refresh-ccw" className="h-5 w-5" />,
21+
title: t("identify_booking_trends"),
22+
description: t("identify_booking_trends_description"),
23+
},
24+
{
25+
icon: <Icon name="user-plus" className="h-5 w-5" />,
26+
title: t("spot_popular_event_types"),
27+
description: t("spot_popular_event_types_description"),
28+
},
29+
];
30+
31+
return (
32+
<UpgradeTip
33+
plan="team"
34+
title={t("make_informed_decisions")}
35+
description={t("make_informed_decisions_description")}
36+
features={features}
37+
background="/tips/insights"
38+
buttons={
39+
<div className="space-y-2 rtl:space-x-reverse sm:space-x-2">
40+
<ButtonGroup>
41+
<Button color="primary" href={`${WEBAPP_URL}/settings/teams/new`}>
42+
{t("create_team")}
43+
</Button>
44+
<Button color="minimal" href="https://go.cal.com/insights" target="_blank">
45+
{t("learn_more")}
46+
</Button>
47+
</ButtonGroup>
48+
</div>
49+
}>
50+
{!session.data?.user ? null : children}
51+
</UpgradeTip>
52+
);
53+
}

apps/web/app/(use-page-wrapper)/insights/layout.tsx

+6-56
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,15 @@
1-
"use client";
2-
3-
import { useSession } from "next-auth/react";
1+
import { getTranslate } from "app/_utils";
42

53
import Shell from "@calcom/features/shell/Shell";
6-
import { UpgradeTip } from "@calcom/features/tips";
7-
import { WEBAPP_URL } from "@calcom/lib/constants";
8-
import { useLocale } from "@calcom/lib/hooks/useLocale";
9-
import { Button, ButtonGroup } from "@calcom/ui";
10-
import { Icon } from "@calcom/ui";
11-
12-
export default function InsightsLayout({ children }: { children: React.ReactNode }) {
13-
const { t } = useLocale();
14-
const session = useSession();
154

16-
const features = [
17-
{
18-
icon: <Icon name="users" className="h-5 w-5" />,
19-
title: t("view_bookings_across"),
20-
description: t("view_bookings_across_description"),
21-
},
22-
{
23-
icon: <Icon name="refresh-ccw" className="h-5 w-5" />,
24-
title: t("identify_booking_trends"),
25-
description: t("identify_booking_trends_description"),
26-
},
27-
{
28-
icon: <Icon name="user-plus" className="h-5 w-5" />,
29-
title: t("spot_popular_event_types"),
30-
description: t("spot_popular_event_types_description"),
31-
},
32-
];
5+
import UpgradeTipWrapper from "./UpgradeTipWrapper";
336

7+
export default async function InsightsLayout({ children }: { children: React.ReactNode }) {
8+
const t = await getTranslate();
349
return (
3510
<div>
36-
<Shell
37-
withoutMain={false}
38-
withoutSeo={true}
39-
heading={t("insights")}
40-
subtitle={t("insights_subtitle")}
41-
title={t("insights")}
42-
description={t("insights_subtitle")}>
43-
<UpgradeTip
44-
plan="team"
45-
title={t("make_informed_decisions")}
46-
description={t("make_informed_decisions_description")}
47-
features={features}
48-
background="/tips/insights"
49-
buttons={
50-
<div className="space-y-2 rtl:space-x-reverse sm:space-x-2">
51-
<ButtonGroup>
52-
<Button color="primary" href={`${WEBAPP_URL}/settings/teams/new`}>
53-
{t("create_team")}
54-
</Button>
55-
<Button color="minimal" href="https://go.cal.com/insights" target="_blank">
56-
{t("learn_more")}
57-
</Button>
58-
</ButtonGroup>
59-
</div>
60-
}>
61-
{!session.data?.user ? null : children}
62-
</UpgradeTip>
11+
<Shell withoutMain={false} withoutSeo={true} heading={t("insights")} subtitle={t("insights_subtitle")}>
12+
<UpgradeTipWrapper>{children}</UpgradeTipWrapper>
6313
</Shell>
6414
</div>
6515
);

0 commit comments

Comments
 (0)