Skip to content
Snippets Groups Projects
Verified Commit 64161ead authored by Andreas Ellewsen's avatar Andreas Ellewsen
Browse files

Use language fallback on sponsor page

parent 7dd5ba00
No related branches found
No related tags found
1 merge request!267Mark roles expiring soon
...@@ -22,7 +22,7 @@ import { useTranslation, Trans } from 'react-i18next' ...@@ -22,7 +22,7 @@ import { useTranslation, Trans } from 'react-i18next'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import { Guest, Role } from 'interfaces' import { Guest, Role } from 'interfaces'
import { isBefore } from 'date-fns' import { isBefore } from 'date-fns'
import { getRoleName, getRoleOuName } from 'utils'
import SponsorGuestButtons from '../../components/sponsorGuestButtons' import SponsorGuestButtons from '../../components/sponsorGuestButtons'
interface GuestProps { interface GuestProps {
...@@ -118,7 +118,7 @@ const Status = ({ status }: StatusProps) => { ...@@ -118,7 +118,7 @@ const Status = ({ status }: StatusProps) => {
} }
const PersonLine = ({ person, role }: PersonLineProps) => { const PersonLine = ({ person, role }: PersonLineProps) => {
const [t, i18n] = useTranslation(['common']) const [t] = useTranslation(['common'])
const today = new Date() const today = new Date()
today.setHours(0, 0, 0, 0) today.setHours(0, 0, 0, 0)
let status = '' let status = ''
...@@ -140,13 +140,9 @@ const PersonLine = ({ person, role }: PersonLineProps) => { ...@@ -140,13 +140,9 @@ const PersonLine = ({ person, role }: PersonLineProps) => {
<TableCell component="th" scope="row"> <TableCell component="th" scope="row">
{`${person.first} ${person.last}`} {`${person.first} ${person.last}`}
</TableCell> </TableCell>
<TableCell align="left"> <TableCell align="left">{getRoleName(role)}</TableCell>
{i18n.language === 'en' ? role.name_en : role.name_nb}
</TableCell>
<Status status={status} /> <Status status={status} />
<TableCell align="left"> <TableCell align="left">{getRoleOuName(role)}</TableCell>
{i18n.language === 'en' ? role.ou_en : role.ou_nb}
</TableCell>
<TableCell align="left"> <TableCell align="left">
<Button <Button
variant="contained" variant="contained"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment