fixes gravatar fallback for team collective events (#1759)

This commit is contained in:
Syed Ali Shahbaz authored and GitHub committed 2022-02-09 18:56:02 -07:00
1 parent 712dceb8cb
commit 97fdfc5d6b
5 files changed
+23 -8

No files matched your search

+4 -5
View File
@@ -36,7 +36,6 @@ import getIntegrations, { hasIntegration } from "@lib/integrations/getIntegratio
import { LocationType } from "@lib/location";
import showToast from "@lib/notification";
import prisma from "@lib/prisma";
import { defaultAvatarSrc } from "@lib/profile";
import { trpc } from "@lib/trpc";
import { inferSSRProps } from "@lib/types/inferSSRProps";
@@ -313,15 +312,15 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
const mapUserToValue = ({
id,
name,
avatar,
username,
}: {
id: number | null;
name: string | null;
avatar: string | null;
username: string | null;
}) => ({
value: `${id || ""}`,
label: `${name || ""}`,
avatar: `${avatar || ""}`,
avatar: `${process.env.NEXT_PUBLIC_APP_URL}/${username}/avatar.png`,
});
const formMethods = useForm<{
@@ -1716,7 +1715,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
const teamMembers = eventTypeObject.team
? eventTypeObject.team.members.map((member) => {
const user = member.user;
user.avatar = user.avatar || defaultAvatarSrc({ email: asStringOrUndefined(user.email) });
user.avatar = `${process.env.NEXT_PUBLIC_APP_URL}/${user.username}/avatar.png`;
return user;
})
: [];
+1 -1
View File
@@ -153,7 +153,7 @@ const EventTypeList = ({ readOnly, types, profile }: EventTypeListProps): JSX.El
truncateAfter={4}
items={type.users.map((organizer) => ({
alt: organizer.name || "",
image: organizer.avatar || "",
image: `${process.env.NEXT_PUBLIC_APP_URL}/${organizer.username}/avatar.png`,
}))}
/>
)}