Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(imagepreview): use nutui image #2793

Open
wants to merge 2 commits into
base: feat_v3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/packages/imagepreview/imagepreview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
justify-content: center;
height: 100%;

.nut-image,
.nut-video {
display: flex;
justify-content: center;
align-items: center;
}

.nut-image-preview-box {
width: 100%;
}
Expand Down
10 changes: 2 additions & 8 deletions src/packages/imagepreview/imagepreview.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@ import React, {
ReactNode,
} from 'react'
import Taro from '@tarojs/taro'
import {
ITouchEvent,
Video as TaroVideo,
Image,
View,
} from '@tarojs/components'
import { ITouchEvent, Video as TaroVideo, View } from '@tarojs/components'
import classNames from 'classnames'
import { Close } from '@nutui/icons-react-taro'
import Popup from '@/packages/popup/index.taro'
import Image from '@/packages/image/index.taro'
import Swiper from '@/packages/swiper/index.taro'
import SwiperItem from '@/packages/swiperitem/index.taro'

Expand Down Expand Up @@ -342,7 +338,6 @@ export const ImagePreview: FunctionComponent<Partial<ImagePreviewProps>> = (
key={index}
className="nut-imagepreview-swiper-item"
>
(
<Image
src={src}
mode="widthFix"
Expand All @@ -352,7 +347,6 @@ export const ImagePreview: FunctionComponent<Partial<ImagePreviewProps>> = (
showMenuByLongpress,
})}
/>
)
</SwiperItem>
)
}
Expand Down
Loading