77} from '@tanstack/react-table'
88import { useEffect , useMemo , useState } from 'react'
99import { useInView } from 'react-intersection-observer'
10- import { useHistory , useParams } from 'react-router'
10+ import { useParams } from 'react-router'
1111
12- import { useNavLinks } from 'services/navigation'
1312import A from 'ui/A'
1413import { Card } from 'ui/Card'
1514import Icon from 'ui/Icon'
@@ -96,8 +95,6 @@ interface URLParams {
9695}
9796
9897export default function AccountOrgs ( { account } : AccountOrgsArgs ) {
99- const history = useHistory ( )
100- const { membersTab } = useNavLinks ( )
10198 const { provider, owner } = useParams < URLParams > ( )
10299 const { ref, inView } = useInView ( )
103100 const [ sorting , setSorting ] = useState < SortingState > ( [
@@ -107,11 +104,6 @@ export default function AccountOrgs({ account }: AccountOrgsArgs) {
107104 } ,
108105 ] )
109106
110- const linkToMembersTab = ( orgOwner : string ) =>
111- history . push (
112- membersTab . path ( { owner : encodeURIComponent ( orgOwner ) , provider } )
113- )
114-
115107 const { data, isLoading, hasNextPage, fetchNextPage, isFetchingNextPage } =
116108 useInfiniteAccountOrganizations ( {
117109 provider,
@@ -223,36 +215,25 @@ export default function AccountOrgs({ account }: AccountOrgsArgs) {
223215 ) : (
224216 table . getRowModel ( ) . rows . map ( ( row ) =>
225217 row . original . isCurrentUserPartOfOrg ? (
226- < tr
227- key = { row . id }
228- className = "h-14 hover:cursor-pointer hover:bg-ds-gray-primary"
229- onClick = { ( ) => linkToMembersTab ( row . original . name ) }
230- >
231- { row . getVisibleCells ( ) . map ( ( cell ) => (
232- < td key = { cell . id } >
233- { flexRender (
234- cell . column . columnDef . cell ,
235- cell . getContext ( )
236- ) }
237- </ td >
238- ) ) }
239- </ tr >
240- ) : (
241218 < tr key = { row . id } className = "h-14" >
242219 { row . getVisibleCells ( ) . map ( ( cell ) => (
243220 < td key = { cell . id } >
244- { cell . id === 'activatedUserCount' ? (
245- < div className = "flex justify-items -end" >
221+ { cell . column . id === 'activatedUserCount' ? (
222+ < div className = "flex w-full justify -end" >
246223 { /* @ts -ignore-error */ }
247224 < A
248225 to = { {
249226 pageName : 'membersTab' ,
250227 options : {
251- owner : cell . getValue ( ) ,
228+ owner : encodeURIComponent (
229+ row . original . name
230+ ) ,
252231 provider,
253232 } ,
254233 } }
255- />
234+ >
235+ { cell . getValue ( ) }
236+ </ A >
256237 </ div >
257238 ) : (
258239 flexRender (
@@ -263,6 +244,17 @@ export default function AccountOrgs({ account }: AccountOrgsArgs) {
263244 </ td >
264245 ) ) }
265246 </ tr >
247+ ) : (
248+ < tr key = { row . id } className = "h-14" >
249+ { row . getVisibleCells ( ) . map ( ( cell ) => (
250+ < td key = { cell . id } >
251+ { flexRender (
252+ cell . column . columnDef . cell ,
253+ cell . getContext ( )
254+ ) }
255+ </ td >
256+ ) ) }
257+ </ tr >
266258 )
267259 )
268260 ) }
0 commit comments