mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 08:18:02 -05:00
246157cf63
* [web] Wiring work for `/subscription/invites` BS5 migration * [web] Migrate group-invites.tsx to BS5 * [web] Migrate group-invites-item.tsx to BS5 GitOrigin-RevId: a12aafce3ad0040dc500f5f29b1a20fbae4a748e
34 lines
951 B
TypeScript
34 lines
951 B
TypeScript
import { useEffect } from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import getMeta from '@/utils/meta'
|
|
import { useLocation } from '@/shared/hooks/use-location'
|
|
import GroupInvitesItem from './group-invites-item'
|
|
import OLRow from '@/features/ui/components/ol/ol-row'
|
|
import OLCol from '@/features/ui/components/ol/ol-col'
|
|
|
|
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">
|
|
<OLRow>
|
|
<OLCol lg={{ span: 8, offset: 2 }}>
|
|
<h1>{t('group_invitations')}</h1>
|
|
</OLCol>
|
|
</OLRow>
|
|
{teamInvites.map(teamInvite => (
|
|
<GroupInvitesItem teamInvite={teamInvite} key={teamInvite._id} />
|
|
))}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default GroupInvites
|