Skip to content

Commit

Permalink
chore: upgrade example
Browse files Browse the repository at this point in the history
  • Loading branch information
erezrokah committed Oct 17, 2019
1 parent 2be5a4c commit 98dfaf3
Show file tree
Hide file tree
Showing 42 changed files with 3,927 additions and 3,293 deletions.
3 changes: 0 additions & 3 deletions example/.babelrc

This file was deleted.

3 changes: 0 additions & 3 deletions example/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.js]
quote_type = single
75 changes: 40 additions & 35 deletions example/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,71 @@
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*
; Ignore polyfills
node_modules/react-native/Libraries/polyfills/.*

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
node_modules/warning/.*

; Ignore polyfills
.*/Libraries/polyfills/.*
; Flow doesn't support platforms
.*/Libraries/Utilities/LoadingView.js

; Ignore metro
.*/node_modules/metro/.*
[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow/
node_modules/react-native/flow-github/

[options]
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.system=haste
module.system.haste.use_name_reducers=true
# get basename
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
# strip .js or .js.flow suffix
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
# strip .ios suffix
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
module.file_ext=.js
module.file_ext=.json
module.file_ext=.ios.js

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'

module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation'
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
sketchy-number=warn
untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
inexact-spread=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error

[strict]
deprecated-type
nonstrict-import
sketchy-null
unclear-type
unsafe-getters-setters
untyped-import
untyped-type-import

[version]
^0.78.0
^0.105.0
13 changes: 4 additions & 9 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IntelliJ
#
Expand All @@ -40,6 +39,7 @@ yarn-error.log
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
Expand All @@ -55,13 +55,8 @@ buck-out/
# Bundle artifact
*.jsbundle

# RNFirebase specific
#
.expo/
# CocoaPods
/ios/Pods/
google-services.json
GoogleService-Info.plist

# RNFirebaseStarter
# yarn.lock
package-lock.json
GoogleService-Info.plist
google-services.json
6 changes: 6 additions & 0 deletions example/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
bracketSpacing: false,
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
};
36 changes: 20 additions & 16 deletions example/App.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,53 @@
import React, { Component } from 'react';
import { StyleSheet, View } from 'react-native'
import { ImageView, PhotoView } from 'react-native-firebaseui'
/**
* @format
*/

import React, {Component} from 'react';
import {StyleSheet, View} from 'react-native';
import {ImageView, PhotoView} from 'react-native-firebaseui';

//no zoom support
class MyFirebaseImageView extends Component {
render() {
let imageProps = this.props
let imageProps = this.props;

return (
<ImageView
{...imageProps}
path='images/firebase_logo.png'
path="images/firebase_logo.png"
defaultSource={require('./assets/placeholder.png')}
timestamp={1000} //optional, can be used to specify last modified time for same storage path
resizeMode='cover' //'cover', 'contain', 'stretch'
resizeMode="cover" //'cover', 'contain', 'stretch'
/>
)
);
}
}

//zoom support (android only). On iOS just wrap the ImageView with a scroll view
class MyFirebasePhotoView extends Component {
render() {
let imageProps = this.props
let imageProps = this.props;

return (
<PhotoView
{...imageProps}
path='images/firebase_logo.png'
path="images/firebase_logo.png"
defaultSource={require('./assets/placeholder.png')}
timestamp={1000} //optional, can be used to specify last modified time for same storage path
resizeMode='cover' //'cover', 'contain', 'stretch'
resizeMode="cover" //'cover', 'contain', 'stretch'
/>
)
);
}
}

export default class App extends Component {
render() {
return (
<View style={styles.container}>
<View style={styles.container}>
<MyFirebaseImageView style={styles.image} />
<MyFirebasePhotoView style={styles.image} />
</View>
)
);
}
}

Expand All @@ -55,6 +59,6 @@ const styles = StyleSheet.create({
},
image: {
width: 100,
height: 100
}
});
height: 100,
},
});
11 changes: 8 additions & 3 deletions example/App.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
/**
* @format
*/

import 'react-native';
import React from 'react';
import App from './App';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';

it('renders without crashing', () => {
const rendered = renderer.create(<App />).toJSON();
expect(rendered).toBeTruthy();
it('renders correctly', () => {
renderer.create(<App />);
});
23 changes: 21 additions & 2 deletions example/LICENSE
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
Copyright (c) 2017 Invertase Limited <[email protected]>
Apache-2.0 License
------------------

Copyright (c) 2016-present Invertase Limited <[email protected]>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this library except in compliance with the License.
You may obtain a copy of the License at

You may obtain a copy of the Apache-2.0 License at

http://www.apache.org/licenses/LICENSE-2.0

Expand All @@ -11,3 +15,18 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


Creative Commons Attribution 3.0 License
----------------------------------------

Copyright (c) 2016-present Invertase Limited <[email protected]>

Documentation and other instructional materials provided for this project
(including on a separate documentation repository or it's documentation website) are
licensed under the Creative Commons Attribution 3.0 License. Code samples/blocks
contained therein are licensed under the Apache License, Version 2.0 (the "License"), as above.

You may obtain a copy of the Creative Commons Attribution 3.0 License at

https://creativecommons.org/licenses/by/3.0/
Loading

0 comments on commit 98dfaf3

Please sign in to comment.