♻️(frontend) rework how we handle screens and layout code

Previously each route rendered its whole layout from a to z.
Now each route updates a single common wrapper when the layout changes
between pages.

Also the Loading, Error, UserFetched, QueryAware code is more explicit
and understandable.

This introduces valtio as dependency, allowing us to deal with global
state easily in a svelte/vue way (reactive mutable state). This limits
the boilerplaty-ness of immutable state lib approaches, while keeping
rendering optimization better than homemade react contexts.
This commit is contained in:
Emmanuel Pelletier
2024-07-29 18:32:56 +02:00
parent 952e6970f0
commit 1f57adc4da
30 changed files with 387 additions and 239 deletions

View File

@@ -0,0 +1,12 @@
import { CenteredContent } from '@/layout/CenteredContent'
import { Screen } from '@/layout/Screen'
import { useTranslation } from 'react-i18next'
export const ErrorScreen = () => {
const { t } = useTranslation()
return (
<Screen layout="centered">
<CenteredContent title={t('error.heading')} withBackButton />
</Screen>
)
}