Skip to content

Commit

Permalink
Merge pull request #5142 from webkom/improve-event-page-skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
eikhr authored Nov 6, 2024
2 parents a7380f6 + 5cd5aa8 commit 84f5f57
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const AttendeeSection = ({
minUserGridRows={minUserGridRows}
maxUserGridRows={MAX_USER_GRID_ROWS}
legacyRegistrationCount={event?.legacyRegistrationCount}
skeleton={fetching && !registrations}
skeleton={fetching && !registrations.length}
/>

{loggedIn &&
Expand Down
18 changes: 14 additions & 4 deletions app/routes/events/components/EventDetail/SidebarInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ export const SidebarInfo = ({ event }: Props) => {
iconNode={<BriefcaseBusiness />}
size={20}
content={
<Link to={`/companies/${event.company.id}`}>
{event.company.name}
</Link>
event.company.name ? (
<Link to={`/companies/${event.company.id}`}>
{event.company.name}
</Link>
) : (
<Skeleton className={styles.sidebarInfo} width={100} />
)
}
className={styles.sidebarInfo}
/>
Expand All @@ -57,7 +61,13 @@ export const SidebarInfo = ({ event }: Props) => {
<TextWithIcon
iconNode={<Coins />}
size={20}
content={event.priceMember / 100 + ',-'}
content={
event.priceMember ? (
event.priceMember / 100 + ',-'
) : (
<Skeleton className={styles.sidebarInfo} width={50} />
)
}
className={styles.sidebarInfo}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion app/routes/events/components/EventDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ const EventDetail = () => {

<Line />

{showSkeleton ? (
{fetching && !event?.createdBy && !event?.responsibleUsers ? (
<Flex column gap="var(--spacing-sm)">
<Flex gap="var(--spacing-md)" className={styles.sidebarInfo}>
Arrangør
Expand Down
3 changes: 3 additions & 0 deletions app/routes/events/components/JoinEventForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Icon,
LoadingIndicator,
ProgressBar,
Skeleton,
} from '@webkom/lego-bricks';
import { sumBy } from 'lodash';
import { CircleHelp, UserMinus } from 'lucide-react';
Expand Down Expand Up @@ -330,6 +331,8 @@ const JoinEventForm = ({
registrationMessage(event)
) : (
<>
{!event?.activationTime && <Skeleton array={2} height={35} />}

{!formOpen && event.activationTime && (
<div>
Åpner om{' '}
Expand Down

0 comments on commit 84f5f57

Please sign in to comment.