2021-10-08 13:10:57 +00:00
|
|
|
import { User } from "@prisma/client";
|
2022-06-28 20:40:58 +00:00
|
|
|
|
|
|
|
import dayjs from "@calcom/dayjs";
|
2021-09-02 16:36:58 +00:00
|
|
|
|
|
|
|
export const ONBOARDING_INTRODUCED_AT = dayjs("September 1 2021").toISOString();
|
2021-10-08 13:10:57 +00:00
|
|
|
|
|
|
|
export const ONBOARDING_NEXT_REDIRECT = {
|
|
|
|
redirect: {
|
|
|
|
permanent: false,
|
|
|
|
destination: "/getting-started",
|
|
|
|
},
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export const shouldShowOnboarding = (user: Pick<User, "createdDate" | "completedOnboarding">) => {
|
|
|
|
return !user.completedOnboarding && dayjs(user.createdDate).isAfter(ONBOARDING_INTRODUCED_AT);
|
|
|
|
};
|