From 673bb90f76a425c27c3ef3a99910812a6eff6735 Mon Sep 17 00:00:00 2001 From: Johnathan Bell Date: Tue, 29 Oct 2024 15:10:27 -0400 Subject: [PATCH] Fix broken icons --- utils/Icons.js | 1 + utils/__tests__/Icons.test.js | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) 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', () => {