fix: nextui switch input width overflow (#437)

This commit is contained in:
Avan 2025-01-01 01:27:51 +08:00 committed by GitHub
parent c7e252d418
commit 7d70008148
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 2061 additions and 2438 deletions

View File

@ -26,6 +26,7 @@
"@electron-toolkit/preload": "^3.0.1",
"@electron-toolkit/utils": "^3.0.0",
"@mihomo-party/sysproxy": "^2.0.7",
"@nextui-org/react": "2.6.10",
"@types/crypto-js": "^4.2.2",
"adm-zip": "^0.5.16",
"axios": "^1.7.7",
@ -45,7 +46,6 @@
"@electron-toolkit/eslint-config-prettier": "^2.0.0",
"@electron-toolkit/eslint-config-ts": "^2.0.0",
"@electron-toolkit/tsconfig": "^1.0.1",
"@nextui-org/react": "^2.4.8",
"@types/adm-zip": "^0.5.6",
"@types/express": "^5.0.0",
"@types/node": "^22.9.0",

4490
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
.border-switch {
input[type='checkbox'] {
width: 100%;
}
}

View File

@ -1,5 +1,6 @@
import React from 'react'
import { cn, Switch, SwitchProps } from '@nextui-org/react'
import './border-switch.css'
interface SiderSwitchProps extends SwitchProps {
isShowBorder?: boolean
@ -10,6 +11,7 @@ const BorderSwitch: React.FC<SiderSwitchProps> = (props) => {
return (
<Switch
className="border-switch px-[8px]"
classNames={{
wrapper: cn('border-2', {
'border-transparent': !isShowBorder,