Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions packages/web/src/components/WelcomeModal/ProductHuntBadge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const PRODUCT_HUNT_URL =
"https://www.producthunt.com/products/compass-calendar?embed=true&utm_source=badge-featured&utm_medium=badge&utm_campaign=badge-compass-calendar-2";
const PRODUCT_HUNT_BADGE_SRC =
"https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1222394&theme=dark&t=1786683338797";

export function ProductHuntBadge() {
return (
<a
href={PRODUCT_HUNT_URL}
target="_blank"
rel="noopener noreferrer"
className="c-focus-ring inline-flex rounded-sm"
>
<img
alt="Compass Calendar - The keyboard-first calendar. Get organized quickly. | Product Hunt"
width={250}
height={54}
src={PRODUCT_HUNT_BADGE_SRC}
/>
</a>
);
}
9 changes: 7 additions & 2 deletions packages/web/src/components/WelcomeModal/WelcomeGuideBody.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useId, useState } from "react";
import { FAQ_ITEMS } from "./faq";
import { ProductHuntBadge } from "./ProductHuntBadge";

export function WelcomeGuideBody() {
const disclosureIdPrefix = useId();
Expand All @@ -23,7 +24,7 @@ export function WelcomeGuideBody() {

return (
<>
<div className="flex flex-col gap-2">
<div className="flex w-full flex-col gap-2">
<h2 className="font-bold text-2xl text-text leading-snug">
The keyboard-first calendar
</h2>
Expand All @@ -33,7 +34,11 @@ export function WelcomeGuideBody() {
</p>
</div>

<div className="flex flex-col divide-y divide-border">
<div className="flex w-full justify-center">
<ProductHuntBadge />
</div>

<div className="flex w-full flex-col divide-y divide-border">
{FAQ_ITEMS.map((item, index) => {
const isExpanded = expandedFaqs.has(item.question);
const answerId = `${disclosureIdPrefix}-faq-answer-${index}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ describe("WelcomeModal", () => {
expect(screen.getByText(/Rediscover the joy of shortcuts/)).toBeTruthy();
expect(screen.getByRole("img", { name: /pixel pirate/i })).toBeTruthy();
expect(screen.getByText("No signup required")).toBeTruthy();
expect(
screen.getByRole("link", {
name: "Compass Calendar - The keyboard-first calendar. Get organized quickly. | Product Hunt",
}),
).toHaveAttribute(
"href",
"https://www.producthunt.com/products/compass-calendar?embed=true&utm_source=badge-featured&utm_medium=badge&utm_campaign=badge-compass-calendar-2",
);
});

it("opens the auth modal from the Log in pill", async () => {
Expand Down