empty when at end of search
This commit is contained in:
parent
f1fd1f3c9c
commit
d22991bc3b
@ -1,7 +1,7 @@
|
|||||||
import { Button } from 'react-bootstrap'
|
import { Button } from 'react-bootstrap'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
|
|
||||||
export default function MoreFooter ({ cursor, fetchMore, Skeleton }) {
|
export default function MoreFooter ({ cursor, fetchMore, Skeleton, noMoreText }) {
|
||||||
const [loading, setLoading] = useState(false)
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
@ -28,7 +28,7 @@ export default function MoreFooter ({ cursor, fetchMore, Skeleton }) {
|
|||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Footer = () => (
|
Footer = () => (
|
||||||
<div className='text-muted' style={{ fontFamily: 'lightning', fontSize: '2rem', opacity: '0.6' }}>GENISIS</div>
|
<div className='text-muted' style={{ fontFamily: 'lightning', fontSize: '2rem', opacity: '0.6' }}>{noMoreText || 'GENISIS'}</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ export default function SearchItems ({ variables, items, pins, cursor }) {
|
|||||||
</div>
|
</div>
|
||||||
<MoreFooter
|
<MoreFooter
|
||||||
cursor={cursor} fetchMore={fetchMore}
|
cursor={cursor} fetchMore={fetchMore}
|
||||||
|
noMoreText='EMPTY'
|
||||||
Skeleton={() => <ItemsSkeleton />}
|
Skeleton={() => <ItemsSkeleton />}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
@ -8,6 +8,7 @@ export const getServerSideProps = getGetServerSideProps(ITEM_SEARCH, null, null,
|
|||||||
|
|
||||||
export default function Index ({ data: { search: { items, cursor } } }) {
|
export default function Index ({ data: { search: { items, cursor } } }) {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<SearchItems
|
<SearchItems
|
||||||
|
Loading…
x
Reference in New Issue
Block a user