summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@codeispoetry.ru>2017-02-06 20:00:16 +0000
committerAndrej Mihajlov <and@codeispoetry.ru>2017-02-06 20:00:16 +0000
commit5372c52d8b75445999c8499e7d36771988043cab (patch)
tree97c14b4dea40e36136bd66022c89cc9b54a4eb7b
parentb9af59aed525b53db05f86ad8e71da077d7f5091 (diff)
downloadmullvadvpn-5372c52d8b75445999c8499e7d36771988043cab.tar.xz
mullvadvpn-5372c52d8b75445999c8499e7d36771988043cab.zip
Use PropTypes.node to allow false to be used in conditional rendering
-rw-r--r--app/components/Tray.js4
-rw-r--r--app/lib/components/TrayMenu.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/app/components/Tray.js b/app/components/Tray.js
index 69f14cb7ca..f5e42c78db 100644
--- a/app/components/Tray.js
+++ b/app/components/Tray.js
@@ -17,8 +17,8 @@ export default class Tray extends Component {
return (
<TrayMenu tray={this.props.handle}>
- {<TrayItem label="Log out" click={::this.logout} visible={loggedIn} />}
- {<TrayItem type="separator" visible={loggedIn} />}
+ {loggedIn && <TrayItem label="Log out" click={::this.logout} />}
+ {loggedIn && <TrayItem type="separator" />}
<TrayItem label="Privacy Policy" />
<TrayItem label="Visit homepage" />
</TrayMenu>
diff --git a/app/lib/components/TrayMenu.js b/app/lib/components/TrayMenu.js
index dcbaf41fd2..5f14ca71f9 100644
--- a/app/lib/components/TrayMenu.js
+++ b/app/lib/components/TrayMenu.js
@@ -28,7 +28,7 @@ export class TrayMenu extends Component {
static propTypes = {
tray: PropTypes.object.isRequired,
- children: PropTypes.arrayOf(PropTypes.element).isRequired
+ children: PropTypes.arrayOf(PropTypes.node).isRequired
};
_contextMenu = null;
@@ -80,7 +80,7 @@ export class TraySubmenu extends Component {
};
static propTypes = {
- children: PropTypes.arrayOf(PropTypes.element).isRequired
+ children: PropTypes.arrayOf(PropTypes.node).isRequired
};
_contextMenu = null;