diff --git a/utils/Icons.js b/utils/Icons.js index c190a4f74..a80b83744 100644 --- a/utils/Icons.js +++ b/utils/Icons.js @@ -6,6 +6,7 @@ import { Platform } from 'react-native'; export const getIconName = (name = '') => { + return name if (name) { return Platform.OS === 'ios' ? `ios-${name}` : `md-${name}`; } diff --git a/utils/__tests__/Icons.test.js b/utils/__tests__/Icons.test.js index 8eb1bb720..ddb3647fd 100644 --- a/utils/__tests__/Icons.test.js +++ b/utils/__tests__/Icons.test.js @@ -9,13 +9,13 @@ import { getIconName } from '../Icons'; describe('Icons', () => { describe('getIconName()', () => { - it('should prefix icon names with "ios-" on iOS platforms', () => { - expect(getIconName('test')).toBe('ios-test'); + it('should not prefix icon names with "ios-" on iOS platforms', () => { + expect(getIconName('test')).toBe('test'); }); - it('should prefix icon names with "md-" on non-iOS platforms', () => { + it('should not prefix icon names with "md-" on non-iOS platforms', () => { Platform.OS = 'android'; - expect(getIconName('test')).toBe('md-test'); + expect(getIconName('test')).toBe('test'); }); it('should return empty string if called without icon name', () => {