Add no teams found message to other pages

This commit is contained in:
Justin Edmund 2024-04-23 04:00:20 -07:00
parent bba89795a5
commit 4e4f7d2c03
3 changed files with 36 additions and 21 deletions

View file

@ -71,7 +71,8 @@ const ProfileRoute: React.FC<Props> = ({
recordCount, recordCount,
parties, parties,
setParties, setParties,
isFetching, loaded,
fetching,
setFetching, setFetching,
fetchError, fetchError,
fetch, fetch,
@ -155,14 +156,22 @@ const ProfileRoute: React.FC<Props> = ({
} }
const renderInfiniteScroll = ( const renderInfiniteScroll = (
<InfiniteScroll <>
dataLength={parties && parties.length > 0 ? parties.length : 0} {parties.length === 0 && !loaded && renderLoading(3)}
next={() => setCurrentPage(currentPage + 1)} {parties.length === 0 && loaded && (
hasMore={totalPages > currentPage} <div className="notFound">
loader={renderLoading(3)} <h2>There are no teams with your specified filters</h2>
> </div>
<GridRepCollection>{renderParties()}</GridRepCollection> )}
</InfiniteScroll> <InfiniteScroll
dataLength={parties && parties.length > 0 ? parties.length : 0}
next={() => setCurrentPage(currentPage + 1)}
hasMore={totalPages > currentPage}
loader={renderLoading(3)}
>
<GridRepCollection>{renderParties()}</GridRepCollection>
</InfiniteScroll>
</>
) )
if (context) { if (context) {

View file

@ -66,7 +66,8 @@ const SavedRoute: React.FC<Props> = ({
recordCount, recordCount,
parties, parties,
setParties, setParties,
isFetching, loaded,
fetching,
setFetching, setFetching,
fetchError, fetchError,
fetch, fetch,
@ -150,14 +151,22 @@ const SavedRoute: React.FC<Props> = ({
} }
const renderInfiniteScroll = ( const renderInfiniteScroll = (
<InfiniteScroll <>
dataLength={parties && parties.length > 0 ? parties.length : 0} {parties.length === 0 && !loaded && renderLoading(3)}
next={() => setCurrentPage(currentPage + 1)} {parties.length === 0 && loaded && (
hasMore={totalPages > currentPage} <div className="notFound">
loader={renderLoading(3)} <h2>There are no teams with your specified filters</h2>
> </div>
<GridRepCollection>{renderParties()}</GridRepCollection> )}
</InfiniteScroll> <InfiniteScroll
dataLength={parties && parties.length > 0 ? parties.length : 0}
next={() => setCurrentPage(currentPage + 1)}
hasMore={totalPages > currentPage}
loader={renderLoading(3)}
>
<GridRepCollection>{renderParties()}</GridRepCollection>
</InfiniteScroll>
</>
) )
if (context) { if (context) {

View file

@ -32,7 +32,6 @@ import { CollectionPage } from '~utils/enums'
interface Props { interface Props {
context?: PageContextObj context?: PageContextObj
query: { [key: string]: string }
version: AppUpdate version: AppUpdate
error: boolean error: boolean
status?: ResponseStatus status?: ResponseStatus
@ -40,7 +39,6 @@ interface Props {
const TeamsRoute: React.FC<Props> = ({ const TeamsRoute: React.FC<Props> = ({
context, context,
query,
version, version,
error, error,
status, status,
@ -212,7 +210,6 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex
return { return {
props: { props: {
context: { raidGroups }, context: { raidGroups },
query,
version, version,
error: false, error: false,
...(await serverSideTranslations(locale, ['common'])), ...(await serverSideTranslations(locale, ['common'])),