feat: support sub route config (#3071)
* feat: support sub route config * dockerfile * fix upload * delete unused code
This commit is contained in:
7
packages/web/components/common/Image/MyImage.tsx
Normal file
7
packages/web/components/common/Image/MyImage.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import React from 'react';
|
||||
import { Image, ImageProps } from '@chakra-ui/react';
|
||||
import { getWebReqUrl } from '../../../common/system/utils';
|
||||
const MyImage = (props: ImageProps) => {
|
||||
return <Image {...props} src={getWebReqUrl(props.src)} alt={props.alt || ''} />;
|
||||
};
|
||||
export default React.memo(MyImage);
|
||||
@@ -1,9 +1,10 @@
|
||||
import React from 'react';
|
||||
import { PhotoProvider, PhotoView } from 'react-photo-view';
|
||||
import 'react-photo-view/dist/react-photo-view.css';
|
||||
import { Box, Image, ImageProps } from '@chakra-ui/react';
|
||||
import { ImageProps } from '@chakra-ui/react';
|
||||
import { useSystem } from '../../../hooks/useSystem';
|
||||
import Loading from '../MyLoading';
|
||||
import MyImage from './MyImage';
|
||||
|
||||
const MyPhotoView = ({ ...props }: ImageProps) => {
|
||||
const { isPc } = useSystem();
|
||||
@@ -15,7 +16,7 @@ const MyPhotoView = ({ ...props }: ImageProps) => {
|
||||
loadingElement={<Loading fixed={false} />}
|
||||
>
|
||||
<PhotoView src={props.src}>
|
||||
<Image cursor={'pointer'} {...props} />
|
||||
<MyImage cursor={'pointer'} {...props} />
|
||||
</PhotoView>
|
||||
</PhotoProvider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user