Skip to content

Commit c931d1d

Browse files
authored
Merge pull request #30 from rmrs/chore/upgrade_example
chore: upgrade example
2 parents 2be5a4c + 98dfaf3 commit c931d1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3927
-3293
lines changed

example/.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

example/.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@ end_of_line = lf
88
charset = utf-8
99
trim_trailing_whitespace = true
1010
insert_final_newline = true
11-
12-
[*.js]
13-
quote_type = single

example/.flowconfig

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,66 +5,71 @@
55
; Ignore "BUCK" generated dirs
66
<PROJECT_ROOT>/\.buckd/
77

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

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

16-
; Ignore polyfills
17-
.*/Libraries/polyfills/.*
15+
; Flow doesn't support platforms
16+
.*/Libraries/Utilities/LoadingView.js
1817

19-
; Ignore metro
20-
.*/node_modules/metro/.*
18+
[untyped]
19+
.*/node_modules/@react-native-community/cli/.*/.*
2120

2221
[include]
2322

2423
[libs]
2524
node_modules/react-native/Libraries/react-native/react-native-interface.js
2625
node_modules/react-native/flow/
27-
node_modules/react-native/flow-github/
2826

2927
[options]
3028
emoji=true
3129

3230
esproposal.optional_chaining=enable
3331
esproposal.nullish_coalescing=enable
3432

35-
module.system=haste
36-
module.system.haste.use_name_reducers=true
37-
# get basename
38-
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
39-
# strip .js or .js.flow suffix
40-
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
41-
# strip .ios suffix
42-
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
43-
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
44-
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
45-
module.system.haste.paths.blacklist=.*/__tests__/.*
46-
module.system.haste.paths.blacklist=.*/__mocks__/.*
47-
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
48-
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
33+
module.file_ext=.js
34+
module.file_ext=.json
35+
module.file_ext=.ios.js
4936

5037
munge_underscores=true
5138

52-
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'
53-
54-
module.file_ext=.js
55-
module.file_ext=.jsx
56-
module.file_ext=.json
57-
module.file_ext=.native.js
39+
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation'
40+
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
41+
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'
5842

5943
suppress_type=$FlowIssue
6044
suppress_type=$FlowFixMe
6145
suppress_type=$FlowFixMeProps
6246
suppress_type=$FlowFixMeState
6347

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

52+
[lints]
53+
sketchy-null-number=warn
54+
sketchy-null-mixed=warn
55+
sketchy-number=warn
56+
untyped-type-import=warn
57+
nonstrict-import=warn
58+
deprecated-type=warn
59+
unsafe-getters-setters=warn
60+
inexact-spread=warn
61+
unnecessary-invariant=warn
62+
signature-verification-failure=warn
63+
deprecated-utility=error
64+
65+
[strict]
66+
deprecated-type
67+
nonstrict-import
68+
sketchy-null
69+
unclear-type
70+
unsafe-getters-setters
71+
untyped-import
72+
untyped-type-import
73+
6974
[version]
70-
^0.78.0
75+
^0.105.0

example/.gitignore

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23-
project.xcworkspace
2423

2524
# Android/IntelliJ
2625
#
@@ -40,6 +39,7 @@ yarn-error.log
4039
buck-out/
4140
\.buckd/
4241
*.keystore
42+
!debug.keystore
4343

4444
# fastlane
4545
#
@@ -55,13 +55,8 @@ buck-out/
5555
# Bundle artifact
5656
*.jsbundle
5757

58-
# RNFirebase specific
59-
#
60-
.expo/
58+
# CocoaPods
6159
/ios/Pods/
62-
google-services.json
63-
GoogleService-Info.plist
6460

65-
# RNFirebaseStarter
66-
# yarn.lock
67-
package-lock.json
61+
GoogleService-Info.plist
62+
google-services.json

example/.prettierrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
bracketSpacing: false,
3+
jsxBracketSameLine: true,
4+
singleQuote: true,
5+
trailingComma: 'all',
6+
};

