Skip to content

Commit

Permalink
feat: checkbox read color from theme fixes #416
Browse files Browse the repository at this point in the history
  • Loading branch information
BANG88 committed Apr 30, 2019
1 parent 9553cb9 commit bf6d71b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions components/checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { StyleProp, Text, TextStyle, TouchableWithoutFeedback, View } from 'react-native';
import Icon from '../icon';
import { WithTheme, WithThemeStyles } from '../style';
import variables from '../style/themes/default';
import { CheckboxPropsType } from './PropsType';
import CheckboxStyles, { CheckboxStyle } from './style/index';

Expand Down Expand Up @@ -52,15 +51,15 @@ export default class Checkbox extends React.Component<CheckboxProps, any> {
const checked = this.state.checked;
return (
<WithTheme themeStyles={CheckboxStyles} styles={this.props.styles}>
{styles => {
{(styles,theme) => {
let icon;
if (checked) {
icon = disabled ? (
<Icon name="check-square" style={[styles.icon, style]} />
) : (
<Icon
name="check-square"
color={variables.brand_primary}
color={theme.brand_primary}
style={[styles.icon, style]}
/>
);
Expand All @@ -70,7 +69,7 @@ export default class Checkbox extends React.Component<CheckboxProps, any> {
) : (
<Icon
name="border"
color={variables.brand_primary}
color={theme.brand_primary}
style={[styles.icon, style]}
/>
);
Expand Down

0 comments on commit bf6d71b

Please sign in to comment.