Add recovery for public data loading failures
This commit is contained in:
parent
1171eee510
commit
daa5eba8bd
14 changed files with 186 additions and 58 deletions
|
|
@ -44,7 +44,19 @@ function App() {
|
|||
const route = useHashRoute();
|
||||
const compactGameLayout = useMediaQuery("(max-width: 1439px)");
|
||||
const reducedSidebar = useMediaQuery("(max-width: 1024px)");
|
||||
const { siteContent, siteContentError, games, gamesError, mhwilds, diablo4, aniimo } = useAppData(route);
|
||||
const {
|
||||
siteContent,
|
||||
siteContentError,
|
||||
siteContentLoading,
|
||||
retrySiteContent,
|
||||
games,
|
||||
gamesError,
|
||||
gamesLoading,
|
||||
retryGames,
|
||||
mhwilds,
|
||||
diablo4,
|
||||
aniimo
|
||||
} = useAppData(route);
|
||||
const [filters, setFilters] = useGameFilters();
|
||||
const [confirmModal, setConfirmModal] = useState(null);
|
||||
const [createModal, setCreateModal] = useState(null);
|
||||
|
|
@ -170,9 +182,12 @@ function App() {
|
|||
if (!siteContent) {
|
||||
return (
|
||||
<main className="startup-error">
|
||||
<section className="empty nds-empty-state">
|
||||
<section className="empty nds-empty-state" aria-busy={siteContentLoading}>
|
||||
<h1>Contenu indisponible</h1>
|
||||
<p>{siteContentError || "Chargement du contenu..."}</p>
|
||||
{siteContentError && <button className="nds-button" data-size="sm" data-variant="primary" type="button" onClick={retrySiteContent}>
|
||||
<Icon name="refresh" />Réessayer
|
||||
</button>}
|
||||
</section>
|
||||
</main>
|
||||
);
|
||||
|
|
@ -216,6 +231,8 @@ function App() {
|
|||
siteContent={siteContent}
|
||||
games={games}
|
||||
gamesError={gamesError}
|
||||
gamesLoading={gamesLoading}
|
||||
retryGames={retryGames}
|
||||
mhwilds={mhwilds}
|
||||
diablo4={diablo4}
|
||||
aniimo={aniimo}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue