mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 16:51:37 +00:00
Update image component
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import classNames from 'classnames';
|
||||
import NextImage, { ImageProps } from 'next/future/image';
|
||||
|
||||
interface Props extends ImageProps {}
|
||||
@ -5,10 +6,18 @@ interface Props extends ImageProps {}
|
||||
const Image = ({ alt, ...rest }: Props) => {
|
||||
return (
|
||||
<>
|
||||
<span className="block text-center">
|
||||
<NextImage alt={alt} {...rest} />
|
||||
{alt && <span className="block text-center text-gray-400">{alt}</span>}
|
||||
</span>
|
||||
<NextImage className="mx-auto" alt={alt} {...rest} />
|
||||
{alt && (
|
||||
<span
|
||||
className={classNames(
|
||||
'block mx-auto',
|
||||
'text-center text-gray-400',
|
||||
'mt-2'
|
||||
)}
|
||||
>
|
||||
{alt}
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -1,11 +1,15 @@
|
||||
import RUASandpack from 'components/RUA/RUASandpack';
|
||||
import Anchor from 'components/mdx/Anchor';
|
||||
import Image from 'components/mdx/Image';
|
||||
import Tab from 'components/RUA/tab';
|
||||
import TabItem from 'components/RUA/tab/TabItem';
|
||||
|
||||
const components = {
|
||||
RUASandpack,
|
||||
a: Anchor,
|
||||
Image,
|
||||
Tab,
|
||||
TabItem,
|
||||
};
|
||||
|
||||
export default components;
|
||||
|
Reference in New Issue
Block a user