mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
fix missing card background and format code
This commit is contained in:
parent
c46a26192a
commit
1285a07623
@ -118,18 +118,19 @@ const App: React.FC = () => {
|
||||
}
|
||||
|
||||
const navigateMap = {
|
||||
sysproxy: "sysproxy",
|
||||
tun: "tun",
|
||||
profile: "profiles",
|
||||
proxy: "proxies",
|
||||
mihomo: "mihomo",
|
||||
connection: "connections",
|
||||
dns: "dns",
|
||||
sniff: "sniffer",
|
||||
log: "logs",
|
||||
rule: "rules",
|
||||
resource: "resources",
|
||||
override: "override"
|
||||
sysproxy: 'sysproxy',
|
||||
tun: 'tun',
|
||||
profile: 'profiles',
|
||||
proxy: 'proxies',
|
||||
mihomo: 'mihomo',
|
||||
connection: 'connections',
|
||||
dns: 'dns',
|
||||
sniff: 'sniffer',
|
||||
log: 'logs',
|
||||
rule: 'rules',
|
||||
resource: 'resources',
|
||||
override: 'override',
|
||||
substore: 'substore'
|
||||
}
|
||||
|
||||
const componentMap = {
|
||||
|
||||
@ -177,7 +177,9 @@ const ConnCard: React.FC = () => {
|
||||
<>
|
||||
<Card
|
||||
fullWidth
|
||||
ref={setNodeRef} {...attributes} {...listeners}
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
@ -224,7 +226,9 @@ const ConnCard: React.FC = () => {
|
||||
) : (
|
||||
<Card
|
||||
fullWidth
|
||||
ref={setNodeRef} {...attributes} {...listeners}
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
|
||||
@ -43,7 +43,9 @@ const DNSCard: React.FC = () => {
|
||||
>
|
||||
<Card
|
||||
fullWidth
|
||||
ref={setNodeRef} {...attributes} {...listeners}
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
|
||||
@ -32,7 +32,9 @@ const LogCard: React.FC = () => {
|
||||
>
|
||||
<Card
|
||||
fullWidth
|
||||
ref={setNodeRef} {...attributes} {...listeners}
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
|
||||
@ -56,7 +56,9 @@ const MihomoCoreCard: React.FC = () => {
|
||||
{mihomoCoreCardStatus === 'col-span-2' ? (
|
||||
<Card
|
||||
fullWidth
|
||||
ref={setNodeRef} {...attributes} {...listeners}
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody>
|
||||
@ -105,7 +107,9 @@ const MihomoCoreCard: React.FC = () => {
|
||||
) : (
|
||||
<Card
|
||||
fullWidth
|
||||
ref={setNodeRef} {...attributes} {...listeners}
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
|
||||
@ -34,7 +34,9 @@ const OverrideCard: React.FC = () => {
|
||||
>
|
||||
<Card
|
||||
fullWidth
|
||||
ref={setNodeRef} {...attributes} {...listeners}
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
|
||||
@ -61,7 +61,9 @@ const ProfileCard: React.FC = () => {
|
||||
{profileCardStatus === 'col-span-2' ? (
|
||||
<Card
|
||||
fullWidth
|
||||
ref={setNodeRef} {...attributes} {...listeners}
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1">
|
||||
@ -150,7 +152,9 @@ const ProfileCard: React.FC = () => {
|
||||
) : (
|
||||
<Card
|
||||
fullWidth
|
||||
ref={setNodeRef} {...attributes} {...listeners}
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
|
||||
@ -36,7 +36,9 @@ const ProxyCard: React.FC = () => {
|
||||
>
|
||||
<Card
|
||||
fullWidth
|
||||
ref={setNodeRef} {...attributes} {...listeners}
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
|
||||
@ -33,7 +33,9 @@ const ResourceCard: React.FC = () => {
|
||||
>
|
||||
<Card
|
||||
fullWidth
|
||||
ref={setNodeRef} {...attributes} {...listeners}
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
|
||||
@ -35,7 +35,9 @@ const RuleCard: React.FC = () => {
|
||||
>
|
||||
<Card
|
||||
fullWidth
|
||||
ref={setNodeRef} {...attributes} {...listeners}
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
|
||||
@ -44,7 +44,9 @@ const SniffCard: React.FC = () => {
|
||||
>
|
||||
<Card
|
||||
fullWidth
|
||||
ref={setNodeRef} {...attributes} {...listeners}
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Button, Card, CardBody, CardFooter } from '@nextui-org/react'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { useSortable } from '@dnd-kit/sortable'
|
||||
import { CSS } from '@dnd-kit/utilities'
|
||||
import SubStoreIcon from '../base/substore-icon'
|
||||
@ -7,7 +7,6 @@ import { useAppConfig } from '@renderer/hooks/use-app-config'
|
||||
const SubStoreCard: React.FC = () => {
|
||||
const { appConfig } = useAppConfig()
|
||||
const { substoreCardStatus = 'col-span-1', useSubStore = true } = appConfig || {}
|
||||
const navigate = useNavigate()
|
||||
const location = useLocation()
|
||||
const match = location.pathname.includes('/substore')
|
||||
const {
|
||||
@ -32,13 +31,14 @@ const SubStoreCard: React.FC = () => {
|
||||
className={`${substoreCardStatus} ${!useSubStore ? 'hidden' : ''}`}
|
||||
>
|
||||
<Card
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
fullWidth
|
||||
className={`${match ? 'bg-primary' : ''}`}
|
||||
isPressable
|
||||
onPress={() => navigate('/substore')}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
<div ref={setNodeRef} {...attributes} {...listeners} className="flex justify-between">
|
||||
<div className="flex justify-between">
|
||||
<Button
|
||||
isIconOnly
|
||||
className="bg-transparent pointer-events-none"
|
||||
|
||||
@ -47,7 +47,9 @@ const SysproxySwitcher: React.FC = () => {
|
||||
>
|
||||
<Card
|
||||
fullWidth
|
||||
ref={setNodeRef} {...attributes} {...listeners}
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
|
||||
@ -84,7 +84,9 @@ const TunSwitcher: React.FC = () => {
|
||||
|
||||
<Card
|
||||
fullWidth
|
||||
ref={setNodeRef} {...attributes} {...listeners}
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user