Fixes broken layout of event type description (#7587)

* fix flicker of event type description

* code clean up

---------

Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
Carina WollendorferandCarinaWolli authored and GitHub committed 2023-03-08 15:46:23 +00:00
1 parent 8b47c064ff
commit 37038a0cbf
2 files changed
+46 -42

No files matched your search

+22 -20
View File
@@ -177,26 +177,28 @@ export default function User(props: inferSSRProps<typeof getServerSideProps> & E
className="dark:bg-darkgray-100 dark:hover:bg-darkgray-200 dark:border-darkgray-300 group relative border-b border-gray-200 bg-white first:rounded-t-md last:rounded-b-md last:border-b-0 hover:bg-gray-50"> className="dark:bg-darkgray-100 dark:hover:bg-darkgray-200 dark:border-darkgray-300 group relative border-b border-gray-200 bg-white first:rounded-t-md last:rounded-b-md last:border-b-0 hover:bg-gray-50">
<FiArrowRight className="absolute right-4 top-4 h-4 w-4 text-black opacity-0 transition-opacity group-hover:opacity-100 dark:text-white" /> <FiArrowRight className="absolute right-4 top-4 h-4 w-4 text-black opacity-0 transition-opacity group-hover:opacity-100 dark:text-white" />
{/* Don't prefetch till the time we drop the amount of javascript in [user][type] page which is impacting score for [user] page */} {/* Don't prefetch till the time we drop the amount of javascript in [user][type] page which is impacting score for [user] page */}
<Link <div className="block w-full p-5">
prefetch={false} <Link
href={{ prefetch={false}
pathname: `/${user.username}/${type.slug}`, href={{
query, pathname: `/${user.username}/${type.slug}`,
}} query,
onClick={async () => { }}
sdkActionManager?.fire("eventTypeSelected", { passHref
eventType: type, onClick={async () => {
}); sdkActionManager?.fire("eventTypeSelected", {
}} eventType: type,
className="block w-full p-5" });
data-testid="event-type-link"> }}
<div className="flex flex-wrap items-center"> data-testid="event-type-link">
<h2 className="dark:text-darkgray-700 pr-2 text-sm font-semibold text-gray-700"> <div className="flex flex-wrap items-center">
{type.title} <h2 className="dark:text-darkgray-700 pr-2 text-sm font-semibold text-gray-700">
</h2> {type.title}
</div> </h2>
<EventTypeDescription eventType={type} /> </div>
</Link> <EventTypeDescription eventType={type} />
</Link>
</div>
</div> </div>
)) ))
)} )}
+24 -22
View File
@@ -48,29 +48,31 @@ function TeamPage({ team }: TeamPageProps) {
"dark:bg-darkgray-100 dark:border-darkgray-300 group relative border-b border-gray-200 bg-white first:rounded-t-md last:rounded-b-md last:border-b-0 hover:bg-gray-50", "dark:bg-darkgray-100 dark:border-darkgray-300 group relative border-b border-gray-200 bg-white first:rounded-t-md last:rounded-b-md last:border-b-0 hover:bg-gray-50",
!isEmbed && "bg-white" !isEmbed && "bg-white"
)}> )}>
<Link <div className="px-6 py-4 ">
href={`/team/${team.slug}/${type.slug}`} <Link
className="flex justify-between px-6 py-4" href={`/team/${team.slug}/${type.slug}`}
data-testid="event-type-link"> data-testid="event-type-link"
<div className="flex-shrink"> className="flex justify-between">
<div className="flex flex-wrap items-center space-x-2 rtl:space-x-reverse"> <div className="flex-shrink">
<h2 className="dark:text-darkgray-700 text-sm font-semibold text-gray-700">{type.title}</h2> <div className="flex flex-wrap items-center space-x-2 rtl:space-x-reverse">
<h2 className="dark:text-darkgray-700 text-sm font-semibold text-gray-700">{type.title}</h2>
</div>
<EventTypeDescription className="text-sm" eventType={type} />
</div> </div>
<EventTypeDescription className="text-sm" eventType={type} /> <div className="mt-1 self-center">
</div> <AvatarGroup
<div className="mt-1 self-center"> truncateAfter={4}
<AvatarGroup className="flex flex-shrink-0"
truncateAfter={4} size="sm"
className="flex flex-shrink-0" items={type.users.map((user) => ({
size="sm" alt: user.name || "",
items={type.users.map((user) => ({ title: user.name || "",
alt: user.name || "", image: CAL_URL + "/" + user.username + "/avatar.png" || "",
title: user.name || "", }))}
image: CAL_URL + "/" + user.username + "/avatar.png" || "", />
}))} </div>
/> </Link>
</div> </div>
</Link>
</li> </li>
))} ))}
</ul> </ul>