fix: flickering when transitioning to some pages
This commit is contained in:
parent
b603081691
commit
aa5e1c0661
@ -171,7 +171,7 @@ const AddUserPopup: React.FC<AddUserPopupProps> = ({ onAddUser }) => {
|
||||
|
||||
const AdminRoute = () => {
|
||||
useEffect(() => {
|
||||
document.title = 'Taskcafé | Admin';
|
||||
document.title = 'Admin | Taskcafé';
|
||||
}, []);
|
||||
const { loading, data } = useUsersQuery();
|
||||
const { showPopup, hidePopup } = usePopup();
|
||||
|
@ -260,11 +260,7 @@ const Projects = () => {
|
||||
},
|
||||
});
|
||||
if (loading) {
|
||||
return (
|
||||
<>
|
||||
<span>loading</span>
|
||||
</>
|
||||
);
|
||||
return <GlobalTopNavbar onSaveProjectName={NOOP} projectID={null} name={null} />;
|
||||
}
|
||||
|
||||
const colors = ['#e362e3', '#7a6ff0', '#37c5ab', '#aa62e3', '#e8384f'];
|
||||
|
@ -85,18 +85,30 @@ type TeamsRouteProps = {
|
||||
const Teams = () => {
|
||||
const { teamID } = useParams<TeamsRouteProps>();
|
||||
const history = useHistory();
|
||||
const { loading, data } = useGetTeamQuery({ variables: { teamID } });
|
||||
const { loading, data } = useGetTeamQuery({
|
||||
variables: { teamID },
|
||||
onCompleted: resp => {
|
||||
document.title = `${resp.findTeam.name} | Taskcafé`;
|
||||
},
|
||||
});
|
||||
const { user } = useCurrentUser();
|
||||
const [currentTab, setCurrentTab] = useState(0);
|
||||
const match = useRouteMatch();
|
||||
useEffect(() => {
|
||||
document.title = 'Teams | Taskcafé';
|
||||
}, []);
|
||||
if (loading) {
|
||||
return (
|
||||
<>
|
||||
<span>loading</span>
|
||||
</>
|
||||
<GlobalTopNavbar
|
||||
menuType={[
|
||||
{ name: 'Projects', link: `${match.url}` },
|
||||
{ name: 'Members', link: `${match.url}/members` },
|
||||
]}
|
||||
currentTab={currentTab}
|
||||
onSetTab={tab => {
|
||||
setCurrentTab(tab);
|
||||
}}
|
||||
onSaveProjectName={NOOP}
|
||||
projectID={null}
|
||||
name={null}
|
||||
/>
|
||||
);
|
||||
}
|
||||
if (data && user) {
|
||||
|
Loading…
Reference in New Issue
Block a user