Fix mercure info loading in shlink-web-component

This commit is contained in:
Alejandro Celaya
2023-07-27 09:22:03 +02:00
parent d49da185d3
commit 0169060de7
7 changed files with 22 additions and 37 deletions

View File

@@ -10,10 +10,6 @@ import { useSwipeable, useToggle } from '../src/utils/helpers/hooks';
import { useFeature } from './utils/features';
import { useRoutesPrefix } from './utils/routesPrefix';
type MainProps = {
loadMercureInfo: () => void;
};
export const Main = (
TagsList: FC,
ShortUrlsList: FC,
@@ -26,22 +22,17 @@ export const Main = (
Overview: FC,
EditShortUrl: FC,
ManageDomains: FC,
): FC<MainProps> => ({ loadMercureInfo }) => {
): FC => () => {
const location = useLocation();
const routesPrefix = useRoutesPrefix();
const [sidebarVisible, toggleSidebar, showSidebar, hideSidebar] = useToggle();
useEffect(() => hideSidebar(), [location]);
// FIXME Re-load mercure info every time server changes
// useEffect(() => {
// loadMercureInfo();
// }, []);
const addDomainVisitsRoute = useFeature('domainVisits');
const burgerClasses = classNames('menu-layout__burger-icon', { 'menu-layout__burger-icon--active': sidebarVisible });
const swipeableProps = useSwipeable(showSidebar, hideSidebar);
// TODO Check if this is already wrapped by a router, and wrap otherwise
// FIXME Check if this is already wrapped by a router, and wrap otherwise
return (
<>