Skip to content

Commit

Permalink
[CAL-153] Wrong redirect when clicking user or teams avatar in event …
Browse files Browse the repository at this point in the history
…types (calcom#5348)

Co-authored-by: gitstart <[email protected]>
Co-authored-by: gitstart <[email protected]>
Co-authored-by: Nitesh Singh <[email protected]>
Co-authored-by: Matheus Muniz <[email protected]>
Co-authored-by: Rafael Toledo <[email protected]>
Co-authored-by: Matheus Benini Ferreira <[email protected]>
Co-authored-by: Murilo Amaral <[email protected]>
Co-authored-by: Matheus Benini <[email protected]>
Co-authored-by: Rubens Rafael <[email protected]>
Co-authored-by: Thiago Nascimbeni <[email protected]>
Co-authored-by: Rafael <[email protected]>
Co-authored-by: Grace Nshokano <[email protected]>
Co-authored-by: MuriloAmarals <[email protected]>

Co-authored-by: gitstart <[email protected]>
Co-authored-by: Nitesh Singh <[email protected]>
Co-authored-by: Matheus Muniz <[email protected]>
Co-authored-by: Rafael Toledo <[email protected]>
Co-authored-by: Matheus Benini Ferreira <[email protected]>
Co-authored-by: Murilo Amaral <[email protected]>
Co-authored-by: Matheus Benini <[email protected]>
Co-authored-by: Rubens Rafael <[email protected]>
Co-authored-by: Thiago Nascimbeni <[email protected]>
Co-authored-by: gitstart <[email protected]>
Co-authored-by: Rafael <[email protected]>
Co-authored-by: Grace Nshokano <[email protected]>
Co-authored-by: MuriloAmarals <[email protected]>
Co-authored-by: Matheus Muniz <[email protected]>
Co-authored-by: Júlio Piubello da Silva Cabral <[email protected]>
  • Loading branch information
16 people authored Nov 4, 2022
1 parent b5b41da commit 9d1a063
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions apps/web/pages/event-types/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type EventTypeGroupProfile = EventTypeGroups[number]["profile"];
interface EventTypeListHeadingProps {
profile: EventTypeGroupProfile;
membershipCount: number;
teamId?: number | null;
}

type EventTypeGroup = inferQueryOutput<"viewer.eventTypes">["eventTypeGroups"][number];
Expand Down Expand Up @@ -501,10 +502,14 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
);
};

const EventTypeListHeading = ({ profile, membershipCount }: EventTypeListHeadingProps): JSX.Element => {
const EventTypeListHeading = ({
profile,
membershipCount,
teamId,
}: EventTypeListHeadingProps): JSX.Element => {
return (
<div className="mb-4 flex">
<Link href="/settings/teams">
<Link href={teamId ? `/settings/teams/${teamId}/profile` : "/settings/my-account/profile"}>
<a>
<Avatar
alt={profile?.name || ""}
Expand All @@ -515,7 +520,7 @@ const EventTypeListHeading = ({ profile, membershipCount }: EventTypeListHeading
</a>
</Link>
<div>
<Link href="/settings/teams">
<Link href={teamId ? `/settings/teams/${teamId}/profile` : "/settings/my-account/profile"}>
<a className="font-bold">{profile?.name || ""}</a>
</Link>
{membershipCount && (
Expand Down Expand Up @@ -587,6 +592,7 @@ const EventTypesPage = () => {
<EventTypeListHeading
profile={group.profile}
membershipCount={group.metadata.membershipCount}
teamId={group.teamId}
/>
)}
<EventTypeList
Expand Down

0 comments on commit 9d1a063

Please sign in to comment.