♻️(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:
12
src/frontend/src/components/ErrorScreen.tsx
Normal file
12
src/frontend/src/components/ErrorScreen.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user