fixes gravatar fallback for team collective events (#1759)
parent
712dceb8cb
commit
97fdfc5d6b
|
@ -0,0 +1,15 @@
|
|||
declare module "@wojtekmaj/react-daterange-picker/dist/entry.nostyle" {
|
||||
import { CalendarProps } from "react-calendar";
|
||||
export type DateRangePickerCalendarProps = Omit<
|
||||
CalendarProps,
|
||||
"calendarClassName" | "onChange" | "value"
|
||||
> & {
|
||||
calendarClassName?: string;
|
||||
onChange: (value: [Date, Date]) => void;
|
||||
value: [Date, Date];
|
||||
clearIcon: JSX.Element | null;
|
||||
calendarIcon: JSX.Element | null;
|
||||
rangeDivider: JSX.Element | null;
|
||||
};
|
||||
export default function DateRangePicker(props: DateRangePickerCalendarProps): JSX.Element;
|
||||
}
|
|
@ -126,7 +126,7 @@ const AvailabilityPage = ({ profile, eventType, workingHours }: Props) => {
|
|||
.filter((user) => user.name !== profile.name)
|
||||
.map((user) => ({
|
||||
title: user.name,
|
||||
image: user.avatar || undefined,
|
||||
image: `${process.env.NEXT_PUBLIC_APP_URL}/${user.username}/avatar.png`,
|
||||
alt: user.name || undefined,
|
||||
})),
|
||||
].filter((item) => !!item.image) as { image: string; alt?: string; title?: string }[]
|
||||
|
@ -175,7 +175,7 @@ const AvailabilityPage = ({ profile, eventType, workingHours }: Props) => {
|
|||
.map((user) => ({
|
||||
title: user.name,
|
||||
alt: user.name,
|
||||
image: user.avatar,
|
||||
image: `${process.env.NEXT_PUBLIC_APP_URL}/${user.username}/avatar.png`,
|
||||
})),
|
||||
].filter((item) => !!item.image) as { image: string; alt?: string; title?: string }[]
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
})
|
||||
: [];
|
||||
|
|
|
@ -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`,
|
||||
}))}
|
||||
/>
|
||||
)}
|
||||
|
|
|
@ -131,6 +131,7 @@ const loggedInViewerRouter = createProtectedRouter()
|
|||
users: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
avatar: true,
|
||||
name: true,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue