Skip to content

Commit 52d48b6

Browse files
committed
Reverted the previous change and only display the skeleton loader if guilds is not defined.
1 parent 8ed9f47 commit 52d48b6

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

web-ui/src/components/guild-results/GuildResults.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import React, { useContext, useState } from 'react';
33
import GroupIcon from '@mui/icons-material/Group';
44
import { Button, TextField } from '@mui/material';
55
import { styled } from '@mui/material/styles';
6-
import Typography from '@mui/material/Typography';
76

87
import { createGuild, getGuildLeaders } from '../../api/guild';
98
import { ADD_GUILD } from '../../context/actions';
109
import { AppContext } from '../../context/AppContext';
1110
import AddGuildModal from './EditGuildModal';
1211
import GuildSummaryCard from './GuildSummaryCard';
12+
import SkeletonLoader from '../skeleton_loader/SkeletonLoader';
1313
import { useQueryParameters } from '../../helpers/query-parameters';
1414
import './GuildResults.css';
1515

@@ -113,8 +113,8 @@ const GuildResults = () => {
113113
</div>
114114
</div>
115115
<div className="guilds">
116-
{guilds?.length
117-
? guilds?.map((guild, index) =>
116+
{guilds
117+
? guilds.map((guild, index) =>
118118
guild.name.toLowerCase().includes(searchText.toLowerCase()) ? (
119119
<GuildSummaryCard
120120
key={`guild-summary-${guild.id}`}
@@ -125,7 +125,9 @@ const GuildResults = () => {
125125
/>
126126
) : null
127127
)
128-
: <Typography variant="h5">None Available</Typography>}
128+
: Array.from({ length: 20 }).map((_, index) => (
129+
<SkeletonLoader key={index} type="guild" />
130+
))}
129131
</div>
130132
</Root>
131133
);

web-ui/src/components/guild-results/__snapshots__/GuildResults.test.jsx.snap

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,7 @@ exports[`renders correctly when no guilds are loaded 1`] = `
352352
</div>
353353
<div
354354
class="guilds"
355-
>
356-
<h5
357-
class="MuiTypography-root MuiTypography-h5 css-ag7rrr-MuiTypography-root"
358-
>
359-
None Available
360-
</h5>
361-
</div>
355+
/>
362356
</div>
363357
</div>
364358
`;

web-ui/src/pages/__snapshots__/GuildsPage.test.jsx.snap

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,7 @@ exports[`renders correctly 1`] = `
5353
</div>
5454
<div
5555
class="guilds"
56-
>
57-
<h5
58-
class="MuiTypography-root MuiTypography-h5 css-ag7rrr-MuiTypography-root"
59-
>
60-
None Available
61-
</h5>
62-
</div>
56+
/>
6357
</div>
6458
</div>
6559
</div>

0 commit comments

Comments
 (0)