Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

studio: prevent empty dashboard from displaying before sidebar renders #934

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions studio/src/components/GlobalNav/Sidebar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { Link, useLocation } from 'react-router-dom';
import { Layout, Menu, Popover, List, Avatar, Button } from 'antd';
import { Layout, Menu, Popover, List, Avatar, Button, Skeleton } from 'antd';
import routes, { sidebarMenu } from '../../config/routesConfig';
import _ from 'lodash';
import { setCollapse } from './../../actions/sidebar';
Expand Down Expand Up @@ -46,9 +46,6 @@ function Sidebar({ superOrg, permission, orgs, loading, applications, services,
return () => window.removeEventListener('resize', handleResize);
}, []);

if (loading) {
return null;
}
let resource = [
'home',
'dashboard',
Expand Down Expand Up @@ -244,6 +241,18 @@ function Sidebar({ superOrg, permission, orgs, loading, applications, services,
>
{sidebarMenu.map((menu, index) => {
const { Icon } = menu;
if (loading) {
return (
<Skeleton
paragraph={false}
loading={loading}
style={{ padding: '12px' }}
active
round
avatar={{ shape: 'circle' }}
/>
);
}
return menu.title === 'CORE' && !showCoreMenu
? null
: !menu.isService
Expand Down
Loading