mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 08:49:34 -05:00
aa480a2663
[web] migrate from window attributes to getMeta GitOrigin-RevId: 3dcf1ab6b01155e5e4abeb3e78d0fa9053e055bc
33 lines
868 B
TypeScript
33 lines
868 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'
|
|
|
|
function GroupInvites() {
|
|
const { t } = useTranslation()
|
|
const teamInvites = 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
|