Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
parity-signer
Commits
4387bcf3
Commit
4387bcf3
authored
Jul 25, 2019
by
Thibaut Sardan
Browse files
fix(): strip things down more
parent
569e3fcb
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/components/SecurityHeader.js
View file @
4387bcf3
...
...
@@ -14,30 +14,32 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import
NetInfo
from
'
@react-native-community/netinfo
'
;
import
React
from
'
react
'
;
import
{
StyleSheet
,
Text
,
View
}
from
'
react-native
'
;
import
Icon
from
'
react-native-vector-icons/MaterialIcons
'
;
import
{
withNavigation
}
from
'
react-navigation
'
;
import
{
Subscribe
}
from
'
unstated
'
;
import
colors
from
'
../colors
'
;
import
SecurityStore
from
'
../stores/SecurityStore
'
;
import
TouchableItem
from
'
./TouchableItem
'
;
export
default
class
SecurityHeader
extends
React
.
Component
{
render
()
{
return
(
<
Subscribe
to
=
{[
SecurityStore
]}
>
{
securityStore
=>
(
<
SecurityHeaderView
isConnected
=
{
securityStore
.
isConnected
()}
/
>
)}
<
/Subscribe
>
);
class
SecurityHeader
extends
React
.
Component
{
state
=
{
isConnected
:
false
};
componentDidMount
()
{
this
.
unsubscribe
=
NetInfo
.
addEventListener
(
state
=>
{
this
.
setState
({
isConnected
:
state
.
isConnected
});
});
}
componentWillUnmount
()
{
this
.
unsubscribe
();
}
}
class
_SecurityHeaderView
extends
React
.
PureComponent
{
render
()
{
const
{
isConnected
}
=
this
.
props
;
const
{
isConnected
}
=
this
.
state
;
if
(
!
isConnected
)
{
return
null
...
...
@@ -72,4 +74,4 @@ const styles = StyleSheet.create({
}
});
const
SecurityHeaderView
=
withNavigation
(
_
SecurityHeader
View
);
export
default
withNavigation
(
SecurityHeader
);
src/screens/Security.js
View file @
4387bcf3
...
...
@@ -17,6 +17,7 @@
import
React
from
'
react
'
;
import
{
ScrollView
,
StyleSheet
,
Text
,
View
}
from
'
react-native
'
;
import
Icon
from
'
react-native-vector-icons/MaterialIcons
'
;
import
colors
from
'
../colors
'
;
export
default
class
Security
extends
React
.
PureComponent
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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