Only show alert to upgrade when applicable and fix button (#661)
Co-authored-by: Bailey Pumfleet <pumfleet@hey.com>
This commit is contained in:
parent
cf7f5ae53c
commit
113d18d84e
1 changed files with 2 additions and 2 deletions
|
@ -274,7 +274,7 @@ const EventTypesPage = (props: PageProps) => {
|
||||||
<CreateNewEventDialog canAddEvents={props.canAddEvents} profiles={props.profiles} />
|
<CreateNewEventDialog canAddEvents={props.canAddEvents} profiles={props.profiles} />
|
||||||
)
|
)
|
||||||
}>
|
}>
|
||||||
{props.user.plan === "FREE" && typeof window !== "undefined" && (
|
{props.user.plan === "FREE" && !props.canAddEvents && typeof window !== "undefined" && (
|
||||||
<Alert
|
<Alert
|
||||||
severity="warning"
|
severity="warning"
|
||||||
title={<>You need to upgrade your plan to have more than one active event type.</>}
|
title={<>You need to upgrade your plan to have more than one active event type.</>}
|
||||||
|
@ -720,7 +720,7 @@ export async function getServerSideProps(context) {
|
||||||
createdDate: user.createdDate.toString(),
|
createdDate: user.createdDate.toString(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const canAddEvents = user.plan !== "FREE" || eventTypes.length < 1;
|
const canAddEvents = user.plan !== "FREE" || eventTypes[0].eventTypes.length < 1;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
|
|
Loading…
Reference in a new issue