File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import React from 'react' ;
12import hasPermission from 'utils/permissions' ;
23import { boxStyle , boxStyleDark } from 'styles' ;
34import { connect } from 'react-redux' ;
45import { useEffect } from 'react' ;
56import { useRef } from 'react' ;
67import { SEARCH , CREATE_NEW_TEAM } from '../../languages/en/ui' ;
7-
88/**
99 * The search panel stateless component for Teams grid
1010 */
1111export function TeamTableSearchPanelBase ( props ) {
1212 const { darkMode } = props ;
13- const canPostTeam = props . hasPermission ( 'postTeam' ) ;
13+
14+ const [ canPostTeam , setCanPostTeam ] = React . useState ( props . hasPermission ( 'postTeam' ) ) ;
15+
16+ // prettier-ignore
17+ if ( canPostTeam === false ) setTimeout ( ( ) => setCanPostTeam ( props . hasPermission ( 'postTeam' ) ) , 1000 ) ;
18+
1419 const inputRef = useRef ( null ) ;
1520
1621 useEffect ( ( ) => {
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ class Teams extends React.PureComponent {
110110 }
111111
112112 render ( ) {
113+ // eslint-disable-next-line no-unused-vars
113114 const { allTeams, fetching } = this . props . state . allTeamsData ;
114115 const { darkMode } = this . props . state . theme ;
115116 const numberOfTeams = allTeams && allTeams . length ;
@@ -121,8 +122,10 @@ class Teams extends React.PureComponent {
121122 className = { `teams-container ${ darkMode ? 'bg-oxford-blue text-light' : '' } ` }
122123 style = { { minHeight : '100%' } }
123124 >
124- { fetching ? (
125- < Loading />
125+ { allTeams . length === 0 ? (
126+ < div className = "text-center" >
127+ < Loading />
128+ </ div >
126129 ) : (
127130 < div className = "container mt-3" >
128131 { this . teampopupElements ( allTeams ) }
You can’t perform that action at this time.
0 commit comments