Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
safetcut-app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
atichat
safetcut-app
Commits
7cb8077e
Commit
7cb8077e
authored
Sep 24, 2019
by
HaOuiha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
cd1feaf6
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
50 deletions
+48
-50
screens/Private/SettingScreen/Setting.js
+29
-4
screens/Private/SettingScreen/WifiSelectScreen.js
+5
-7
screens/Private/SmartMeterScreen/McbLinkScreen.js
+4
-13
screens/Private/SmartMeterScreen/SmartMeterDetailScreen.js
+3
-8
screens/Private/SmartMeterScreen/SmartMeterScreen.js
+2
-4
screens/Public/AuthLoadingScreen.js
+4
-13
screens/Public/LoginScreen.js
+1
-1
No files found.
screens/Private/SettingScreen/Setting.js
View file @
7cb8077e
...
...
@@ -8,8 +8,8 @@ import { width } from '../../../constants/Layout';
import
{
Overlay
}
from
'react-native-elements'
;
import
{
connect
}
from
'react-redux'
;
import
{
updateDetail
}
from
'../../../reduxStore/actions/currentSelectedAction'
;
import
Slider
from
'react-native-slider'
;
import
Modal
from
'react-native-modalbox'
;
class
updateDetailScreen
extends
Component
{
static
navigationOptions
=
({
navigation
})
=>
{
...
...
@@ -116,7 +116,7 @@ class updateDetailScreen extends Component {
)
:
(
<
View
style
=
{
styles
.
textInputContainer
}
>
<
TextInput
multiline
=
{
t
ru
e
}
multiline
=
{
t
his
.
state
.
field
===
'Description'
?
true
:
fals
e
}
style
=
{[
theme
.
description
,
{
fontSize
:
14
}]}
onChangeText
=
{
data
=>
this
.
setState
({
data
})}
value
=
{
data
}
...
...
@@ -127,7 +127,31 @@ class updateDetailScreen extends Component {
<
Button
full
style
=
{
styles
.
saveButton
}
onPress
=
{()
=>
this
.
toggleModal
(
true
)}
>
<
Text
style
=
{[
theme
.
normalText
,
theme
.
textWhite
]}
>
SAVE
<
/Text
>
<
/Button
>
<
Overlay
<
Modal
coverScreen
swipeToClose
=
{
false
}
animationDuration
=
{
250
}
style
=
{{
height
:
'25%'
,
width
:
'90%'
,
borderRadius
:
20
}}
position
=
{
'center'
}
isOpen
=
{
isVisible
}
onClosed
=
{()
=>
this
.
toggleModal
(
false
)}
>
<
View
style
=
{
styles
.
overlayStyle
}
>
<
Text
style
=
{[
theme
.
normalText
,
theme
.
textDark
,
theme
.
centerText
,
{
marginHorizontal
:
30
}]}
>
Are
you
sure
you
want
to
save
this
item
?
<
/Text
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
Button
transparent
style
=
{{
width
:
'40%'
}}
onPress
=
{()
=>
this
.
toggleModal
(
false
)}
>
<
Text
style
=
{{
color
:
color
.
grey
}}
>
CANCEL
<
/Text
>
<
/Button
>
<
Button
style
=
{
styles
.
saveButtonModal
}
rounded
onPress
=
{()
=>
this
.
handleConfirm
()}
>
<
Text
>
SAVE
<
/Text
>
<
/Button
>
<
/View
>
<
/View
>
<
/Modal
>
{
/* <Overlay
borderRadius={20}
height={'25%'}
width={'90%'}
...
...
@@ -148,7 +172,7 @@ class updateDetailScreen extends Component {
</Button>
</View>
</>
<
/Overlay
>
</Overlay>
*/
}
<
/View
>
);
}
...
...
@@ -166,6 +190,7 @@ export default connect(
const
styles
=
StyleSheet
.
create
({
overlayStyle
:
{
padding
:
20
,
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'space-around'
,
},
...
...
screens/Private/SettingScreen/WifiSelectScreen.js
View file @
7cb8077e
...
...
@@ -23,7 +23,7 @@ export default class WifiSelectScreen extends React.Component {
),
};
};
renderWifiList
()
{
renderWifiList
=
()
=>
{
return
(
<
FlatList
data
=
{
mock
.
filter
(
x
=>
x
.
connected
===
false
)}
...
...
@@ -34,15 +34,13 @@ export default class WifiSelectScreen extends React.Component {
style
=
{{
marginBottom
:
isIphoneX
()
?
100
:
65
}}
/
>
);
}
renderWifiCard
(
item
)
{
}
;
renderWifiCard
=
item
=>
{
return
(
<
TouchableOpacity
style
=
{[
styles
.
cardContainer
,
{
backgroundColor
:
item
.
connected
?
'rgba(238,84,84,0.2)'
:
color
.
white
,
},
{
backgroundColor
:
item
.
connected
?
'rgba(238,84,84,0.2)'
:
color
.
white
},
]}
>
<
View
style
=
{[
theme
.
rowContainer
,
{
justifyContent
:
'space-between'
}]}
>
...
...
@@ -61,7 +59,7 @@ export default class WifiSelectScreen extends React.Component {
<
/View
>
<
/TouchableOpacity
>
);
}
}
;
render
()
{
return
(
<
ScrollView
style
=
{[
theme
.
container
,
{}]}
>
...
...
screens/Private/SmartMeterScreen/McbLinkScreen.js
View file @
7cb8077e
...
...
@@ -228,9 +228,7 @@ class McbLinkScreen extends React.Component {
}
}}
ItemSeparatorComponent
=
{()
=>
<
View
style
=
{{
margin
:
5
}}
/>
}
keyExtractor
=
{(
item
,
index
)
=>
{
`elec
${
index
}
`
;
}}
keyExtractor
=
{(
item
,
index
)
=>
`elec
${
index
}
`
}
key
=
{
`scrollPage
${
index
}
`
}
/
>
);
...
...
@@ -296,11 +294,7 @@ class McbLinkScreen extends React.Component {
<
TextInput
placeholder
=
"Device name"
style
=
{[
theme
.
normalText
,
{
width
:
'100%'
}]}
onChangeText
=
{
text
=>
this
.
setState
({
deviceName
:
text
,
})
}
onChangeText
=
{
text
=>
this
.
setState
({
deviceName
:
text
})}
value
=
{
deviceName
}
/
>
<
/View
>
...
...
@@ -333,10 +327,7 @@ class McbLinkScreen extends React.Component {
<
Image
style
=
{[
styles
.
electronicIcon
,
{
tintColor
:
dynamicColor
,
resizeMode
:
'contain'
,
},
{
tintColor
:
dynamicColor
,
resizeMode
:
'contain'
},
]}
source
=
{
getDeviceIcon
(
item
.
type
)}
/
>
...
...
@@ -412,7 +403,7 @@ class McbLinkScreen extends React.Component {
animationDuration
=
{
360
}
style
=
{[
styles
.
addModal
]}
position
=
{
'bottom'
}
isOpen
=
{
this
.
state
.
isAddElectronicVisible
}
visible
=
{
this
.
state
.
isAddElectronicVisible
}
onClosed
=
{()
=>
this
.
setState
({
isAddElectronicVisible
:
false
})}
>
{
this
.
renderAddModal
()}
...
...
screens/Private/SmartMeterScreen/SmartMeterDetailScreen.js
View file @
7cb8077e
...
...
@@ -179,7 +179,7 @@ class SmartMeterDetailScreen extends Component {
<
Card
style
=
{{
padding
:
15
,
marginBottom
:
20
,
borderRadius
:
10
,
borderColor
:
color
.
white
}}
>
<
Row
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
Left
>
<
Text
style
=
{[
theme
.
smallTitle
,
{
color
:
color
.
darkGrey
}]}
>
{
name
||
'Untitled'
}
<
/Text
>
<
Text
style
=
{[
theme
.
smallTitle
,
{
color
:
color
.
darkGrey
}]}
>
{
name
}
<
/Text
>
<
/Left
>
<
Right
>
<
Switch
...
...
@@ -361,12 +361,7 @@ class SmartMeterDetailScreen extends Component {
};
return
(
<
Card
style
=
{{
borderColor
:
color
.
white
,
borderRadius
:
8
,
}}
>
<
Card
style
=
{{
borderColor
:
color
.
white
,
borderRadius
:
8
}}
>
<
Row
style
=
{{
paddingVertical
:
7
,
paddingLeft
:
7
,
paddingRight
:
Platform
.
OS
===
'android'
?
12
:
7
}}
onPress
=
{
handleOnPressMcbLink
}
...
...
@@ -451,7 +446,7 @@ class SmartMeterDetailScreen extends Component {
/
>
)
:
(
<
View
style
=
{{
marginTop
:
20
}}
>
<
Text
>
{
this
.
props
.
error
}
<
/Text
>
<
Text
>
{
'Something went wrong '
+
this
.
props
.
error
}
<
/Text
>
<
/View
>
)
// </Card>
...
...
screens/Private/SmartMeterScreen/SmartMeterScreen.js
View file @
7cb8077e
...
...
@@ -129,7 +129,7 @@ class SmartMeterScreen extends PureComponent {
<
/
>
)
:
(
<
View
>
<
Text
>
{
error
}
<
/Text
>
<
Text
>
{
'Something went wrong '
+
error
}
<
/Text
>
<
/View
>
);
}
...
...
@@ -165,9 +165,7 @@ const mapStateToProps = state => ({
error
:
state
.
allMainDeviceReducer
.
error
,
});
const
mapDispatchToProps
=
{
getAllMainDeviceInfo
,
};
const
mapDispatchToProps
=
{
getAllMainDeviceInfo
};
export
default
connect
(
mapStateToProps
,
...
...
screens/Public/AuthLoadingScreen.js
View file @
7cb8077e
...
...
@@ -29,19 +29,16 @@ class AuthLoadingScreen extends Component {
},
900
);
// 1200
};
_
bootstrapAsync
=
async
()
=>
{
bootstrapAsync
=
async
()
=>
{
this
.
showLogoThenIndicator
();
try
{
// Preload data from an external API
// Preload data using AsyncStorage
// Preload data from an external API && Preload data using AsyncStorage
const
alreadyLaunched
=
await
AsyncStorage
.
getItem
(
'alreadyLaunched'
);
const
RememberedLogin
=
await
AsyncStorage
.
getItem
(
'RememberedLogin'
);
app
.
auth
().
onAuthStateChanged
(
async
user
=>
{
if
(
user
)
{
console
.
log
(
user
);
// const idToken = await app.auth().currentUser.getIdToken(/* forceRefresh */ true);
// console.log(idToken);
await
this
.
props
.
getCurrentUser
(
user
);
this
.
props
.
navigation
.
navigate
(
RememberedLogin
===
'true'
?
'Main'
:
'Login'
);
// createMockData();
...
...
@@ -56,7 +53,7 @@ class AuthLoadingScreen extends Component {
componentDidMount
=
()
=>
{
this
.
_isMounted
=
true
;
this
.
_
bootstrapAsync
();
this
.
bootstrapAsync
();
};
componentWillUnmount
=
()
=>
{
...
...
@@ -67,13 +64,7 @@ class AuthLoadingScreen extends Component {
return
(
<
View
style
=
{{
flex
:
1
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
{
this
.
state
.
isShowImg
?
(
<
Image
style
=
{{
width
:
width
*
0.9
,
resizeMode
:
'contain'
,
}}
source
=
{
logo
}
/
>
<
Image
style
=
{{
width
:
width
*
0.9
,
resizeMode
:
'contain'
}}
source
=
{
logo
}
/
>
)
:
(
<
ActivityIndicator
size
=
"large"
color
=
"#f44c4c"
/>
)}
...
...
screens/Public/LoginScreen.js
View file @
7cb8077e
...
...
@@ -21,7 +21,7 @@ export default class LoginScreen extends Component {
const
{
username
,
password
}
=
values
;
try
{
await
app
.
auth
().
signInWithEmailAndPassword
(
username
,
password
);
this
.
success
();
await
this
.
success
();
}
catch
(
error
)
{
alert
(
error
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment