Skip to content

Commit

Permalink
♻️(frontend) put homepage in its own feature
Browse files Browse the repository at this point in the history
makes more sense i guess, maybe
  • Loading branch information
manuhabitela committed Jul 20, 2024
1 parent f888fc1 commit 789bce5
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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>
Expand Down
2 changes: 2 additions & 0 deletions src/frontend/src/features/home/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { navigateToHome } from './navigation/navigateToHome'
export { Home as HomeRoute } from './routes/Home'
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/features/rooms/components/Conference.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ({
Expand Down
8 changes: 0 additions & 8 deletions src/frontend/src/locales/de/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,5 @@
"loading": "",
"notFound": {
"heading": ""
},
"homepage": {
"heading": "",
"intro": "",
"createMeeting": "",
"login": "",
"or": "",
"copyMeetingUrl": ""
}
}
8 changes: 8 additions & 0 deletions src/frontend/src/locales/de/home.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"heading": "",
"intro": "",
"createMeeting": "",
"login": "",
"or": "",
"copyMeetingUrl": ""
}
8 changes: 0 additions & 8 deletions src/frontend/src/locales/en/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 8 additions & 0 deletions src/frontend/src/locales/en/home.json
Original file line number Diff line number Diff line change
@@ -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"
}
8 changes: 0 additions & 8 deletions src/frontend/src/locales/fr/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 8 additions & 0 deletions src/frontend/src/locales/fr/home.json
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit 789bce5

Please sign in to comment.