fix: svg icon size

This commit is contained in:
molvqingtai 2024-09-29 05:23:48 +08:00
parent e764f334d1
commit 089d69a095
4 changed files with 8 additions and 19 deletions

View file

@ -19,6 +19,7 @@ import LogoIcon3 from '@/assets/images/logo-3.svg'
import LogoIcon4 from '@/assets/images/logo-4.svg'
import LogoIcon5 from '@/assets/images/logo-5.svg'
import LogoIcon6 from '@/assets/images/logo-6.svg'
import { getDay } from 'date-fns'
export default function App() {
@ -72,7 +73,7 @@ export default function App() {
<Toaster richColors offset="70px" visibleToasts={1} position="top-center"></Toaster>
</AppContainer>
<AppButton onClick={handleToggleApp}>
<DayLogo></DayLogo>
<DayLogo className="max-h-full max-w-full"></DayLogo>
</AppButton>
</>
)

View file

@ -92,7 +92,7 @@ const AppButton: FC<AppButtonProps> = ({ children, onClick }) => {
<Button
onClick={onClick}
onContextMenu={handleToggleMenu}
className="relative z-10 size-11 rounded-full p-0 text-xs shadow-lg shadow-slate-500/50"
className="relative z-10 size-11 overflow-hidden rounded-full p-0 text-xs shadow-lg shadow-slate-500/50"
>
{children}
</Button>

20
src/types/shim.d.ts vendored
View file

@ -1,17 +1,7 @@
// issues: https://github.com/facebook/react/issues/17157
// issues: https://github.com/facebook/react/pull/24730
declare module 'react' {
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
inert?: boolean | undefined | ''
}
}
declare module '*.svg' {
import * as React from 'react'
declare global {
namespace JSX {
interface IntrinsicAttributes {
inert?: boolean | undefined | ''
}
}
}
const ReactComponent: React.FunctionComponent<React.ComponentProps<'svg'> & { title?: string }>
export {}
export default ReactComponent
}

View file

@ -35,8 +35,6 @@ export default defineConfig({
plugins: [
react(),
svgr({
// svgr options: https://react-svgr.com/docs/options/
svgrOptions: { exportType: 'default', ref: true, svgo: false, titleProp: true },
include: '**/*.svg'
})
]