fix missing card background and format code

This commit is contained in:
pompurin404 2024-09-06 20:42:42 +08:00
parent c46a26192a
commit 1285a07623
No known key found for this signature in database
14 changed files with 64 additions and 33 deletions

View File

@ -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 = {

View File

@ -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">

View File

@ -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">

View File

@ -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">

View File

@ -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">

View File

@ -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">

View File

@ -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">

View File

@ -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">

View File

@ -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">

View File

@ -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">

View File

@ -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">

View File

@ -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"

View File

@ -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">

View File

@ -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">