away user fix (#2576)
This commit is contained in:
parent
69ef309cb5
commit
9c985edb6b
2 changed files with 36 additions and 2 deletions
|
@ -20,7 +20,22 @@ export type AvailabilityPageProps = inferSSRProps<typeof getServerSideProps>;
|
||||||
|
|
||||||
export default function Type(props: AvailabilityPageProps) {
|
export default function Type(props: AvailabilityPageProps) {
|
||||||
const { t } = useLocale();
|
const { t } = useLocale();
|
||||||
return props.isDynamicGroup && !props.profile.allowDynamicBooking ? (
|
return props.away ? (
|
||||||
|
<div className="h-screen dark:bg-neutral-900">
|
||||||
|
<main className="mx-auto max-w-3xl px-4 py-24">
|
||||||
|
<div className="space-y-6" data-testid="event-types">
|
||||||
|
<div className="overflow-hidden rounded-sm border dark:border-gray-900">
|
||||||
|
<div className="p-8 text-center text-gray-400 dark:text-white">
|
||||||
|
<h2 className="font-cal mb-2 text-3xl text-gray-600 dark:text-white">
|
||||||
|
😴{" " + t("user_away")}
|
||||||
|
</h2>
|
||||||
|
<p className="mx-auto max-w-md">{t("user_away_description")}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
) : props.isDynamicGroup && !props.profile.allowDynamicBooking ? (
|
||||||
<div className="h-screen dark:bg-neutral-900">
|
<div className="h-screen dark:bg-neutral-900">
|
||||||
<main className="mx-auto max-w-3xl px-4 py-24">
|
<main className="mx-auto max-w-3xl px-4 py-24">
|
||||||
<div className="space-y-6" data-testid="event-types">
|
<div className="space-y-6" data-testid="event-types">
|
||||||
|
@ -118,6 +133,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
|
||||||
darkBrandColor: true,
|
darkBrandColor: true,
|
||||||
defaultScheduleId: true,
|
defaultScheduleId: true,
|
||||||
allowDynamicBooking: true,
|
allowDynamicBooking: true,
|
||||||
|
away: true,
|
||||||
schedules: {
|
schedules: {
|
||||||
select: {
|
select: {
|
||||||
availability: true,
|
availability: true,
|
||||||
|
@ -301,6 +317,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
|
away: user.away,
|
||||||
isDynamicGroup,
|
isDynamicGroup,
|
||||||
profile,
|
profile,
|
||||||
plan: user.plan,
|
plan: user.plan,
|
||||||
|
|
|
@ -30,7 +30,22 @@ export type BookPageProps = inferSSRProps<typeof getServerSideProps>;
|
||||||
|
|
||||||
export default function Book(props: BookPageProps) {
|
export default function Book(props: BookPageProps) {
|
||||||
const { t } = useLocale();
|
const { t } = useLocale();
|
||||||
return props.isDynamicGroupBooking && !props.profile.allowDynamicBooking ? (
|
return props.away ? (
|
||||||
|
<div className="h-screen dark:bg-neutral-900">
|
||||||
|
<main className="mx-auto max-w-3xl px-4 py-24">
|
||||||
|
<div className="space-y-6" data-testid="event-types">
|
||||||
|
<div className="overflow-hidden rounded-sm border dark:border-gray-900">
|
||||||
|
<div className="p-8 text-center text-gray-400 dark:text-white">
|
||||||
|
<h2 className="font-cal mb-2 text-3xl text-gray-600 dark:text-white">
|
||||||
|
😴{" " + t("user_away")}
|
||||||
|
</h2>
|
||||||
|
<p className="mx-auto max-w-md">{t("user_away_description")}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
) : props.isDynamicGroupBooking && !props.profile.allowDynamicBooking ? (
|
||||||
<div className="h-screen dark:bg-neutral-900">
|
<div className="h-screen dark:bg-neutral-900">
|
||||||
<main className="mx-auto max-w-3xl px-4 py-24">
|
<main className="mx-auto max-w-3xl px-4 py-24">
|
||||||
<div className="space-y-6" data-testid="event-types">
|
<div className="space-y-6" data-testid="event-types">
|
||||||
|
@ -71,6 +86,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
||||||
brandColor: true,
|
brandColor: true,
|
||||||
darkBrandColor: true,
|
darkBrandColor: true,
|
||||||
allowDynamicBooking: true,
|
allowDynamicBooking: true,
|
||||||
|
away: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -190,6 +206,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
|
away: user.away,
|
||||||
locationLabels: getLocationLabels(t),
|
locationLabels: getLocationLabels(t),
|
||||||
profile,
|
profile,
|
||||||
eventType: eventTypeObject,
|
eventType: eventTypeObject,
|
||||||
|
|
Loading…
Reference in a new issue