UNPKG

fastcomments-react-native-sdk

Version:

React Native FastComments Components. Add live commenting to any React Native application.

27 lines (26 loc) 1.27 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { Image, ImageBackground, TouchableOpacity } from "react-native"; import { getDefaultImageAssets } from "../../resources"; import { FastCommentsImageAsset } from "../../types"; const assets = getDefaultImageAssets(); export function EditorNodeImage({ doDelete, nodeState }) { // the only problem with this is that the image does not show exactly the same as after it is posted, which is terrible. // it would be great if we could use resizeMode: contain and still have the delete button still align with the image content. return _jsx(ImageBackground, { source: { uri: nodeState.content.get() }, style: { position: 'relative', marginTop: 10, marginBottom: 10, width: '100%', aspectRatio: 1 }, imageStyle: { aspectRatio: 1, }, children: _jsx(TouchableOpacity, { onPress: doDelete, style: { position: 'absolute', top: -5, right: -5 }, children: _jsx(Image, { source: assets[FastCommentsImageAsset.ICON_CROSS], style: { width: 12, aspectRatio: 1, resizeMode: 'center', } }) }) }); }