Skip to content

Commit e8eda59

Browse files
committed
first commit
0 parents  commit e8eda59

File tree

75 files changed

+10166
-0
lines changed

Some content is hidden

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

75 files changed

+10166
-0
lines changed

.buckconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2

.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native-community',
4+
};

.flowconfig

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
5+
; Ignore "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
7+
8+
; Ignore polyfills
9+
node_modules/react-native/Libraries/polyfills/.*
10+
11+
; Flow doesn't support platforms
12+
.*/Libraries/Utilities/LoadingView.js
13+
14+
.*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$
15+
16+
[untyped]
17+
.*/node_modules/@react-native-community/cli/.*/.*
18+
19+
[include]
20+
21+
[libs]
22+
node_modules/react-native/interface.js
23+
node_modules/react-native/flow/
24+
25+
[options]
26+
emoji=true
27+
28+
exact_by_default=true
29+
30+
format.bracket_spacing=false
31+
32+
module.file_ext=.js
33+
module.file_ext=.json
34+
module.file_ext=.ios.js
35+
36+
munge_underscores=true
37+
38+
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
39+
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'
40+
41+
suppress_type=$FlowIssue
42+
suppress_type=$FlowFixMe
43+
suppress_type=$FlowFixMeProps
44+
suppress_type=$FlowFixMeState
45+
46+
[lints]
47+
sketchy-null-number=warn
48+
sketchy-null-mixed=warn
49+
sketchy-number=warn
50+
untyped-type-import=warn
51+
nonstrict-import=warn
52+
deprecated-type=warn
53+
unsafe-getters-setters=warn
54+
unnecessary-invariant=warn
55+
signature-verification-failure=warn
56+
57+
[strict]
58+
deprecated-type
59+
nonstrict-import
60+
sketchy-null
61+
unclear-type
62+
unsafe-getters-setters
63+
untyped-import
64+
untyped-type-import
65+
66+
[version]
67+
^0.170.0

.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
24+
# Android/IntelliJ
25+
#
26+
build/
27+
.idea
28+
.gradle
29+
local.properties
30+
*.iml
31+
*.hprof
32+
33+
# node.js
34+
#
35+
node_modules/
36+
npm-debug.log
37+
yarn-error.log
38+
39+
# BUCK
40+
buck-out/
41+
\.buckd/
42+
*.keystore
43+
!debug.keystore
44+
45+
# fastlane
46+
#
47+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
48+
# screenshots whenever they are needed.
49+
# For more information about the recommended setup visit:
50+
# https://docs.fastlane.tools/best-practices/source-control/
51+
52+
*/fastlane/report.xml
53+
*/fastlane/Preview.html
54+
*/fastlane/screenshots
55+
56+
# Bundle artifact
57+
*.jsbundle
58+
59+
# Ruby / CocoaPods
60+
/ios/Pods/
61+
/vendor/bundle/

.prettierrc.js

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

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.7.4

.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

App.js

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import React, {useState, useEffect} from 'react';
2+
import {View, StyleSheet, Image, TouchableOpacity} from 'react-native';
3+
import Torch from 'react-native-torch';
4+
import RNShake from 'react-native-shake';
5+
6+
const App = () => {
7+
const [toggle, setToggle] = useState(false);
8+
9+
const handleChangeToggle = () => setToggle(oldToggle => !oldToggle);
10+
11+
useEffect(() => {
12+
Torch.switchState(toggle);
13+
}, [toggle]);
14+
15+
useEffect(() => {
16+
//Quando chacoalhado o celular muda-se o toggle
17+
const subscription = RNShake.addListener(() => {
18+
setToggle(oldToggle => !oldToggle);
19+
});
20+
//Função será chamada quando componente for desmontado
21+
return () => subscription.remove();
22+
}, []);
23+
24+
return (
25+
<View style={toggle ? style.containerLight : style.container}>
26+
<TouchableOpacity onPress={handleChangeToggle}>
27+
<Image
28+
style={toggle ? style.lightingOn : style.lightingOff}
29+
source={
30+
toggle
31+
? require('./assets/icons/eco-light.png')
32+
: require('./assets/icons/eco-light-off.png')
33+
}
34+
/>
35+
<Image
36+
style={style.dioLogo}
37+
source={
38+
toggle
39+
? require('./assets/icons/logo-dio.png')
40+
: require('./assets/icons/logo-dio-white.png')
41+
}
42+
/>
43+
</TouchableOpacity>
44+
</View>
45+
);
46+
};
47+
48+
export default App;
49+
50+
const style = StyleSheet.create({
51+
container: {
52+
flex: 1,
53+
backgroundColor: 'black',
54+
alignItems: 'center',
55+
justifyContent: 'center',
56+
},
57+
containerLight: {
58+
flex: 1,
59+
backgroundColor: 'white',
60+
alignItems: 'center',
61+
justifyContent: 'center',
62+
},
63+
lightingOn: {
64+
resizeMode: 'contain',
65+
alignSelf: 'center',
66+
width: 150,
67+
height: 150,
68+
},
69+
lightingOff: {
70+
resizeMode: 'contain',
71+
alignSelf: 'center',
72+
tintColor: 'white',
73+
width: 150,
74+
height: 150,
75+
},
76+
dioLogo: {
77+
resizeMode: 'contain',
78+
alignSelf: 'center',
79+
width: 250,
80+
height: 250,
81+
},
82+
});

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby '2.7.4'
5+
6+
gem 'cocoapods', '~> 1.11', '>= 1.11.2'

0 commit comments

Comments
 (0)