mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-05-06 11:43:03 +03:00
Finished migrating servers module to TS
This commit is contained in:
parent
ef630af154
commit
c0f5d9c12c
8 changed files with 130 additions and 142 deletions
src/common
|
@ -1,5 +1,5 @@
|
|||
import React, { FC, useEffect } from 'react';
|
||||
import { Route, RouteChildrenProps, Switch } from 'react-router-dom';
|
||||
import { Route, Switch } from 'react-router-dom';
|
||||
import { EventData, Swipeable } from 'react-swipeable';
|
||||
import { faBars as burgerIcon } from '@fortawesome/free-solid-svg-icons';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
|
@ -7,15 +7,11 @@ import classNames from 'classnames';
|
|||
import { withSelectedServer } from '../servers/helpers/withSelectedServer';
|
||||
import { useToggle } from '../utils/helpers/hooks';
|
||||
import { versionMatch } from '../utils/helpers/version';
|
||||
import { isReachableServer, SelectedServer } from '../servers/data';
|
||||
import { isReachableServer } from '../servers/data';
|
||||
import NotFound from './NotFound';
|
||||
import { AsideMenuProps } from './AsideMenu';
|
||||
import './MenuLayout.scss';
|
||||
|
||||
interface MenuLayoutProps extends RouteChildrenProps {
|
||||
selectedServer: SelectedServer;
|
||||
}
|
||||
|
||||
const MenuLayout = (
|
||||
TagsList: FC,
|
||||
ShortUrls: FC,
|
||||
|
@ -25,7 +21,7 @@ const MenuLayout = (
|
|||
TagVisits: FC,
|
||||
ShlinkVersions: FC,
|
||||
ServerError: FC,
|
||||
) => withSelectedServer(({ location, selectedServer }: MenuLayoutProps) => {
|
||||
) => withSelectedServer(({ location, selectedServer }) => {
|
||||
const [ sidebarVisible, toggleSidebar, showSidebar, hideSidebar ] = useToggle();
|
||||
|
||||
useEffect(() => hideSidebar(), [ location ]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue