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
46d40f16
Commit
46d40f16
authored
Sep 27, 2019
by
Tonk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update smart device card
parent
20376e73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
25 deletions
+11
-25
components/MeterCard.js
+11
-25
No files found.
components/MeterCard.js
View file @
46d40f16
...
@@ -12,10 +12,8 @@ const MeterCard = ({ item, onPressEachCard }) => {
...
@@ -12,10 +12,8 @@ const MeterCard = ({ item, onPressEachCard }) => {
styles
.
meterOn
,
styles
.
meterOn
,
{
backgroundColor
:
item
.
breakerStatus
===
1
?
'rgba(65, 204, 0, 0.59)'
:
'rgba(223, 0, 0, 0.59)'
},
{
backgroundColor
:
item
.
breakerStatus
===
1
?
'rgba(65, 204, 0, 0.59)'
:
'rgba(223, 0, 0, 0.59)'
},
]}
]}
>
><
/View
>
<
Text
style
=
{[
theme
.
description
,
theme
.
textWhite
]}
>
{
item
.
breakerStatus
===
1
?
'ON'
:
'OFF'
}
<
/Text
>
<
View
style
=
{[
theme
.
centerContainer
,
{
paddingLeft
:
10
}]}
>
<
/View
>
<
View
style
=
{[
theme
.
centerContainer
]}
>
{
item
.
img
?
(
{
item
.
img
?
(
<
Image
source
=
{{
uri
:
item
.
img
}}
style
=
{
styles
.
meterImgStyle
}
/
>
<
Image
source
=
{{
uri
:
item
.
img
}}
style
=
{
styles
.
meterImgStyle
}
/
>
)
:
(
)
:
(
...
@@ -25,25 +23,15 @@ const MeterCard = ({ item, onPressEachCard }) => {
...
@@ -25,25 +23,15 @@ const MeterCard = ({ item, onPressEachCard }) => {
)}
)}
<
/View
>
<
/View
>
<
View
style
=
{[
theme
.
containerWithPadding
,
{
flex
:
2
}]}
>
<
View
style
=
{[
theme
.
containerWithPadding
,
{
flex
:
2
}]}
>
<
Row
style
=
{{
alignItems
:
'center'
}}
>
<
Text
style
=
{[
theme
.
smallTitle
]}
>
{
item
.
name
}
<
/Text
>
<
Text
style
=
{[
theme
.
smallTitle
,
{
marginRight
:
15
}]}
>
{
item
.
name
}
<
/Text
>
<
Text
style
=
{[
theme
.
description
,
theme
.
mt1
]}
numberOfLines
=
{
2
}
>
<
/Row
>
<
Text
style
=
{[
theme
.
description
]}
numberOfLines
=
{
2
}
>
{
item
.
description
}
{
item
.
description
}
<
/Text
>
<
/Text
>
<
Row
style
=
{{
marginTop
:
10
}}
>
<
View
style
=
{[
styles
.
meterIconCover
]}
>
<
Icon
name
=
"ios-notifications-outline"
style
=
{
styles
.
meterIconStyle
}
/
>
<
/View
>
<
View
style
=
{
styles
.
meterIconCover
}
>
<
Icon
name
=
"md-alarm"
style
=
{
styles
.
meterIconStyle
}
/
>
<
/View
>
<
/Row
>
<
/View
>
<
/View
>
<
View
style
=
{[
theme
.
rowContainer
,
{
position
:
'absolute'
,
top
:
10
,
right
:
5
}]}
>
<
View
style
=
{[
theme
.
rowContainer
,
{
position
:
'absolute'
,
top
:
10
,
right
:
5
}]}
>
<
Icon
name
=
"wifi"
type
=
"FontAwesome"
style
=
{
styles
.
iconStyle
}
/
>
<
Icon
name
=
{
item
.
isSharing
?
'users'
:
'user'
}
type
=
"FontAwesome"
style
=
{
styles
.
iconStyle
}
/
>
<
View
style
=
{[
styles
.
online
,
{
backgroundColor
:
item
.
isOnline
?
'#10ca88'
:
color
.
primary
}]}
/
>
<
View
style
=
{[
styles
.
online
,
{
backgroundColor
:
item
.
isOnline
?
'#10ca88'
:
color
.
primary
}]}
/
>
<
Icon
name
=
{
item
.
isSharing
?
'users'
:
'user'
}
type
=
"FontAwesome"
style
=
{
styles
.
iconStyle
}
/
>
<
Icon
name
=
"wifi"
type
=
"FontAwesome"
style
=
{
styles
.
iconStyle
}
/
>
<
/View
>
<
/View
>
<
/
>
<
/
>
);
);
...
@@ -63,14 +51,11 @@ export default MeterCard;
...
@@ -63,14 +51,11 @@ export default MeterCard;
const
styles
=
StyleSheet
.
create
({
const
styles
=
StyleSheet
.
create
({
meterOn
:
{
meterOn
:
{
top
:
7
,
top
:
0
,
left
:
5
,
left
:
0
,
width
:
35
,
bottom
:
0
,
paddingVertical
:
1
,
width
:
10
,
borderRadius
:
9.6
,
position
:
'absolute'
,
position
:
'absolute'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
},
},
meterImgStyle
:
{
meterImgStyle
:
{
width
:
50
,
width
:
50
,
...
@@ -116,5 +101,6 @@ const styles = StyleSheet.create({
...
@@ -116,5 +101,6 @@ const styles = StyleSheet.create({
shadowRadius
:
3.84
,
shadowRadius
:
3.84
,
elevation
:
5
,
elevation
:
5
,
backgroundColor
:
'#fff'
,
backgroundColor
:
'#fff'
,
overflow
:
'hidden'
,
},
},
});
});
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