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
f5802acb
Commit
f5802acb
authored
Sep 11, 2019
by
Tonk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add share by qrcode
parent
84273d69
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
14 deletions
+23
-14
screens/Private/CameraScreen.js
+12
-9
screens/Private/HistoryScreen/HistoryScreen.js
+2
-3
screens/Private/SettingScreen/SettingScreen.js
+4
-1
screens/Private/SmartMeterScreen/SmartMeterScreen.js
+5
-1
No files found.
screens/Private/CameraScreen.js
View file @
f5802acb
...
...
@@ -12,15 +12,18 @@ import { TouchableNativeFeedback, TouchableOpacity } from 'react-native-gesture-
import
QRCodeScanner
from
'react-native-qrcode-scanner'
;
class
CameraScreen
extends
Component
{
static
navigationOptions
=
({
navigation
})
=>
({
title
:
'Home'
,
headerLeft
:
null
,
headerRight
:
(
<
HeaderButtons
HeaderButtonComponent
=
{
IoniconsHeaderButton
}
>
<
Item
title
=
"close"
iconName
=
"ios-close"
onPress
=
{()
=>
navigation
.
pop
()}
/
>
<
/HeaderButtons
>
),
});
static
navigationOptions
=
({
navigation
})
=>
{
const
header
=
navigation
.
getParam
(
'header'
);
return
{
title
:
header
,
headerLeft
:
null
,
headerRight
:
(
<
HeaderButtons
HeaderButtonComponent
=
{
IoniconsHeaderButton
}
>
<
Item
title
=
"close"
iconName
=
"ios-close"
onPress
=
{()
=>
navigation
.
pop
()}
/
>
<
/HeaderButtons
>
),
};
};
state
=
{
scanned
:
false
,
...
...
screens/Private/HistoryScreen/HistoryScreen.js
View file @
f5802acb
import
React
from
'react'
;
import
{
Text
,
Icon
,
Footer
}
from
'native-base'
;
import
{
Text
,
Icon
}
from
'native-base'
;
import
{
TouchableOpacity
,
View
,
StyleSheet
}
from
'react-native'
;
import
{
ScrollView
,
FlatList
}
from
'react-native-gesture-handler'
;
import
{
theme
,
color
}
from
'../../../constants/Styles'
;
...
...
@@ -9,7 +9,6 @@ import * as shape from 'd3-shape';
import
{
format
,
parse
}
from
'date-fns'
;
import
{
Circle
}
from
'react-native-svg'
;
import
Tooltip
from
'./Tooltip'
;
import
moment
from
'moment'
;
// mock data
const
data
=
require
(
'./history.json'
);
...
...
@@ -48,7 +47,7 @@ export default class HistoryScreen extends React.Component {
});
}
render
()
{
const
{
graphType
,
data
,
data2
,
tooltipX
,
tooltipY
,
tooltipIndex
}
=
this
.
state
;
const
{
graphType
,
data
,
tooltipX
,
tooltipY
,
tooltipIndex
}
=
this
.
state
;
const
ChartPoints
=
({
x
,
y
,
color
})
=>
data
.
map
((
item
,
index
)
=>
(
...
...
screens/Private/SettingScreen/SettingScreen.js
View file @
f5802acb
...
...
@@ -183,7 +183,10 @@ class SettingScreen extends React.Component {
underlayColor
=
"transparent"
onHideUnderlay
=
{()
=>
this
.
setState
({
pressQr
:
false
})}
onShowUnderlay
=
{()
=>
this
.
setState
({
pressQr
:
true
})}
onPress
=
{()
=>
console
.
log
(
'press'
)}
onPress
=
{()
=>
{
this
.
props
.
navigation
.
navigate
(
'Camera'
,
{
header
:
'Share'
});
this
.
setState
({
isVisible
:
false
,
pressQr
:
false
});
}}
>
<
View
style
=
{[
...
...
screens/Private/SmartMeterScreen/SmartMeterScreen.js
View file @
f5802acb
...
...
@@ -15,7 +15,11 @@ class SmartMeterScreen extends PureComponent {
title
:
'Home'
,
headerRight
:
(
<
HeaderButtons
HeaderButtonComponent
=
{
IoniconsHeaderButton
}
>
<
Item
title
=
"menu"
iconName
=
"ios-add"
onPress
=
{()
=>
navigation
.
navigate
(
'Camera'
)}
/
>
<
Item
title
=
"menu"
iconName
=
"ios-add"
onPress
=
{()
=>
navigation
.
navigate
(
'Camera'
,
{
header
:
'Home'
})}
/
>
<
/HeaderButtons
>
),
});
...
...
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