From 1dbec43dd27d77a5a39f291ad3837a77e35b0f30 Mon Sep 17 00:00:00 2001 From: Trancever Date: Mon, 3 Feb 2020 16:23:31 +0100 Subject: [PATCH] fix: use material community icon for hard coded names --- src/components/CheckboxAndroid.tsx | 9 +++++---- src/components/CheckboxIOS.tsx | 9 +++++---- src/components/DataTable/DataTableTitle.tsx | 10 ++++++++-- src/components/List/ListAccordion.tsx | 8 +++++--- src/components/MaterialCommunityIcon.tsx | 10 +++++++++- src/components/RadioButton/RadioButtonIOS.tsx | 9 +++++---- 6 files changed, 37 insertions(+), 18 deletions(-) diff --git a/src/components/CheckboxAndroid.tsx b/src/components/CheckboxAndroid.tsx index efe82636a9..5876b9fc56 100644 --- a/src/components/CheckboxAndroid.tsx +++ b/src/components/CheckboxAndroid.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; -import { Animated, View, StyleSheet } from 'react-native'; +import { Animated, View, StyleSheet, I18nManager } from 'react-native'; import color from 'color'; -import Icon from './Icon'; +import MaterialCommunityIcon from './MaterialCommunityIcon'; import TouchableRipple from './TouchableRipple'; import { withTheme } from '../core/theming'; import { Theme, $RemoveChildren } from '../types'; @@ -138,11 +138,12 @@ class CheckboxAndroid extends React.Component { style={styles.container} > - { style={styles.container} > - diff --git a/src/components/DataTable/DataTableTitle.tsx b/src/components/DataTable/DataTableTitle.tsx index 34836f7c48..cb15ec1878 100644 --- a/src/components/DataTable/DataTableTitle.tsx +++ b/src/components/DataTable/DataTableTitle.tsx @@ -6,9 +6,10 @@ import { TouchableWithoutFeedback, View, ViewStyle, + I18nManager, } from 'react-native'; import color from 'color'; -import Icon from '../Icon'; +import MaterialCommunityIcon from '../MaterialCommunityIcon'; import Text from '../Typography/Text'; import { withTheme } from '../../core/theming'; import { Theme } from '../../types'; @@ -94,7 +95,12 @@ class DataTableTitle extends React.Component { const icon = sortDirection ? ( - + ) : null; diff --git a/src/components/List/ListAccordion.tsx b/src/components/List/ListAccordion.tsx index c6a8c9b5d5..c460079173 100644 --- a/src/components/List/ListAccordion.tsx +++ b/src/components/List/ListAccordion.tsx @@ -6,9 +6,10 @@ import { StyleSheet, StyleProp, TextStyle, + I18nManager, } from 'react-native'; import TouchableRipple from '../TouchableRipple'; -import Icon from '../Icon'; +import MaterialCommunityIcon from '../MaterialCommunityIcon'; import Text from '../Typography/Text'; import { withTheme } from '../../core/theming'; import { Theme } from '../../types'; @@ -251,10 +252,11 @@ class ListAccordion extends React.Component { description ? styles.multiline : undefined, ]} > - diff --git a/src/components/MaterialCommunityIcon.tsx b/src/components/MaterialCommunityIcon.tsx index b82d8b45b2..12e2611db0 100644 --- a/src/components/MaterialCommunityIcon.tsx +++ b/src/components/MaterialCommunityIcon.tsx @@ -6,6 +6,7 @@ export type IconProps = { color: string; size: number; direction: 'rtl' | 'ltr'; + allowFontScaling?: boolean; }; let MaterialCommunityIcons: any; @@ -75,8 +76,15 @@ export const accessibilityProps = importantForAccessibility: 'no-hide-descendants' as 'no-hide-descendants', }; -const defaultIcon = ({ name, color, size, direction }: IconProps) => ( +const defaultIcon = ({ + name, + color, + size, + direction, + allowFontScaling, +}: IconProps) => ( { style={styles.container} > -