Update lint rules
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import React, { useContext, useCallback, useMemo, useState } from 'react';
|
||||
import { INavbarOverride, NavbarContextType } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import type { INavbarOverride, NavbarContextType } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import { useLocalStorage } from '@/base/hooks/useStorage.tsx';
|
||||
|
||||
export const NavBarContext = React.createContext<NavbarContextType>({
|
||||
|
||||
@@ -21,7 +21,8 @@ import SettingsIcon from '@mui/icons-material/Settings';
|
||||
import InfoIcon from '@mui/icons-material/Info';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { msg, plural } from '@lingui/core/macro';
|
||||
import { NavbarItem, NavBarItemMoreGroup } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import type { NavbarItem } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import { NavBarItemMoreGroup } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { DownloaderState } from '@/lib/graphql/generated/graphql.ts';
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { MessageDescriptor } from '@lingui/core';
|
||||
import { OverridableComponent } from '@mui/material/OverridableComponent';
|
||||
import { SvgIconTypeMap } from '@mui/material/SvgIcon';
|
||||
import { ReactNode } from 'react';
|
||||
import { StaticAppRoute } from '@/base/AppRoute.constants.ts';
|
||||
import type { MessageDescriptor } from '@lingui/core';
|
||||
import type { OverridableComponent } from '@mui/material/OverridableComponent';
|
||||
import type { SvgIconTypeMap } from '@mui/material/SvgIcon';
|
||||
import type { ReactNode } from 'react';
|
||||
import type { StaticAppRoute } from '@/base/AppRoute.constants.ts';
|
||||
|
||||
export interface INavbarOverride {
|
||||
status: boolean;
|
||||
@@ -27,8 +27,8 @@ export interface NavbarItem {
|
||||
path: StaticAppRoute;
|
||||
title: MessageDescriptor;
|
||||
moreTitle?: MessageDescriptor;
|
||||
SelectedIconComponent: OverridableComponent<SvgIconTypeMap<{}, 'svg'>>;
|
||||
IconComponent: OverridableComponent<SvgIconTypeMap<{}, 'svg'>>;
|
||||
SelectedIconComponent: OverridableComponent<SvgIconTypeMap<object, 'svg'>>;
|
||||
IconComponent: OverridableComponent<SvgIconTypeMap<object, 'svg'>>;
|
||||
show: 'mobile' | 'desktop' | 'both';
|
||||
moreGroup: NavBarItemMoreGroup;
|
||||
useBadge?: () => { count: number; title: string };
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { NavbarItem } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import { MetadataHistorySettings } from '@/features/history/History.types.ts';
|
||||
import { AppRoutes, StaticAppRoute } from '@/base/AppRoute.constants.ts';
|
||||
import type { NavbarItem } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import type { MetadataHistorySettings } from '@/features/history/History.types.ts';
|
||||
import type { StaticAppRoute } from '@/base/AppRoute.constants.ts';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
|
||||
type NavBarItemDeviceFilterKey = `hide${Capitalize<NavbarItem['show']>}`;
|
||||
|
||||
|
||||
@@ -103,7 +103,9 @@ export function DefaultNavBar() {
|
||||
}, [isMobileWidth]);
|
||||
|
||||
// Allow default navbar to be overrided
|
||||
if (override.status) return override.value;
|
||||
if (override.status) {
|
||||
return override.value;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -27,7 +27,7 @@ import { ListItemLink } from '@/base/components/lists/ListItemLink.tsx';
|
||||
import { useGetOptionForDirection } from '@/features/theme/services/ThemeCreator.ts';
|
||||
import { useNavBarContext } from '@/features/navigation-bar/NavbarContext.tsx';
|
||||
import { useResizeObserver } from '@/base/hooks/useResizeObserver.tsx';
|
||||
import { NavbarItem } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import type { NavbarItem } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import { TypographyMaxLines } from '@/base/components/texts/TypographyMaxLines.tsx';
|
||||
|
||||
const DrawerHeader = styled('div')(({ theme }) => ({
|
||||
|
||||
@@ -9,15 +9,16 @@
|
||||
import BottomNavigation from '@mui/material/BottomNavigation';
|
||||
import BottomNavigationAction from '@mui/material/BottomNavigationAction';
|
||||
import Paper from '@mui/material/Paper';
|
||||
import { CSSProperties, useCallback, useLayoutEffect, useRef, useState } from 'react';
|
||||
import type { CSSProperties } from 'react';
|
||||
import { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import Badge from '@mui/material/Badge';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { useResizeObserver } from '@/base/hooks/useResizeObserver.tsx';
|
||||
import { useNavBarContext } from '@/features/navigation-bar/NavbarContext.tsx';
|
||||
import { NavbarItem } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import { StaticAppRoute } from '@/base/AppRoute.constants.ts';
|
||||
import type { NavbarItem } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import type { StaticAppRoute } from '@/base/AppRoute.constants.ts';
|
||||
|
||||
export const MobileBottomBar = ({ navBarItems }: { navBarItems: NavbarItem[] }) => {
|
||||
const { t } = useLingui();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import { useNavBarContext } from '@/features/navigation-bar/NavbarContext.tsx';
|
||||
import { NavbarContextType } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import type { NavbarContextType } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
|
||||
export const useAppAction = (action: NavbarContextType['action'], dependencies: any[] = []) => {
|
||||
const { setAction } = useNavBarContext();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import { useLayoutEffect } from 'react';
|
||||
import { useNavBarContext } from '@/features/navigation-bar/NavbarContext.tsx';
|
||||
import { NavbarContextType } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import type { NavbarContextType } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
|
||||
export function useAppTitle(
|
||||
title: NavbarContextType['title'],
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { NavbarContextType } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import type { NavbarContextType } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import { useAppTitle } from '@/features/navigation-bar/hooks/useAppTitle.ts';
|
||||
import { useAppAction } from '@/features/navigation-bar/hooks/useAppAction.ts';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user