summaryrefslogtreecommitdiffhomepage
path: root/app/components/Cell.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/Cell.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/Cell.js')
-rw-r--r--app/components/Cell.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/components/Cell.js b/app/components/Cell.js
index 9f0efaab2c..2b3c06a3b1 100644
--- a/app/components/Cell.js
+++ b/app/components/Cell.js
@@ -2,9 +2,9 @@
import * as React from 'react';
import { Button, Text, Component, Types } from 'reactxp';
-import { colors } from '../config';
-
+import Img from './Img';
import { createViewStyles, createTextStyles } from '../lib/styles';
+import { colors } from '../config';
const styles = {
...createViewStyles({
@@ -86,20 +86,20 @@ export class CellButton extends Component<CellButtonProps, State> {
if (React.isValidElement(node)) {
let updatedProps = {};
- if (node.type.name === 'Label') {
+ if (node.type === Label) {
updatedProps = {
style: [styles.label, node.props.style, this.textStyle(node.props.cellHoverStyle)],
};
}
- if (node.type.name === 'Img') {
+ if (node.type === Img) {
updatedProps = {
tintColor: 'currentColor',
style: [styles.icon, node.props.style, this.iconStyle(node.props.cellHoverStyle)],
};
}
- if (node.type.name === 'SubText') {
+ if (node.type === SubText) {
updatedProps = {
style: [
styles.subtext,