-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
6,221 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["react-native"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
|
||
# Created by https://www.gitignore.io/api/reactnative | ||
|
||
### ReactNative ### | ||
# React Native Stack Base | ||
### ReactNative.Linux Stack ### | ||
*~ | ||
|
||
# temporary files which can be created if a process still has a handle open of a deleted file | ||
.fuse_hidden* | ||
|
||
# KDE directory preferences | ||
.directory | ||
|
||
# Linux trash folder which might appear on any partition or disk | ||
.Trash-* | ||
|
||
# .nfs files are created when an open file is removed but is still being accessed | ||
.nfs* | ||
|
||
### ReactNative.Xcode Stack ### | ||
# Xcode | ||
# | ||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore | ||
|
||
## Build generated | ||
build/ | ||
DerivedData/ | ||
|
||
## Various settings | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata/ | ||
|
||
## Other | ||
*.moved-aside | ||
*.xccheckout | ||
*.xcscmblueprint | ||
|
||
### ReactNative.Node Stack ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Typescript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
|
||
### ReactNative.Buck Stack ### | ||
buck-out/ | ||
.buckconfig.local | ||
.buckd/ | ||
.buckversion | ||
.fakebuckversion | ||
|
||
### ReactNative.Android Stack ### | ||
# Built application files | ||
*.apk | ||
*.ap_ | ||
|
||
# Files for the ART/Dalvik VM | ||
*.dex | ||
|
||
# Java class files | ||
*.class | ||
|
||
# Generated files | ||
bin/ | ||
gen/ | ||
out/ | ||
|
||
# Gradle files | ||
.gradle/ | ||
|
||
# Local configuration file (sdk path, etc) | ||
local.properties | ||
|
||
# Proguard folder generated by Eclipse | ||
proguard/ | ||
|
||
# Log Files | ||
|
||
# Android Studio Navigation editor temp files | ||
.navigation/ | ||
|
||
# Android Studio captures folder | ||
captures/ | ||
|
||
# Intellij | ||
*.iml | ||
.idea/workspace.xml | ||
.idea/tasks.xml | ||
.idea/gradle.xml | ||
.idea/dictionaries | ||
.idea/libraries | ||
|
||
# External native build folder generated in Android Studio 2.2 and later | ||
.externalNativeBuild | ||
|
||
# Freeline | ||
freeline.py | ||
freeline/ | ||
freeline_project_description.json | ||
|
||
### ReactNative.Gradle Stack ### | ||
.gradle | ||
**/build/ | ||
|
||
# Ignore Gradle GUI config | ||
gradle-app.setting | ||
|
||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) | ||
!gradle-wrapper.jar | ||
|
||
# Cache of project | ||
.gradletasknamecache | ||
|
||
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 | ||
# gradle/wrapper/gradle-wrapper.properties | ||
|
||
### ReactNative.macOS Stack ### | ||
*.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
|
||
# End of https://www.gitignore.io/api/reactnative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'React'; | ||
import ReactTestRenderer from 'react-test-renderer'; | ||
import ImagePreviewer from '../index'; | ||
const ImgWidth = 300; | ||
const ImgHeight = ImgWidth * 0.6; | ||
|
||
describe('ImagePreviewer', () => { | ||
it('renders correctly', () => { | ||
const instance = ReactTestRenderer.create( | ||
<ImagePreviewer | ||
source={{uri: 'http://o7bkcj7d7.bkt.clouddn.com/2.png'}} | ||
style={{ | ||
width: ImgWidth, | ||
height: ImgHeight, | ||
}} | ||
resizeMode="stretch" | ||
/> | ||
); | ||
|
||
expect(instance.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ImagePreviewer renders correctly 1`] = ` | ||
<View> | ||
<View | ||
accessibilityComponentType={undefined} | ||
accessibilityLabel={undefined} | ||
accessibilityTraits={undefined} | ||
accessible={true} | ||
hitSlop={undefined} | ||
nativeID={undefined} | ||
onLayout={undefined} | ||
onResponderGrant={[Function]} | ||
onResponderMove={[Function]} | ||
onResponderRelease={[Function]} | ||
onResponderTerminate={[Function]} | ||
onResponderTerminationRequest={[Function]} | ||
onStartShouldSetResponder={[Function]} | ||
style={ | ||
Object { | ||
"height": 180, | ||
"width": 300, | ||
} | ||
} | ||
testID={undefined} | ||
> | ||
<Image | ||
resizeMode="stretch" | ||
source={ | ||
Object { | ||
"uri": "http://o7bkcj7d7.bkt.clouddn.com/2.png", | ||
} | ||
} | ||
style={ | ||
Object { | ||
"flex": 1, | ||
"height": 180, | ||
"width": 300, | ||
} | ||
} | ||
/> | ||
</View> | ||
<Modal | ||
animationType="fade" | ||
hardwareAccelerated={false} | ||
onRequestClose={[Function]} | ||
transparent={true} | ||
visible={false} | ||
> | ||
<View | ||
onMoveShouldSetResponder={[Function]} | ||
onMoveShouldSetResponderCapture={[Function]} | ||
onResponderEnd={[Function]} | ||
onResponderGrant={[Function]} | ||
onResponderMove={[Function]} | ||
onResponderReject={[Function]} | ||
onResponderRelease={[Function]} | ||
onResponderStart={[Function]} | ||
onResponderTerminate={[Function]} | ||
onResponderTerminationRequest={[Function]} | ||
onStartShouldSetResponder={[Function]} | ||
onStartShouldSetResponderCapture={[Function]} | ||
style={ | ||
Object { | ||
"backgroundColor": "black", | ||
"bottom": 0, | ||
"left": 0, | ||
"position": "absolute", | ||
"right": 0, | ||
"top": 0, | ||
} | ||
} | ||
> | ||
<Image | ||
resizeMode="contain" | ||
source={ | ||
Object { | ||
"uri": "http://o7bkcj7d7.bkt.clouddn.com/2.png", | ||
} | ||
} | ||
style={ | ||
Object { | ||
"flex": 1, | ||
"height": "100%", | ||
"left": 0, | ||
"position": "absolute", | ||
"top": 0, | ||
"transform": Array [ | ||
Object { | ||
"scale": 1, | ||
}, | ||
], | ||
"width": "100%", | ||
} | ||
} | ||
/> | ||
</View> | ||
</Modal> | ||
</View> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ import { | |
View, | ||
Modal, | ||
Image, | ||
Platform, | ||
PanResponder, | ||
TouchableWithoutFeedback, | ||
} from 'react-native'; | ||
|
Oops, something went wrong.