mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
0639f266d8
[web] Redirect to invite screen if new user register with a pending group invitations GitOrigin-RevId: 39aeffd65b9d793c87e53398a700ad140794594e
34 lines
952 B
TypeScript
34 lines
952 B
TypeScript
import { useEffect } from 'react'
|
|
import { Col, Row } from 'react-bootstrap'
|
|
import { useTranslation } from 'react-i18next'
|
|
import getMeta from '@/utils/meta'
|
|
import { useLocation } from '@/shared/hooks/use-location'
|
|
import GroupInvitesItem from './group-invites-item'
|
|
import type { TeamInvite } from '../../../../../../types/team-invite'
|
|
|
|
function GroupInvites() {
|
|
const { t } = useTranslation()
|
|
const teamInvites: TeamInvite[] = getMeta('ol-teamInvites')
|
|
const location = useLocation()
|
|
|
|
useEffect(() => {
|
|
if (teamInvites.length === 0) {
|
|
location.assign('/project')
|
|
}
|
|
}, [teamInvites, location])
|
|
|
|
return (
|
|
<div className="container">
|
|
<Row>
|
|
<Col md={8} mdOffset={2}>
|
|
<h1>{t('group_invitations')}</h1>
|
|
</Col>
|
|
</Row>
|
|
{teamInvites.map(teamInvite => (
|
|
<GroupInvitesItem teamInvite={teamInvite} key={teamInvite._id} />
|
|
))}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default GroupInvites
|