2023-03-02 20:56:10 +00:00
|
|
|
import { BadgeCheckIcon } from "@heroicons/react/solid";
|
2022-04-25 04:33:00 +00:00
|
|
|
import classNames from "classnames";
|
2023-02-16 22:39:57 +00:00
|
|
|
import type { GetServerSidePropsContext } from "next";
|
2021-09-06 13:51:15 +00:00
|
|
|
import Link from "next/link";
|
2021-12-03 10:15:20 +00:00
|
|
|
import { useRouter } from "next/router";
|
2022-02-01 21:48:40 +00:00
|
|
|
import { Toaster } from "react-hot-toast";
|
2021-09-22 19:52:38 +00:00
|
|
|
|
2022-05-27 15:37:02 +00:00
|
|
|
import {
|
|
|
|
sdkActionManager,
|
|
|
|
useEmbedNonStylesConfig,
|
|
|
|
useEmbedStyles,
|
|
|
|
useIsEmbed,
|
|
|
|
} from "@calcom/embed-core/embed-iframe";
|
2022-12-22 19:06:26 +00:00
|
|
|
import { EventTypeDescriptionLazy as EventTypeDescription } from "@calcom/features/eventtypes/components";
|
2022-10-24 22:20:41 +00:00
|
|
|
import EmptyPage from "@calcom/features/eventtypes/components/EmptyPage";
|
2023-03-09 12:17:13 +00:00
|
|
|
import { WEBAPP_URL } from "@calcom/lib/constants";
|
2022-04-06 17:20:30 +00:00
|
|
|
import defaultEvents, {
|
|
|
|
getDynamicEventDescription,
|
2022-04-25 04:33:00 +00:00
|
|
|
getGroupName,
|
2022-04-06 17:20:30 +00:00
|
|
|
getUsernameList,
|
|
|
|
getUsernameSlugLink,
|
|
|
|
} from "@calcom/lib/defaultEvents";
|
2022-03-31 08:45:47 +00:00
|
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
2022-07-28 19:58:26 +00:00
|
|
|
import useTheme from "@calcom/lib/hooks/useTheme";
|
2023-03-28 09:40:13 +00:00
|
|
|
import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML";
|
2023-05-15 07:44:23 +00:00
|
|
|
import { stripMarkdown } from "@calcom/lib/stripMarkdown";
|
2022-07-28 19:58:26 +00:00
|
|
|
import prisma from "@calcom/prisma";
|
|
|
|
import { baseEventTypeSelect } from "@calcom/prisma/selects";
|
2022-10-14 16:24:43 +00:00
|
|
|
import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
|
2023-03-02 20:56:10 +00:00
|
|
|
import { Avatar, AvatarGroup, HeadSeo } from "@calcom/ui";
|
2023-04-12 15:26:31 +00:00
|
|
|
import { ArrowRight } from "@calcom/ui/components/icon";
|
2022-03-31 08:45:47 +00:00
|
|
|
|
2023-02-16 22:39:57 +00:00
|
|
|
import type { inferSSRProps } from "@lib/types/inferSSRProps";
|
|
|
|
import type { EmbedProps } from "@lib/withEmbedSsr";
|
2021-09-22 19:52:38 +00:00
|
|
|
|
2023-04-18 18:45:32 +00:00
|
|
|
import PageWrapper from "@components/PageWrapper";
|
|
|
|
|
2021-10-20 16:00:11 +00:00
|
|
|
import { ssrInit } from "@server/lib/ssr";
|
|
|
|
|
2022-10-19 21:25:03 +00:00
|
|
|
export default function User(props: inferSSRProps<typeof getServerSideProps> & EmbedProps) {
|
2023-05-15 07:44:23 +00:00
|
|
|
const {
|
|
|
|
users,
|
|
|
|
profile,
|
|
|
|
eventTypes,
|
|
|
|
isDynamicGroup,
|
|
|
|
dynamicNames,
|
|
|
|
dynamicUsernames,
|
|
|
|
isSingleUser,
|
|
|
|
markdownStrippedBio,
|
|
|
|
} = props;
|
2022-04-06 17:20:30 +00:00
|
|
|
const [user] = users; //To be used when we only have a single user, not dynamic group
|
2022-07-26 08:27:57 +00:00
|
|
|
useTheme(user.theme);
|
2021-10-12 13:11:33 +00:00
|
|
|
const { t } = useLocale();
|
2021-12-03 10:15:20 +00:00
|
|
|
const router = useRouter();
|
2022-06-15 20:54:31 +00:00
|
|
|
|
2023-01-25 01:08:10 +00:00
|
|
|
const isBioEmpty = !user.bio || !user.bio.replace("<p><br></p>", "").length;
|
|
|
|
|
2022-08-12 19:29:29 +00:00
|
|
|
const groupEventTypes = props.users.some((user) => !user.allowDynamicBooking) ? (
|
|
|
|
<div className="space-y-6" data-testid="event-types">
|
2023-04-05 18:14:46 +00:00
|
|
|
<div className="overflow-hidden rounded-sm border ">
|
|
|
|
<div className="text-muted p-8 text-center">
|
|
|
|
<h2 className="font-cal text-default mb-2 text-3xl">{" " + t("unavailable")}</h2>
|
2022-08-12 19:29:29 +00:00
|
|
|
<p className="mx-auto max-w-md">{t("user_dynamic_booking_disabled") as string}</p>
|
2022-04-06 17:20:30 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-08-12 19:29:29 +00:00
|
|
|
</div>
|
|
|
|
) : (
|
2022-08-24 20:18:42 +00:00
|
|
|
<ul>
|
2022-08-12 19:29:29 +00:00
|
|
|
{eventTypes.map((type, index) => (
|
|
|
|
<li
|
|
|
|
key={index}
|
2023-04-20 22:33:49 +00:00
|
|
|
className=" border-subtle bg-default dark:bg-muted dark:hover:bg-emphasis hover:bg-muted group relative border-b first:rounded-t-md last:rounded-b-md last:border-b-0">
|
2023-04-12 15:26:31 +00:00
|
|
|
<ArrowRight className="text-emphasis absolute right-3 top-3 h-4 w-4 opacity-0 transition-opacity group-hover:opacity-100" />
|
2023-01-06 12:13:56 +00:00
|
|
|
<Link
|
|
|
|
href={getUsernameSlugLink({ users: props.users, slug: type.slug })}
|
|
|
|
className="flex justify-between px-6 py-4"
|
|
|
|
data-testid="event-type-link">
|
|
|
|
<div className="flex-shrink">
|
2023-04-05 18:14:46 +00:00
|
|
|
<p className=" text-emphasis text-sm font-semibold">{type.title}</p>
|
2023-01-06 12:13:56 +00:00
|
|
|
<EventTypeDescription className="text-sm" eventType={type} />
|
|
|
|
</div>
|
|
|
|
<div className="mt-1 self-center">
|
|
|
|
<AvatarGroup
|
|
|
|
truncateAfter={4}
|
|
|
|
className="flex flex-shrink-0"
|
2023-01-11 15:00:46 +00:00
|
|
|
size="sm"
|
2023-01-06 12:13:56 +00:00
|
|
|
items={props.users.map((user) => ({
|
|
|
|
alt: user.name || "",
|
2023-03-09 12:17:13 +00:00
|
|
|
image: user.avatar,
|
2023-01-06 12:13:56 +00:00
|
|
|
}))}
|
|
|
|
/>
|
|
|
|
</div>
|
2022-08-12 19:29:29 +00:00
|
|
|
</Link>
|
|
|
|
</li>
|
|
|
|
))}
|
|
|
|
</ul>
|
|
|
|
);
|
|
|
|
|
2022-10-19 21:25:03 +00:00
|
|
|
const isEmbed = useIsEmbed(props.isEmbed);
|
2022-03-31 08:45:47 +00:00
|
|
|
const eventTypeListItemEmbedStyles = useEmbedStyles("eventTypeListItem");
|
2022-04-25 04:33:00 +00:00
|
|
|
const shouldAlignCentrallyInEmbed = useEmbedNonStylesConfig("align") !== "left";
|
|
|
|
const shouldAlignCentrally = !isEmbed || shouldAlignCentrallyInEmbed;
|
2021-12-09 15:51:37 +00:00
|
|
|
const query = { ...router.query };
|
|
|
|
delete query.user; // So it doesn't display in the Link (and make tests fail)
|
2021-10-20 16:00:11 +00:00
|
|
|
const nameOrUsername = user.name || user.username || "";
|
2022-04-14 02:47:34 +00:00
|
|
|
|
2023-04-16 21:58:47 +00:00
|
|
|
/*
|
|
|
|
const telemetry = useTelemetry();
|
|
|
|
useEffect(() => {
|
2022-06-02 16:19:01 +00:00
|
|
|
if (top !== window) {
|
|
|
|
//page_view will be collected automatically by _middleware.ts
|
|
|
|
telemetry.event(telemetryEventTypes.embedView, collectPageParameters("/[user]"));
|
|
|
|
}
|
2023-04-16 21:58:47 +00:00
|
|
|
}, [telemetry, router.asPath]); */
|
2022-10-24 22:20:41 +00:00
|
|
|
const isEventListEmpty = eventTypes.length === 0;
|
2021-07-11 19:35:56 +00:00
|
|
|
return (
|
2021-08-12 17:05:46 +00:00
|
|
|
<>
|
2021-08-27 12:35:20 +00:00
|
|
|
<HeadSeo
|
2022-04-07 10:28:52 +00:00
|
|
|
title={isDynamicGroup ? dynamicNames.join(", ") : nameOrUsername}
|
2023-05-15 07:44:23 +00:00
|
|
|
description={isDynamicGroup ? `Book events with ${dynamicUsernames.join(", ")}` : markdownStrippedBio}
|
2022-10-18 17:46:22 +00:00
|
|
|
meeting={{
|
2023-05-15 07:44:23 +00:00
|
|
|
title: isDynamicGroup ? "" : markdownStrippedBio,
|
2022-10-18 17:46:22 +00:00
|
|
|
profile: { name: `${profile.name}`, image: null },
|
|
|
|
users: isDynamicGroup
|
|
|
|
? dynamicUsernames.map((username, index) => ({ username, name: dynamicNames[index] }))
|
|
|
|
: [{ username: `${user.username}`, name: `${user.name}` }],
|
|
|
|
}}
|
2021-08-27 12:35:20 +00:00
|
|
|
/>
|
2022-04-25 04:33:00 +00:00
|
|
|
|
2023-04-05 18:14:46 +00:00
|
|
|
<div className={classNames(shouldAlignCentrally ? "mx-auto" : "", isEmbed ? "max-w-3xl" : "")}>
|
2022-04-25 04:33:00 +00:00
|
|
|
<main
|
|
|
|
className={classNames(
|
|
|
|
shouldAlignCentrally ? "mx-auto" : "",
|
2023-04-20 22:33:49 +00:00
|
|
|
isEmbed ? "border-booker border-booker-width bg-default rounded-md border" : "",
|
2022-04-25 04:33:00 +00:00
|
|
|
"max-w-3xl py-24 px-4"
|
|
|
|
)}>
|
2022-04-06 17:20:30 +00:00
|
|
|
{isSingleUser && ( // When we deal with a single user, not dynamic group
|
|
|
|
<div className="mb-8 text-center">
|
2023-01-21 11:41:49 +00:00
|
|
|
<Avatar imageSrc={user.avatar} size="xl" alt={nameOrUsername} />
|
2023-04-05 18:14:46 +00:00
|
|
|
<h1 className="font-cal text-emphasis mb-1 text-3xl">
|
2022-04-06 17:20:30 +00:00
|
|
|
{nameOrUsername}
|
2023-04-05 18:14:46 +00:00
|
|
|
{user.verified && <BadgeCheckIcon className=" mx-1 -mt-1 inline h-6 w-6 text-blue-500" />}
|
2022-04-06 17:20:30 +00:00
|
|
|
</h1>
|
2023-01-25 01:08:10 +00:00
|
|
|
{!isBioEmpty && (
|
|
|
|
<>
|
|
|
|
<div
|
2023-05-15 13:18:31 +00:00
|
|
|
className=" text-subtle break-words text-sm [&_a]:text-blue-500 [&_a]:underline [&_a]:hover:text-blue-600"
|
2023-03-28 09:40:13 +00:00
|
|
|
dangerouslySetInnerHTML={{ __html: props.safeBio }}
|
2023-01-25 01:08:10 +00:00
|
|
|
/>
|
|
|
|
</>
|
|
|
|
)}
|
2022-04-06 17:20:30 +00:00
|
|
|
</div>
|
|
|
|
)}
|
2023-04-05 18:14:46 +00:00
|
|
|
|
2022-08-24 20:18:42 +00:00
|
|
|
<div
|
2023-04-05 18:14:46 +00:00
|
|
|
className={classNames("rounded-md ", !isEventListEmpty && "border-subtle border")}
|
2022-08-24 20:18:42 +00:00
|
|
|
data-testid="event-types">
|
2022-03-10 19:21:27 +00:00
|
|
|
{user.away ? (
|
2023-04-05 18:14:46 +00:00
|
|
|
<div className="overflow-hidden rounded-sm border ">
|
|
|
|
<div className="text-muted p-8 text-center">
|
|
|
|
<h2 className="font-cal text-default mb-2 text-3xl">😴{" " + t("user_away")}</h2>
|
2022-05-20 07:06:21 +00:00
|
|
|
<p className="mx-auto max-w-md">{t("user_away_description") as string}</p>
|
2022-03-10 19:21:27 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-04-06 17:20:30 +00:00
|
|
|
) : isDynamicGroup ? ( //When we deal with dynamic group (users > 1)
|
|
|
|
groupEventTypes
|
2022-03-10 19:21:27 +00:00
|
|
|
) : (
|
2022-02-11 14:34:12 +00:00
|
|
|
eventTypes.map((type) => (
|
|
|
|
<div
|
|
|
|
key={type.id}
|
2022-03-31 08:45:47 +00:00
|
|
|
style={{ display: "flex", ...eventTypeListItemEmbedStyles }}
|
2023-04-22 15:47:15 +00:00
|
|
|
className="bg-default border-subtle dark:bg-muted dark:hover:bg-emphasis hover:bg-muted group relative border-b first:rounded-t-md last:rounded-b-md last:border-b-0">
|
2023-04-12 15:26:31 +00:00
|
|
|
<ArrowRight className="text-emphasis absolute right-4 top-4 h-4 w-4 opacity-0 transition-opacity group-hover:opacity-100" />
|
2022-03-05 15:28:24 +00:00
|
|
|
{/* Don't prefetch till the time we drop the amount of javascript in [user][type] page which is impacting score for [user] page */}
|
2023-03-08 15:46:23 +00:00
|
|
|
<div className="block w-full p-5">
|
|
|
|
<Link
|
|
|
|
prefetch={false}
|
|
|
|
href={{
|
|
|
|
pathname: `/${user.username}/${type.slug}`,
|
|
|
|
query,
|
|
|
|
}}
|
|
|
|
passHref
|
|
|
|
onClick={async () => {
|
|
|
|
sdkActionManager?.fire("eventTypeSelected", {
|
|
|
|
eventType: type,
|
|
|
|
});
|
|
|
|
}}
|
|
|
|
data-testid="event-type-link">
|
|
|
|
<div className="flex flex-wrap items-center">
|
2023-04-05 18:14:46 +00:00
|
|
|
<h2 className=" text-default pr-2 text-sm font-semibold">{type.title}</h2>
|
2023-03-08 15:46:23 +00:00
|
|
|
</div>
|
2023-04-13 02:10:23 +00:00
|
|
|
<EventTypeDescription eventType={type} isPublic={true} />
|
2023-03-08 15:46:23 +00:00
|
|
|
</Link>
|
|
|
|
</div>
|
2021-08-12 17:05:46 +00:00
|
|
|
</div>
|
2022-03-10 19:21:27 +00:00
|
|
|
))
|
|
|
|
)}
|
2022-02-11 14:34:12 +00:00
|
|
|
</div>
|
2023-04-05 18:14:46 +00:00
|
|
|
|
2022-10-24 22:20:41 +00:00
|
|
|
{isEventListEmpty && <EmptyPage name={user.name ?? "User"} />}
|
2022-02-11 14:34:12 +00:00
|
|
|
</main>
|
|
|
|
<Toaster position="bottom-right" />
|
|
|
|
</div>
|
2021-08-12 17:05:46 +00:00
|
|
|
</>
|
2021-06-22 17:42:32 +00:00
|
|
|
);
|
2021-03-22 13:48:48 +00:00
|
|
|
}
|
|
|
|
|
2023-04-17 12:16:54 +00:00
|
|
|
User.isBookingPage = true;
|
2023-04-18 18:45:32 +00:00
|
|
|
User.PageWrapper = PageWrapper;
|
2023-04-17 12:16:54 +00:00
|
|
|
|
2022-10-14 16:24:43 +00:00
|
|
|
const getEventTypesWithHiddenFromDB = async (userId: number) => {
|
|
|
|
return (
|
|
|
|
await prisma.eventType.findMany({
|
|
|
|
where: {
|
|
|
|
AND: [
|
|
|
|
{
|
|
|
|
teamId: null,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
OR: [
|
|
|
|
{
|
|
|
|
userId,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
users: {
|
|
|
|
some: {
|
|
|
|
id: userId,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
orderBy: [
|
2021-10-08 11:43:48 +00:00
|
|
|
{
|
2022-10-14 16:24:43 +00:00
|
|
|
position: "desc",
|
2021-10-08 11:43:48 +00:00
|
|
|
},
|
|
|
|
{
|
2022-10-14 16:24:43 +00:00
|
|
|
id: "asc",
|
2021-10-08 11:43:48 +00:00
|
|
|
},
|
|
|
|
],
|
2022-10-14 16:24:43 +00:00
|
|
|
select: {
|
|
|
|
...baseEventTypeSelect,
|
|
|
|
metadata: true,
|
2021-11-15 12:25:49 +00:00
|
|
|
},
|
2022-10-14 16:24:43 +00:00
|
|
|
})
|
|
|
|
).map((eventType) => ({
|
|
|
|
...eventType,
|
|
|
|
metadata: EventTypeMetaDataSchema.parse(eventType.metadata),
|
|
|
|
}));
|
2022-04-06 17:20:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
|
|
|
|
const ssr = await ssrInit(context);
|
2022-05-17 20:43:27 +00:00
|
|
|
const crypto = await import("crypto");
|
2022-04-06 17:20:30 +00:00
|
|
|
|
|
|
|
const usernameList = getUsernameList(context.query.user as string);
|
|
|
|
const dataFetchStart = Date.now();
|
2023-03-09 12:17:13 +00:00
|
|
|
const usersWithoutAvatar = await prisma.user.findMany({
|
2022-04-06 17:20:30 +00:00
|
|
|
where: {
|
|
|
|
username: {
|
|
|
|
in: usernameList,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
select: {
|
|
|
|
id: true,
|
|
|
|
username: true,
|
|
|
|
email: true,
|
|
|
|
name: true,
|
|
|
|
bio: true,
|
2022-04-25 04:33:00 +00:00
|
|
|
brandColor: true,
|
|
|
|
darkBrandColor: true,
|
2022-04-06 17:20:30 +00:00
|
|
|
theme: true,
|
|
|
|
away: true,
|
|
|
|
verified: true,
|
|
|
|
allowDynamicBooking: true,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2023-03-09 12:17:13 +00:00
|
|
|
const users = usersWithoutAvatar.map((user) => ({
|
|
|
|
...user,
|
|
|
|
avatar: `${WEBAPP_URL}/${user.username}/avatar.png`,
|
|
|
|
}));
|
|
|
|
|
2022-04-06 17:20:30 +00:00
|
|
|
if (!users.length) {
|
|
|
|
return {
|
|
|
|
notFound: true,
|
2022-10-19 21:25:03 +00:00
|
|
|
} as {
|
|
|
|
notFound: true;
|
2022-04-06 17:20:30 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
const isDynamicGroup = users.length > 1;
|
|
|
|
|
2023-02-15 15:42:49 +00:00
|
|
|
if (isDynamicGroup) {
|
|
|
|
// sort and be in the same order as usernameList so first user is the first user in the list
|
|
|
|
users.sort((a, b) => {
|
|
|
|
const aIndex = (a.username && usernameList.indexOf(a.username)) || 0;
|
|
|
|
const bIndex = (b.username && usernameList.indexOf(b.username)) || 0;
|
|
|
|
return aIndex - bIndex;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-04-25 04:33:00 +00:00
|
|
|
const dynamicNames = isDynamicGroup
|
|
|
|
? users.map((user) => {
|
|
|
|
return user.name || "";
|
|
|
|
})
|
|
|
|
: [];
|
2022-04-06 17:20:30 +00:00
|
|
|
const [user] = users; //to be used when dealing with single user, not dynamic group
|
2022-04-25 04:33:00 +00:00
|
|
|
|
|
|
|
const profile = isDynamicGroup
|
|
|
|
? {
|
|
|
|
name: getGroupName(dynamicNames),
|
|
|
|
image: null,
|
|
|
|
theme: null,
|
|
|
|
weekStart: "Sunday",
|
|
|
|
brandColor: "",
|
|
|
|
darkBrandColor: "",
|
2022-05-26 16:41:05 +00:00
|
|
|
allowDynamicBooking: !users.some((user) => {
|
2022-04-25 04:33:00 +00:00
|
|
|
return !user.allowDynamicBooking;
|
2022-05-26 16:41:05 +00:00
|
|
|
}),
|
2022-04-25 04:33:00 +00:00
|
|
|
}
|
|
|
|
: {
|
|
|
|
name: user.name || user.username,
|
|
|
|
image: user.avatar,
|
|
|
|
theme: user.theme,
|
|
|
|
brandColor: user.brandColor,
|
|
|
|
darkBrandColor: user.darkBrandColor,
|
|
|
|
};
|
2022-04-06 17:20:30 +00:00
|
|
|
|
2022-10-14 16:24:43 +00:00
|
|
|
const eventTypesWithHidden = isDynamicGroup ? [] : await getEventTypesWithHiddenFromDB(user.id);
|
2022-03-04 10:03:10 +00:00
|
|
|
const dataFetchEnd = Date.now();
|
|
|
|
if (context.query.log === "1") {
|
|
|
|
context.res.setHeader("X-Data-Fetch-Time", `${dataFetchEnd - dataFetchStart}ms`);
|
|
|
|
}
|
2022-02-01 21:48:40 +00:00
|
|
|
const eventTypesRaw = eventTypesWithHidden.filter((evt) => !evt.hidden);
|
|
|
|
|
|
|
|
const eventTypes = eventTypesRaw.map((eventType) => ({
|
|
|
|
...eventType,
|
2022-10-14 16:24:43 +00:00
|
|
|
metadata: EventTypeMetaDataSchema.parse(eventType.metadata || {}),
|
2023-03-28 09:40:13 +00:00
|
|
|
descriptionAsSafeHTML: markdownToSafeHTML(eventType.description),
|
2022-02-01 21:48:40 +00:00
|
|
|
}));
|
2021-10-08 11:43:48 +00:00
|
|
|
|
2022-06-15 20:54:31 +00:00
|
|
|
const isSingleUser = users.length === 1;
|
|
|
|
const dynamicUsernames = isDynamicGroup
|
|
|
|
? users.map((user) => {
|
|
|
|
return user.username || "";
|
|
|
|
})
|
|
|
|
: [];
|
|
|
|
|
2023-03-28 09:40:13 +00:00
|
|
|
const safeBio = markdownToSafeHTML(user.bio) || "";
|
|
|
|
|
2023-05-15 07:44:23 +00:00
|
|
|
const markdownStrippedBio = stripMarkdown(user?.bio || "");
|
2021-06-22 17:42:32 +00:00
|
|
|
return {
|
|
|
|
props: {
|
2022-04-06 17:20:30 +00:00
|
|
|
users,
|
2023-03-28 09:40:13 +00:00
|
|
|
safeBio,
|
2022-04-25 04:33:00 +00:00
|
|
|
profile,
|
2022-02-11 14:34:12 +00:00
|
|
|
user: {
|
|
|
|
emailMd5: crypto.createHash("md5").update(user.email).digest("hex"),
|
|
|
|
},
|
2022-06-15 20:54:31 +00:00
|
|
|
eventTypes: isDynamicGroup
|
|
|
|
? defaultEvents.map((event) => {
|
|
|
|
event.description = getDynamicEventDescription(dynamicUsernames, event.slug);
|
|
|
|
return event;
|
|
|
|
})
|
|
|
|
: eventTypes,
|
2021-10-20 16:00:11 +00:00
|
|
|
trpcState: ssr.dehydrate(),
|
2022-06-15 20:54:31 +00:00
|
|
|
isDynamicGroup,
|
|
|
|
dynamicNames,
|
|
|
|
dynamicUsernames,
|
|
|
|
isSingleUser,
|
2023-05-15 07:44:23 +00:00
|
|
|
markdownStrippedBio,
|
2021-06-22 17:42:32 +00:00
|
|
|
},
|
|
|
|
};
|
2021-10-08 11:43:48 +00:00
|
|
|
};
|