mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-10-26 11:27:18 +00:00
fix route path
This commit is contained in:
parent
0902003df2
commit
92050ea39a
@ -12,7 +12,7 @@ export const CustomOptionIcon = ({ isSelected, isMulti }: Props) => {
|
||||
if (isMulti) {
|
||||
return (
|
||||
<Icon
|
||||
icon={isSelected ? 'checkbox_checked' : 'checkbox_unchecked'}
|
||||
icon={isSelected ? 'checkbox_on' : 'checkbox_off'}
|
||||
className={cn(theme.select.check, { [theme.select.check_active]: isSelected })}
|
||||
/>
|
||||
);
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
import React from 'react';
|
||||
import cn from 'clsx';
|
||||
import { Icon, Link } from 'panel/common/ui';
|
||||
import { RoutePath } from 'panel/components/Routes/Paths';
|
||||
import { RoutePathKey } from 'panel/components/Routes/Paths';
|
||||
import theme from 'panel/lib/theme';
|
||||
|
||||
import s from './styles.module.pcss';
|
||||
|
||||
type Props = {
|
||||
parentLinks: {
|
||||
path: RoutePath;
|
||||
path: RoutePathKey;
|
||||
title: string;
|
||||
props?: Partial<Record<string, string | number>>;
|
||||
}[];
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import React, { MouseEvent, MouseEventHandler, ReactNode } from 'react';
|
||||
import { Link as L, LinkProps as LProps } from 'react-router-dom';
|
||||
import cn from 'clsx';
|
||||
import { LinkParams, linkPathBuilder, RoutePath } from 'panel/components/Routes/Paths';
|
||||
import { LinkParams, linkPathBuilder, RoutePathKey } from 'panel/components/Routes/Paths';
|
||||
import theme from 'panel/lib/theme';
|
||||
|
||||
type Props = {
|
||||
to: RoutePath;
|
||||
to: RoutePathKey;
|
||||
props?: LinkParams;
|
||||
className?: string;
|
||||
type?: LProps['type'];
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import cn from 'clsx';
|
||||
import { Icon, Link, IconType } from 'panel/common/ui';
|
||||
import { RoutePath } from 'panel/components/Routes/Paths';
|
||||
import { RoutePathKey } from 'panel/components/Routes/Paths';
|
||||
import theme from 'panel/lib/theme';
|
||||
|
||||
import s from './styles.module.pcss';
|
||||
@ -9,7 +9,7 @@ import s from './styles.module.pcss';
|
||||
type AccordionItem = {
|
||||
label: string;
|
||||
path: string;
|
||||
routePath: RoutePath;
|
||||
routePath: RoutePathKey;
|
||||
};
|
||||
|
||||
type Props = {
|
||||
|
||||
@ -3,24 +3,26 @@ import qs from 'qs';
|
||||
const BasicPath = '/';
|
||||
const pathBuilder = (path: string) => `${BasicPath}${path}`;
|
||||
|
||||
export enum RoutePath {
|
||||
Dashboard = 'Dashboard',
|
||||
Logs = 'Logs',
|
||||
Guide = 'Guide',
|
||||
Encryption = 'Encryption',
|
||||
Dhcp = 'Dhcp',
|
||||
Dns = 'Dns',
|
||||
SettingsPage = 'SettingsPage',
|
||||
Clients = 'Clients',
|
||||
DnsBlocklists = 'DnsBlocklists',
|
||||
DnsAllowlists = 'DnsAllowlists',
|
||||
DnsRewrites = 'DnsRewrites',
|
||||
CustomRules = 'CustomRules',
|
||||
BlockedServices = 'BlockedServices',
|
||||
UserRules = 'UserRules',
|
||||
}
|
||||
export const RoutePath = {
|
||||
Dashboard: 'Dashboard',
|
||||
Logs: 'Logs',
|
||||
Guide: 'Guide',
|
||||
Encryption: 'Encryption',
|
||||
Dhcp: 'Dhcp',
|
||||
Dns: 'Dns',
|
||||
SettingsPage: 'SettingsPage',
|
||||
Clients: 'Clients',
|
||||
DnsBlocklists: 'DnsBlocklists',
|
||||
DnsAllowlists: 'DnsAllowlists',
|
||||
DnsRewrites: 'DnsRewrites',
|
||||
CustomRules: 'CustomRules',
|
||||
BlockedServices: 'BlockedServices',
|
||||
UserRules: 'UserRules',
|
||||
} as const;
|
||||
|
||||
export const Paths: Record<RoutePath, string> = {
|
||||
export type RoutePathKey = keyof typeof RoutePath;
|
||||
|
||||
export const Paths: Record<RoutePathKey, string> = {
|
||||
Dashboard: pathBuilder(''),
|
||||
Logs: pathBuilder('logs'),
|
||||
Guide: pathBuilder('guide'),
|
||||
@ -40,7 +42,7 @@ export const Paths: Record<RoutePath, string> = {
|
||||
export type LinkParams = Partial<Record<string, string | number>>;
|
||||
|
||||
export const linkPathBuilder = (
|
||||
route: RoutePath,
|
||||
route: RoutePathKey,
|
||||
params?: LinkParams,
|
||||
query?: Partial<Record<string, string | number | boolean>>,
|
||||
) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user