-
Notifications
You must be signed in to change notification settings - Fork 331
/
ManageTeamList.tsx
57 lines (53 loc) · 1.4 KB
/
ManageTeamList.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import styled from '@emotion/styled'
import graphql from 'babel-plugin-relay/macro'
import React from 'react'
import {useFragment} from 'react-relay'
import {ManageTeamList_team$key} from '../../../../__generated__/ManageTeamList_team.graphql'
import ManageTeamMember from './ManageTeamMember'
const List = styled('div')({
display: 'flex',
flexDirection: 'column',
overflowY: 'auto',
padding: '0px 0px 8px',
position: 'relative',
width: '100%',
minHeight: 0 // required for FF68
})
interface Props {
manageTeamMemberId?: string | null
team: ManageTeamList_team$key
}
const ManageTeamList = (props: Props) => {
const {manageTeamMemberId} = props
const team = useFragment(
graphql`
fragment ManageTeamList_team on Team {
isLead
isOrgAdmin
teamMembers(sortBy: "preferredName") {
id
preferredName
...ManageTeamMember_teamMember
}
}
`,
props.team
)
const {isLead: isViewerLead, isOrgAdmin: isViewerOrgAdmin, teamMembers} = team
return (
<List>
{teamMembers.map((teamMember) => {
return (
<ManageTeamMember
key={teamMember.id}
isViewerLead={isViewerLead}
isViewerOrgAdmin={isViewerOrgAdmin}
manageTeamMemberId={manageTeamMemberId}
teamMember={teamMember}
/>
)
})}
</List>
)
}
export default ManageTeamList