mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
removing pan/zoom for now, conflicting with carousel swipe
This commit is contained in:
parent
9731cc8f55
commit
b3222db1f7
@ -104,7 +104,7 @@ compileOptions {
|
|||||||
applicationId "com.databag"
|
applicationId "com.databag"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 1015
|
versionCode 1018
|
||||||
versionName "1.5"
|
versionName "1.5"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-native": "0.71.3",
|
"react-native": "0.71.3",
|
||||||
"react-native-awesome-gallery": "^0.3.5",
|
|
||||||
"react-native-base64": "^0.2.1",
|
"react-native-base64": "^0.2.1",
|
||||||
"react-native-create-thumbnail": "^1.6.4",
|
"react-native-create-thumbnail": "^1.6.4",
|
||||||
"react-native-device-info": "^10.4.0",
|
"react-native-device-info": "^10.4.0",
|
||||||
|
@ -4,22 +4,40 @@ import { styles } from './ImageAsset.styled';
|
|||||||
import Colors from 'constants/Colors';
|
import Colors from 'constants/Colors';
|
||||||
import Ionicons from 'react-native-vector-icons/AntDesign';
|
import Ionicons from 'react-native-vector-icons/AntDesign';
|
||||||
import FastImage from 'react-native-fast-image'
|
import FastImage from 'react-native-fast-image'
|
||||||
import Gallery from 'react-native-awesome-gallery';
|
|
||||||
|
|
||||||
export function ImageAsset({ asset, dismiss }) {
|
export function ImageAsset({ asset, dismiss }) {
|
||||||
const { state, actions } = useImageAsset(asset);
|
const { state, actions } = useImageAsset(asset);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity activeOpacity={1} style={{ display: 'flex', width: '100%', height: '100%' }} onPress={actions.showControls}>
|
<TouchableOpacity style={styles.container} activeOpacity={1} onPress={actions.showControls}>
|
||||||
|
<FastImage source={{ uri: asset.thumb }} onLoad={actions.setRatio}
|
||||||
|
style={{ ...styles.thumb, width: state.imageWidth, height: state.imageHeight }}
|
||||||
|
resizeMode={FastImage.resizeMode.contain} />
|
||||||
{ state.url && (
|
{ state.url && (
|
||||||
<Gallery data={[ state.url ]} onIndexChange={actions.loaded}
|
<FastImage source={{ uri: state.url }} onLoad={actions.loaded}
|
||||||
style={{ ...styles.main }} />
|
style={{ ...styles.main, width: state.imageWidth, height: state.imageHeight }}
|
||||||
|
resizeMode={FastImage.resizeMode.contain} />
|
||||||
)}
|
)}
|
||||||
{ state.controls && (
|
|
||||||
|
{ state.loaded && state.controls && (
|
||||||
<TouchableOpacity style={styles.close} onPress={dismiss}>
|
<TouchableOpacity style={styles.close} onPress={dismiss}>
|
||||||
<Ionicons name={'close'} size={32} color={Colors.white} />
|
<Ionicons name={'close'} size={32} color={Colors.white} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{ state.failed && (
|
||||||
|
<TouchableOpacity style={styles.loading} onPress={dismiss}>
|
||||||
|
<ActivityIndicator color={Colors.alert} size="large" />
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
{ !state.loaded && !state.failed && (
|
||||||
|
<TouchableOpacity style={styles.loading} onPress={dismiss}>
|
||||||
|
<ActivityIndicator color={Colors.white} size="large" />
|
||||||
|
{ asset.total > 1 && (
|
||||||
|
<Text style={styles.decrypting}>{ asset.block } / { asset.total }</Text>
|
||||||
|
)}
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user