| 1 |
import { __, sprintf } from '@wordpress/i18n' |
| 2 |
import { SWRConfig } from 'swr' |
| 3 |
import { PagesList } from '@assist/components/PagesList' |
| 4 |
import { TasksList } from '@assist/components/TasksList' |
| 5 |
|
| 6 |
const Page = () => ( |
| 7 |
<div> |
| 8 |
<div className="pt-12 flex justify-center flex-col"> |
| 9 |
<h2 className="text-center text-3xl"> |
| 10 |
{sprintf(__('Welcome to %s', 'extendify'), 'Assist')} |
| 11 |
</h2> |
| 12 |
<p className="text-center text-xl"> |
| 13 |
{__( |
| 14 |
'Manage your site content from a centralized location.', |
| 15 |
'extendify', |
| 16 |
)} |
| 17 |
</p> |
| 18 |
<TasksList /> |
| 19 |
<PagesList /> |
| 20 |
</div> |
| 21 |
</div> |
| 22 |
) |
| 23 |
|
| 24 |
export const AssistLandingPage = () => ( |
| 25 |
<SWRConfig |
| 26 |
value={{ |
| 27 |
onErrorRetry: (error, key, config, revalidate, { retryCount }) => { |
| 28 |
if (error.status === 404) return |
| 29 |
if (error?.data?.status === 403) { |
| 30 |
// if they are logged out, we can't recover |
| 31 |
window.location.reload() |
| 32 |
return |
| 33 |
} |
| 34 |
|
| 35 |
// Retry after 5 seconds. |
| 36 |
setTimeout(() => revalidate({ retryCount }), 5000) |
| 37 |
}, |
| 38 |
}}> |
| 39 |
<Page /> |
| 40 |
</SWRConfig> |
| 41 |
) |
| 42 |
|