Skip to content

Commit

Permalink
Added loading variable (#590)
Browse files Browse the repository at this point in the history
* Events Navbar persistent

* Relevant messages displayed for empty tables

* Prettier

* Loading

---------

Co-authored-by: Subramani E <[email protected]>
  • Loading branch information
jatulya and subru-37 authored Dec 14, 2024
1 parent 635439d commit e60ae91
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default function AttributeById() {
router.push(`/${orgId}/events/${eventId}/participants/${row.id}`);
}}
/>
{attributeDetails.length === 0 ? (
{(!loading && attributeDetails.length === 0 )? (
<div style={{ textAlign: 'center', margin: '20px' }}>
<Text fontSize="25px" color={'blackAlpha.800'} mb={3}>
No participants assigned
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export default function Attributes() {
router.push(`/${orgId}/events/${eventId}/attributes/${row.id}`);
}}
/>
{attributes.length === 0 ? (
{(!loading && attributes.length === 0) ? (
<div style={{ textAlign: 'center', margin: '20px' }}>
<Text fontSize="25px" color={'blackAlpha.800'} mb={3}>
No attributes created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default function ExtraById() {
router.push(`/${orgId}/events/${eventId}/participants/${row.id}`);
}}
/>
{extraDetails.length === 0 ? (
{(!loading && extraDetails.length === 0 )? (
<div style={{ textAlign: 'center', margin: '20px' }}>
<Text fontSize="25px" color={'blackAlpha.800'} mb={3}>
No participants assigned
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export default function Extras() {
router.push(`/${orgId}/events/${eventId}/extras/${row.id}`);
}}
/>
{extras.length === 0 ? (
{(!loading && extras.length === 0) ? (
<div style={{ textAlign: 'center', margin: '20px' }}>
<Text fontSize="25px" color={'blackAlpha.800'} mb={3}>
No extras created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default function ParticipantById() {
<Text>Extras - {participant.numberOfExtrasCheckedIn} checked in</Text>
<DataDisplay loading={loading} columns={extraColumns} rows={participantExtras} />
</Flex>
{participant.length === 0 ? (
{(!loading && participant.length === 0) ? (
<div style={{ textAlign: 'center', margin: '20px' }}>
<Text fontSize="25px" color={'blackAlpha.800'} mb={3}>
No participants created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export default function ParticipantsCheckIn() {
debugInfo={participantsCheckIn}
>
<NavigationMenu orgId={orgId} eventId={eventId} />

<DataDisplay
loading={loading}
rows={participantsCheckIn}
Expand All @@ -111,7 +112,8 @@ export default function ParticipantsCheckIn() {
router.push(`/${orgId}/events/${eventId}/participants/${row.id}`);
}}
/>
{participantsCheckIn.length === 0 ? (
{
(!loading && participantsCheckIn.length === 0 )? (
<div style={{ textAlign: 'center', margin: '20px' }}>
<Text fontSize="25px" color={'blackAlpha.800'} mb={3}>
No participants checked-in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default function Participants() {
>
<NavigationMenu orgId={orgId} eventId={eventId} />
<DataDisplay loading={loading} rows={participants} columns={columns} />
{participants.length === 0 ? (
{(!loading && participants.length === 0 )? (
<div style={{ textAlign: 'center', margin: '20px' }}>
<Text fontSize="25px" color={'blackAlpha.800'} mb={3}>
No participants
Expand Down
2 changes: 1 addition & 1 deletion apps/web-admin/src/pages/[orgId]/events/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export default function Events() {
router.push(`/${orgId}/events/${row.id}/participants`);
}}
/>
{events.length === 0 ? (
{ (!loading && events.length === 0) ? (
<div style={{ textAlign: 'center', margin: '20px' }}>
<Text fontSize="25px" color={'blackAlpha.800'} mb={3}>
No events for this organization
Expand Down
2 changes: 1 addition & 1 deletion apps/web-admin/src/pages/[orgId]/members/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export default function OrganizationMembers() {
debugInfo={members}
>
<DataDisplay loading={loading} columns={columns} rows={members} />
{members.length === 0 ? (
{(!loading && members.length === 0 ) ? (
<div style={{ textAlign: 'center', margin: '20px' }}>
<Text fontSize="25px" color={'blackAlpha.800'} mb={3}>
No members for the event
Expand Down

0 comments on commit e60ae91

Please sign in to comment.