refactor: replace 'preact' with 'react' (#1048)

This commit is contained in:
Aman Harwara
2022-05-30 12:42:52 +05:30
committed by GitHub
parent e74b4953ea
commit 8c368dd96b
231 changed files with 4794 additions and 4302 deletions

View File

@@ -1,13 +1,12 @@
import { IconType } from '@standardnotes/snjs'
import { FunctionComponent } from 'preact'
import { useRef, useState } from 'preact/hooks'
import { IconButton } from '../Button/IconButton'
import { FunctionComponent, useRef, useState } from 'react'
import IconButton from '../Button/IconButton'
type Props = {
objectUrl: string
}
export const ImagePreview: FunctionComponent<Props> = ({ objectUrl }) => {
const ImagePreview: FunctionComponent<Props> = ({ objectUrl }) => {
const initialImgHeightRef = useRef<number>()
const [imageZoomPercent, setImageZoomPercent] = useState(100)
@@ -21,8 +20,8 @@ export const ImagePreview: FunctionComponent<Props> = ({ objectUrl }) => {
height: `${imageZoomPercent}%`,
...(imageZoomPercent <= 100
? {
'min-width': '100%',
'object-fit': 'contain',
minWidth: '100%',
objectFit: 'contain',
}
: {
position: 'absolute',
@@ -69,3 +68,5 @@ export const ImagePreview: FunctionComponent<Props> = ({ objectUrl }) => {
</div>
)
}
export default ImagePreview