♻️(frontend) put homepage in its own feature
makes more sense i guess, maybe
This commit is contained in:
@@ -5,7 +5,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useLang } from 'hoofd'
|
||||
import { Route, Switch } from 'wouter'
|
||||
import { Home } from './routes/Home'
|
||||
import { HomeRoute } from '@/features/home'
|
||||
import { NotFound } from './routes/NotFound'
|
||||
import { RoomRoute } from '@/features/rooms'
|
||||
import './i18n/init'
|
||||
@@ -18,7 +18,7 @@ function App() {
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<Switch>
|
||||
<Route path="/" component={Home} />
|
||||
<Route path="/" component={HomeRoute} />
|
||||
<Route path="/:roomId" component={RoomRoute} />
|
||||
<Route component={NotFound} />
|
||||
</Switch>
|
||||
|
||||
2
src/frontend/src/features/home/index.ts
Normal file
2
src/frontend/src/features/home/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export { navigateToHome } from './navigation/navigateToHome'
|
||||
export { Home as HomeRoute } from './routes/Home'
|
||||
@@ -5,11 +5,11 @@ import { navigateToNewRoom } from '@/features/rooms'
|
||||
import { Screen } from '@/layout/Screen'
|
||||
|
||||
export const Home = () => {
|
||||
const { t } = useTranslation(undefined, { keyPrefix: 'homepage' })
|
||||
const { t } = useTranslation('home')
|
||||
const { isLoggedIn } = useUser()
|
||||
return (
|
||||
<Screen>
|
||||
<Box asScreen>
|
||||
<Box type="screen">
|
||||
<H lvl={1}>{t('heading')}</H>
|
||||
<P>{t('intro')}</P>
|
||||
<Div marginBottom="gutter">
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from '@livekit/components-react'
|
||||
import { keys } from '@/api/queryKeys'
|
||||
import { QueryAware } from '@/layout/QueryAware'
|
||||
import { navigateToHome } from '@/navigation/navigateToHome'
|
||||
import { navigateToHome } from '@/features/home'
|
||||
import { fetchRoom } from '../api/fetchRoom'
|
||||
|
||||
export const Conference = ({
|
||||
|
||||
@@ -12,13 +12,5 @@
|
||||
"loading": "",
|
||||
"notFound": {
|
||||
"heading": ""
|
||||
},
|
||||
"homepage": {
|
||||
"heading": "",
|
||||
"intro": "",
|
||||
"createMeeting": "",
|
||||
"login": "",
|
||||
"or": "",
|
||||
"copyMeetingUrl": ""
|
||||
}
|
||||
}
|
||||
|
||||
8
src/frontend/src/locales/de/home.json
Normal file
8
src/frontend/src/locales/de/home.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"heading": "",
|
||||
"intro": "",
|
||||
"createMeeting": "",
|
||||
"login": "",
|
||||
"or": "",
|
||||
"copyMeetingUrl": ""
|
||||
}
|
||||
@@ -12,13 +12,5 @@
|
||||
"loading": "Loading…",
|
||||
"notFound": {
|
||||
"heading": ""
|
||||
},
|
||||
"homepage": {
|
||||
"heading": "Welcome in Meet",
|
||||
"intro": "What do you want to do? You can either:",
|
||||
"createMeeting": "Create a conference call",
|
||||
"login": "Login to create a conference call",
|
||||
"or": "Or",
|
||||
"copyMeetingUrl": "copy a meeting URL in your browser address bar to join an existing conference call"
|
||||
}
|
||||
}
|
||||
|
||||
8
src/frontend/src/locales/en/home.json
Normal file
8
src/frontend/src/locales/en/home.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"heading": "Welcome in Meet",
|
||||
"intro": "What do you want to do? You can either:",
|
||||
"createMeeting": "Create a conference call",
|
||||
"login": "Login to create a conference call",
|
||||
"or": "Or",
|
||||
"copyMeetingUrl": "copy a meeting URL in your browser address bar to join an existing conference call"
|
||||
}
|
||||
@@ -12,13 +12,5 @@
|
||||
"loading": "Chargement…",
|
||||
"notFound": {
|
||||
"heading": "Page introuvable"
|
||||
},
|
||||
"homepage": {
|
||||
"heading": "Bienvenue dans Meet",
|
||||
"intro": "Que voulez vous faire ? Vous pouvez :",
|
||||
"createMeeting": "Créer une conférence",
|
||||
"login": "Vous connecter pour créer une conférence",
|
||||
"or": "Ou",
|
||||
"copyMeetingUrl": "copier une URL de conférence dans votre barre d'adresse pour rejoindre une conférence existante"
|
||||
}
|
||||
}
|
||||
|
||||
8
src/frontend/src/locales/fr/home.json
Normal file
8
src/frontend/src/locales/fr/home.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"heading": "Bienvenue dans Meet",
|
||||
"intro": "Que voulez vous faire ? Vous pouvez :",
|
||||
"createMeeting": "Créer une conférence",
|
||||
"login": "Vous connecter pour créer une conférence",
|
||||
"or": "Ou",
|
||||
"copyMeetingUrl": "copier une URL de conférence dans votre barre d'adresse pour rejoindre une conférence existante"
|
||||
}
|
||||
Reference in New Issue
Block a user