summaryrefslogtreecommitdiffhomepage
path: root/app/components/AppButton.js
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-07-18 13:33:53 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-07-18 20:06:22 +0200
commit4ee82a1d456158635cd6998cbf087ef32fb68c41 (patch)
tree013e1a655ee03a80a85e755c6b834e1c0e572335 /app/components/AppButton.js
parente6dc383704b1c7a6aff8abfad2bd5e2d948138cc (diff)
downloadmullvadvpn-4ee82a1d456158635cd6998cbf087ef32fb68c41.tar.xz
mullvadvpn-4ee82a1d456158635cd6998cbf087ef32fb68c41.zip
Do not depend on node.type.name, instead compare prototypes
Diffstat (limited to 'app/components/AppButton.js')
-rw-r--r--app/components/AppButton.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/components/AppButton.js b/app/components/AppButton.js
index 7419203472..4ce085af49 100644
--- a/app/components/AppButton.js
+++ b/app/components/AppButton.js
@@ -3,6 +3,7 @@ import * as React from 'react';
import { Button, Text, Component } from 'reactxp';
import styles from './AppButtonStyles';
import blurStyles from './BlurAppButtonStyles';
+import Img from './Img';
export class Label extends Text {}
@@ -32,11 +33,11 @@ class BaseButton extends Component {
if (React.isValidElement(node)) {
let updatedProps = {};
- if (node.type.name === 'Label') {
+ if (node.type === Label) {
updatedProps = { style: [styles.label, this.textStyle()] };
}
- if (node.type.name === 'Img') {
+ if (node.type === Img) {
updatedProps = { tintColor: 'currentColor', style: [styles.icon, this.iconStyle()] };
}