example/App.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,53 @@
1-
import React, { Component } from 'react';
2-
import { StyleSheet, View } from 'react-native'
3-
import { ImageView, PhotoView } from 'react-native-firebaseui'
1+
/**
2+
* @format
3+
*/
4+
5+
import React, {Component} from 'react';
6+
import {StyleSheet, View} from 'react-native';
7+
import {ImageView, PhotoView} from 'react-native-firebaseui';
48

59
//no zoom support
610
class MyFirebaseImageView extends Component {
711
render() {
8-
let imageProps = this.props
12+
let imageProps = this.props;
913

1014
return (
1115
<ImageView
1216
{...imageProps}
13-
path='images/firebase_logo.png'
17+
path="images/firebase_logo.png"
1418
defaultSource={require('./assets/placeholder.png')}
1519
timestamp={1000} //optional, can be used to specify last modified time for same storage path
16-
resizeMode='cover' //'cover', 'contain', 'stretch'
20+
resizeMode="cover" //'cover', 'contain', 'stretch'
1721
/>
18-
)
22+
);
1923
}
2024
}
2125

2226
//zoom support (android only). On iOS just wrap the ImageView with a scroll view
2327
class MyFirebasePhotoView extends Component {
2428
render() {
25-
let imageProps = this.props
29+
let imageProps = this.props;
2630

2731
return (
2832
<PhotoView
2933
{...imageProps}
30-
path='images/firebase_logo.png'
34+
path="images/firebase_logo.png"
3135
defaultSource={require('./assets/placeholder.png')}
3236
timestamp={1000} //optional, can be used to specify last modified time for same storage path
33-
resizeMode='cover' //'cover', 'contain', 'stretch'
37+
resizeMode="cover" //'cover', 'contain', 'stretch'
3438
/>
35-
)
39+
);
3640
}
3741
}
3842

3943
export default class App extends Component {
4044
render() {
4145
return (
42-
<View style={styles.container}>
46+
<View style={styles.container}>
4347
<MyFirebaseImageView style={styles.image} />
4448
<MyFirebasePhotoView style={styles.image} />
4549
</View>
46-
)
50+
);
4751
}
4852
}
4953

@@ -55,6 +59,6 @@ const styles = StyleSheet.create({
5559
},
5660
image: {
5761
width: 100,
58-
height: 100
59-
}
60-
});
62+
height: 100,
63+
},
64+
});

example/App.test.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
/**
2+
* @format
3+
*/
4+
5+
import 'react-native';
16
import React from 'react';
27
import App from './App';
38

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

6-
it('renders without crashing', () => {
7-
const rendered = renderer.create(<App />).toJSON();
8-
expect(rendered).toBeTruthy();
12+
it('renders correctly', () => {
13+
renderer.create(<App />);
914
});

example/LICENSE

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
Copyright (c) 2017 Invertase Limited <[email protected]>
1+
Apache-2.0 License
2+
------------------
3+
4+
Copyright (c) 2016-present Invertase Limited <[email protected]>
25

36
Licensed under the Apache License, Version 2.0 (the "License");
47
you may not use this library except in compliance with the License.
5-
You may obtain a copy of the License at
8+
9+
You may obtain a copy of the Apache-2.0 License at
610

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

@@ -11,3 +15,18 @@ distributed under the License is distributed on an "AS IS" BASIS,
1115
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1216
See the License for the specific language governing permissions and
1317
limitations under the License.
18+
19+
20+
Creative Commons Attribution 3.0 License
21+
----------------------------------------
22+
23+
Copyright (c) 2016-present Invertase Limited <[email protected]>
24+
25+
Documentation and other instructional materials provided for this project
26+
(including on a separate documentation repository or it's documentation website) are
27+
licensed under the Creative Commons Attribution 3.0 License. Code samples/blocks
28+
contained therein are licensed under the Apache License, Version 2.0 (the "License"), as above.
29+
30+
You may obtain a copy of the Creative Commons Attribution 3.0 License at
31+
32+
https://creativecommons.org/licenses/by/3.0/

0 commit comments

Comments
 (0)