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
1d7b3dba
Commit
1d7b3dba
authored
Jul 11, 2019
by
Prachpawee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update style
parent
0309c6a0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
39 deletions
+41
-39
src/components/layout/MeterCard.js
+40
-38
src/constants/Styles.js
+1
-1
No files found.
src/components/layout/MeterCard.js
View file @
1d7b3dba
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Card
,
View
,
Row
,
Icon
,
Text
}
from
'native-base'
;
import
{
Card
,
View
,
Row
,
Icon
,
Text
}
from
'native-base'
;
import
{
Image
,
StyleSheet
}
from
'react-native'
;
import
{
Image
,
StyleSheet
,
TouchableOpacity
}
from
'react-native'
;
import
{
color
}
from
'../../constants/Styles'
;
import
{
color
}
from
'../../constants/Styles'
;
const
MeterCard
=
props
=>
{
const
MeterCard
=
props
=>
{
return
(
return
(
<
Card
style
=
{[
styles
.
cardContainer
]}
>
<
TouchableOpacity
onPress
=
{()
=>
console
.
log
(
'Go to Smart meter '
+
props
.
index
+
'!!'
)}
>
<
View
style
=
{[
styles
.
imgContainer
]}
>
<
Card
style
=
{[
styles
.
cardContainer
]}
>
{
props
.
isOn
?
(
<
View
style
=
{[
styles
.
imgContainer
]}
>
<
View
style
=
{[
styles
.
onContainer
,
{
backgroundColor
:
'rgba(65, 204, 0, 0.59)'
}]}
>
{
props
.
isOn
?
(
<
Text
style
=
{[
styles
.
onText
]}
>
ON
<
/Text
>
<
View
style
=
{[
styles
.
onContainer
,
{
backgroundColor
:
'rgba(65, 204, 0, 0.59)'
}]}
>
<
/View
>
<
Text
style
=
{[
styles
.
onText
]}
>
ON
<
/Text
>
)
:
(
<
/View
>
<
View
style
=
{[
styles
.
onContainer
,
{
backgroundColor
:
'rgba(223, 0, 0, 0.59)'
}]}
>
)
:
(
<
Text
style
=
{[
styles
.
onText
]}
>
OFF
<
/Text
>
<
View
style
=
{[
styles
.
onContainer
,
{
backgroundColor
:
'rgba(223, 0, 0, 0.59)'
}]}
>
<
/View
>
<
Text
style
=
{[
styles
.
onText
]}
>
OFF
<
/Text
>
)}
<
/View
>
<
Image
)}
source
=
{{
<
Image
uri
:
props
.
img
,
source
=
{{
}}
uri
:
props
.
img
,
style
=
{[
styles
.
imgStyle
]}
}}
/
>
style
=
{[
styles
.
imgStyle
]}
<
/View
>
/
>
<
View
style
=
{[
styles
.
textContainer
]}
>
<
/View
>
{
props
.
isOnline
?
<
View
style
=
{[
styles
.
online
]}
/> : null
}
<
View
style
=
{[
styles
.
textContainer
]}
>
{
props
.
isOnline
?
<
View
style
=
{[
styles
.
online
]}
/> : null
}
<
Row
style
=
{[
styles
.
alignCenter
]}
>
<
Row
style
=
{[
styles
.
alignCenter
]}
>
<
Text
style
=
{[
styles
.
nameStyle
]}
>
{
props
.
deviceName
}
<
/Text
>
<
Text
style
=
{[
styles
.
nameStyle
]}
>
{
props
.
deviceName
}
<
/Text
>
<
Icon
name
=
"people"
style
=
{{
color
:
color
.
grey3
}}
/
>
<
Icon
name
=
"people"
style
=
{{
color
:
color
.
grey3
}}
/
>
<
/Row
>
<
/Row
>
<
Text
style
=
{[
styles
.
descStyle
]}
numberOfLines
=
{
2
}
>
<
Text
style
=
{[
styles
.
descStyle
]}
numberOfLines
=
{
2
}
>
{
props
.
description
}
{
props
.
description
}
<
/Text
>
<
/Text
>
<
Row
style
=
{{
marginTop
:
10
}}
>
<
Row
style
=
{{
marginTop
:
10
}}
>
<
View
style
=
{[
styles
.
iconCover
]}
>
<
View
style
=
{[
styles
.
iconCover
]}
>
<
Icon
name
=
"notifications"
style
=
{[
styles
.
iconStyle
]}
/
>
<
Icon
name
=
"notifications"
style
=
{[
styles
.
iconStyle
]}
/
>
<
/View
>
<
/View
>
<
View
style
=
{[
styles
.
iconCover
]}
>
<
View
style
=
{[
styles
.
iconCover
]}
>
<
Icon
name
=
"time"
style
=
{[
styles
.
iconStyle
]}
/
>
<
Icon
name
=
"time"
style
=
{[
styles
.
iconStyle
]}
/
>
<
/View
>
<
/View
>
<
/Row
>
<
/Row
>
<
/View
>
<
/View
>
<
/Card
>
<
/Card
>
<
/TouchableOpacity
>
);
);
};
};
...
...
src/constants/Styles.js
View file @
1d7b3dba
...
@@ -10,7 +10,7 @@ export const color = {
...
@@ -10,7 +10,7 @@ export const color = {
export
const
theme
=
StyleSheet
.
create
({
export
const
theme
=
StyleSheet
.
create
({
startContainer
:
{
startContainer
:
{
top
:
120
,
top
:
'15%'
,
paddingHorizontal
:
50
,
paddingHorizontal
:
50
,
},
},
startTitle
:
{
startTitle
:
{
...
...
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