-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
84 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { useMemo } from "react"; | ||
import { useCurrentOrganization } from "./useCurrentOrganization"; | ||
|
||
export const useWaitlist = () => { | ||
const { isSuccess, currentOrgId, waitlisted } = useCurrentOrganization(); | ||
|
||
const shouldRenderWaitlistNotice = useMemo(() => { | ||
return isSuccess && currentOrgId && waitlisted; | ||
}, [isSuccess, currentOrgId, waitlisted]); | ||
|
||
return { | ||
shouldRenderWaitlistNotice, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { useGetCurrentUser } from "~/graphql/hooks/queries"; | ||
import { useWaitlist } from "~/lib/hooks/useWaitlist"; | ||
|
||
export const WaitlistWrapper = ({ children }) => { | ||
const { shouldRenderWaitlistNotice } = useWaitlist(); | ||
const { data: currentUserData } = useGetCurrentUser(); | ||
|
||
if (shouldRenderWaitlistNotice) { | ||
return ( | ||
<div className="container mx-auto p-8 text-center"> | ||
<h1 className="mb-4 font-heading font-medium"> | ||
You're on the waitlist! | ||
</h1> | ||
<div className="space-y-4 text-neutral-400"> | ||
<p>Thank you for signing up for Pezzo Cloud.</p> | ||
<p> | ||
You will receive an invitation at{" "} | ||
<span className="font-semibold">{currentUserData.me.email}</span>{" "} | ||
soon. | ||
</p> | ||
<p> | ||
Need access sooner? Email us at{" "} | ||
<a | ||
className="font-semibold text-primary underline" | ||
href="mailto:[email protected]" | ||
> | ||
[email protected] | ||
</a> | ||
</p> | ||
</div> | ||
</div> | ||
); | ||
} else { | ||
return children; | ||
} | ||
}; |
2 changes: 2 additions & 0 deletions
2
.../migrations/20240105073154_add_organization_waitlisted_and_default_to_false/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- AlterTable | ||
ALTER TABLE "Organization" ADD COLUMN "waitlisted" BOOLEAN NOT NULL DEFAULT false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters