Skip to content

Commit 9c45d8f

Browse files
committed
test
1 parent f314d60 commit 9c45d8f

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/components/Teams/TeamTableSearchPanel.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1+
import React from 'react';
12
import hasPermission from 'utils/permissions';
23
import { boxStyle, boxStyleDark } from 'styles';
34
import { connect } from 'react-redux';
45
import { useEffect } from 'react';
56
import { useRef } from 'react';
67
import { SEARCH, CREATE_NEW_TEAM } from '../../languages/en/ui';
7-
88
/**
99
* The search panel stateless component for Teams grid
1010
*/
1111
export 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(() => {

src/components/Teams/Teams.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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)}

0 commit comments

Comments
 (0)