From b7ae8c9594558d98990533f6ced9987ef164f5d6 Mon Sep 17 00:00:00 2001 From: Leo Giovanetti Date: Wed, 6 Sep 2023 18:41:03 -0300 Subject: [PATCH] fix: mobile event types and avatars (#11184) --- apps/web/pages/event-types/index.tsx | 29 +++++++++++++++---- apps/web/pages/signup.tsx | 2 +- .../viewer/eventTypes/getByViewer.handler.ts | 3 +- .../components/empty-screen/EmptyScreen.tsx | 8 ++++- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/apps/web/pages/event-types/index.tsx b/apps/web/pages/event-types/index.tsx index 87a8037f38..a3cdc9a997 100644 --- a/apps/web/pages/event-types/index.tsx +++ b/apps/web/pages/event-types/index.tsx @@ -108,8 +108,10 @@ const MobileTeamsTab: FC = (props) => { const orgBranding = useOrgBranding(); const tabs = eventTypeGroups.map((item) => ({ name: item.profile.name ?? "", - href: item.teamId ? `/event-types?teamId=${item.teamId}` : "/event-types", - avatar: item.profile.image ?? `${orgBranding?.fullDomain ?? WEBAPP_URL}/${item.profile.slug}/avatar.png`, + href: item.teamId ? `/event-types?teamId=${item.teamId}` : "/event-types?noTeam", + avatar: orgBranding + ? `${orgBranding.fullDomain}${item.teamId ? "/team" : ""}/${item.profile.slug}/avatar.png` + : item.profile.image ?? `${WEBAPP_URL + (item.teamId && "/team")}/${item.profile.slug}/avatar.png`, })); const { data } = useTypedQuery(querySchema); const events = eventTypeGroups.filter((item) => item.teamId === data.teamId); @@ -117,13 +119,15 @@ const MobileTeamsTab: FC = (props) => { return (
- {events.length && ( + {events.length > 0 ? ( + ) : ( + )}
); @@ -358,6 +362,10 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL } }, []); + if (!types.length) { + return group.teamId ? : ; + } + const firstItem = types[0]; const lastItem = types[types.length - 1]; const isManagedEventPrefix = () => { @@ -712,7 +720,10 @@ const EventTypeListHeading = ({ @@ -759,6 +770,12 @@ const CreateFirstEventTypeView = () => { Icon={LinkIcon} headline={t("new_event_type_heading")} description={t("new_event_type_description")} + className="mb-16" + buttonRaw={ + + } /> ); }; @@ -893,8 +910,10 @@ const Main = ({ groupIndex={index} readOnly={group.metadata.readOnly} /> - ) : ( + ) : group.teamId ? ( + ) : ( + )} )) diff --git a/apps/web/pages/signup.tsx b/apps/web/pages/signup.tsx index 151186a6d1..105e06e06b 100644 --- a/apps/web/pages/signup.tsx +++ b/apps/web/pages/signup.tsx @@ -142,7 +142,7 @@ export default function Signup({ prepopulateFormValues, token, orgSlug }: Signup const bookerUrl = await getBookerUrl(user); return { - // don't display event teams without event types, - eventTypeGroups: eventTypeGroups.filter((groupBy) => groupBy.parentId || !!groupBy.eventTypes?.length), + eventTypeGroups, // so we can show a dropdown when the user has teams profiles: eventTypeGroups.map((group) => ({ ...group.profile, diff --git a/packages/ui/components/empty-screen/EmptyScreen.tsx b/packages/ui/components/empty-screen/EmptyScreen.tsx index 1b898b8dc5..20806fdc90 100644 --- a/packages/ui/components/empty-screen/EmptyScreen.tsx +++ b/packages/ui/components/empty-screen/EmptyScreen.tsx @@ -48,7 +48,13 @@ export function EmptyScreen({ )}
-

{headline}

+

+ {headline} +

{description && (
{description}