Skip to content

Commit

Permalink
refactor: texts
Browse files Browse the repository at this point in the history
  • Loading branch information
NoamGaash committed Dec 13, 2023
1 parent 8d0dce3 commit ca976fc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
6 changes: 5 additions & 1 deletion src/locale/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,9 @@
"bearing": "מעלות",
"coords": "נ.צ.",
"hide_document": "הסתר מידע לגיקים",
"show_document": "הצג מידע לגיקים"
"show_document": "הצג מידע לגיקים",
"lineProfile": {
"title": "פרופיל קו",
"notFound":"לא הצלחנו למצוא את הקו שחיפשת :("
}
}
28 changes: 18 additions & 10 deletions src/pages/Profile.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
import styled from 'styled-components'
import { useContext } from 'react'
import Grid from '@mui/material/Unstable_Grid2' // Grid version 2
import moment from 'moment'

import { Label } from './components/Label'
import { NotFound } from './components/NotFound'
import { PageContainer } from './components/PageContainer'

import { useTranslation } from 'react-i18next'
import { PageSearchState, SearchContext } from '../model/pageState'
import LineNumberSelector from './components/LineSelector'
import OperatorSelector from './components/OperatorSelector'
import RouteSelector from './components/RouteSelector'

//API
// import { /*getGtfsRidesList,*/ getRidesAsync } from 'src/api/profileService'
import { getRoutesAsync } from '../api/gtfsService'
import Widget from 'src/shared/Widget'
import { useLoaderData } from 'react-router-dom'

Expand All @@ -39,13 +31,29 @@ const GeneralDetailsAboutLine = () => {

const LineProfileComponent = () => {
const { t } = useTranslation()
const route = useLoaderData() as any
const route = useLoaderData() as {
// TODO: find better type definition
agency_name: string
route_short_name: string
route_long_name: string
message?: string
}
console.log('route', route)

if (route.message)
return (
<NotFound>
<Widget>
<h1>{t('lineProfile.notFound')}</h1>
<pre>{route.message}</pre>
</Widget>
</NotFound>
)

return (
<Grid xs={12} lg={6}>
<Widget>
<h2 className="title">{t('profile_page')}</h2>
<h2 className="title">{t('lineProfile.title')}</h2>
<label> מפעיל: {route.agency_name} </label>
<br></br>
<label> מספר קו: {route.route_short_name} </label>
Expand Down

0 comments on commit ca976fc

Please sign in to comment.