mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
fixing carousel dismiss for android
This commit is contained in:
parent
72b8970067
commit
04a533835f
@ -22,9 +22,9 @@ export function TopicItem({ item, focused, focus }) {
|
||||
|
||||
const renderAsset = (asset) => {
|
||||
return (
|
||||
<TouchableOpacity style={styles.frame} activeOpacity={1} onPress={actions.hideCarousel}>
|
||||
<View style={styles.frame}>
|
||||
{ asset.item.image && (
|
||||
<ImageAsset topicId={item.topicId} asset={asset.item.image} />
|
||||
<ImageAsset topicId={item.topicId} asset={asset.item.image} dismiss={actions.hideCarousel} />
|
||||
)}
|
||||
{ asset.item.video && (
|
||||
<VideoAsset topicId={item.topicId} asset={asset.item.video} />
|
||||
@ -33,7 +33,7 @@ export function TopicItem({ item, focused, focus }) {
|
||||
<AudioAsset topicId={item.topicId} asset={asset.item.audio} active={state.activeId == asset.dataIndex}
|
||||
setActive={() => actions.setActive(asset.dataIndex)} />
|
||||
)}
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
import { Image } from 'react-native';
|
||||
import { Image, TouchableOpacity } from 'react-native';
|
||||
import { useImageAsset } from './useImageAsset.hook';
|
||||
import { styles } from './ImageAsset.styled';
|
||||
import Colors from 'constants/Colors';
|
||||
|
||||
export function ImageAsset({ topicId, asset }) {
|
||||
export function ImageAsset({ topicId, asset, dismiss }) {
|
||||
const { state, actions } = useImageAsset(topicId, asset);
|
||||
|
||||
return (
|
||||
<Image source={{ uri: state.url }} style={{ borderRadius: 4, width: state.imageWidth, height: state.imageHeight }} resizeMode={'cover'} />
|
||||
<TouchableOpacity onPress={dismiss}>
|
||||
<Image source={{ uri: state.url }} style={{ borderRadius: 4, width: state.imageWidth, height: state.imageHeight }} resizeMode={'cover'} />
|
||||
</TouchableOpacity>
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user