37 lines
838 B
JavaScript
37 lines
838 B
JavaScript
|
import { Button } from 'react-bootstrap'
|
||
|
import { useState } from 'react'
|
||
|
|
||
|
export default function MoreFooter ({ cursor, fetchMore, Skeleton }) {
|
||
|
const [loading, setLoading] = useState(false)
|
||
|
|
||
|
if (loading) {
|
||
|
return <div><Skeleton /></div>
|
||
|
}
|
||
|
|
||
|
let Footer
|
||
|
if (cursor) {
|
||
|
Footer = () => (
|
||
|
<Button
|
||
|
variant='primary'
|
||
|
size='md'
|
||
|
onClick={async () => {
|
||
|
setLoading(true)
|
||
|
await fetchMore({
|
||
|
variables: {
|
||
|
cursor
|
||
|
}
|
||
|
})
|
||
|
setLoading(false)
|
||
|
}}
|
||
|
>more
|
||
|
</Button>
|
||
|
)
|
||
|
} else {
|
||
|
Footer = () => (
|
||
|
<div className='text-muted' style={{ fontFamily: 'lightning', fontSize: '2rem', opacity: '0.6' }}>GENISIS</div>
|
||
|
)
|
||
|
}
|
||
|
|
||
|
return <div className='d-flex justify-content-center mt-4 mb-2'><Footer /></div>
|
||
|
}
|