Skip to content

Commit

Permalink
Merge pull request #8 from georstat/file_access
Browse files Browse the repository at this point in the history
File access bump
  • Loading branch information
geobako authored Jul 6, 2021
2 parents 6d0bf47 + 3d254a0 commit 1e8bedc
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 31 deletions.
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ PODS:
- React-jsi (= 0.64.1)
- React-perflogger (= 0.64.1)
- React-jsinspector (0.64.1)
- react-native-file-access (1.6.1):
- react-native-file-access (1.7.1):
- React-Core
- React-perflogger (0.64.1)
- React-RCTActionSheet (0.64.1):
Expand Down Expand Up @@ -476,7 +476,7 @@ SPEC CHECKSUMS:
React-jsi: 5de8204706bd872b78ea646aee5d2561ca1214b6
React-jsiexecutor: 124e8f99992490d0d13e0649d950d3e1aae06fe9
React-jsinspector: 500a59626037be5b3b3d89c5151bc3baa9abf1a9
react-native-file-access: 6eb2d7e9c21ac1a9e8181812c995bd0c152876e4
react-native-file-access: 45876d4adfbd429641c207295dfd8c64d770c7b9
React-perflogger: aad6d4b4a267936b3667260d1f649b6f6069a675
React-RCTActionSheet: fc376be462c9c8d6ad82c0905442fd77f82a9d2a
React-RCTAnimation: ba0a1c3a2738be224a08092fa7f1b444ab77d309
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lodash": "^4.17.21",
"react": "17.0.2",
"react-native": "0.64.1",
"react-native-file-access": "~1.6.1"
"react-native-file-access": "^1.7.1"
},
"devDependencies": {
"@babel/core": "^7.12.9",
Expand Down
61 changes: 34 additions & 27 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
StyleSheet,
Text,
View,
ScrollView,
} from 'react-native';
import {CachedImage, CacheManager} from '@georstat/react-native-image-cache';
import {Dirs} from 'react-native-file-access';
Expand Down Expand Up @@ -46,35 +47,41 @@ const App = () => {

return (
<SafeAreaView style={styles.container}>
<Text style={styles.text}>Non Cached Image: (5.4MB)</Text>
<Image
resizeMode="cover"
source={{
uri: img,
}}
style={styles.image}
/>
<Text style={styles.bottomText}>
Cached Image With Thumbnail: (5.4MB, thumb: 14KB)
</Text>
<View style={styles.cachedImageContainer}>
<CachedImage
source={img}
<ScrollView>
<Text style={styles.text}>Non Cached Image: (5.4MB)</Text>
<Image
resizeMode="cover"
source={{
uri: img,
}}
style={styles.image}
thumbnailSource={imgThumb}
/>
</View>
<Text style={styles.bottomText}>
Cached Image With Thumbnail: (5.4MB, thumb: 14KB)
</Text>
<View style={styles.cachedImageContainer}>
<CachedImage
source={img}
style={styles.image}
thumbnailSource={imgThumb}
/>
</View>

<View style={styles.clearCachButtonContainer}>
<Button color="white" onPress={clearCache} title="Clear Entire Cache" />
</View>
<View style={styles.clearCachButtonContainer}>
<Button
color="white"
onPress={clearSingleImageFromCache}
title="Clear only image"
/>
</View>
<View style={styles.clearCachButtonContainer}>
<Button
color="blue"
onPress={clearCache}
title="Clear Entire Cache"
/>
</View>
<View style={styles.clearCachButtonContainer}>
<Button
color="blue"
onPress={clearSingleImageFromCache}
title="Clear only image"
/>
</View>
</ScrollView>
</SafeAreaView>
);
};
Expand All @@ -90,7 +97,7 @@ const styles = StyleSheet.create({
},
clearCachButtonContainer: {
alignSelf: 'center',
backgroundColor: 'red',
backgroundColor: 'white',
marginTop: 30,
width: 200,
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"dependencies": {
"crypto-js": "^4.0.0",
"lodash": "^4.17.21",
"react-native-file-access": "~1.6.1"
"react-native-file-access": "^1.7.1"
},
"devDependencies": {
"@commitlint/cli": "^12.1.1",
Expand Down

0 comments on commit 1e8bedc

Please sign in to comment.