Skip to content

Commit

Permalink
Merge branch 'v6.3.0' of https://github.com/kanzitelli/expo-starter i…
Browse files Browse the repository at this point in the history
…nto v6.3.0
  • Loading branch information
kanzitelli committed May 13, 2023
2 parents 2212c74 + b049349 commit 536b92f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/components/action.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import {View, Text, Colors} from 'react-native-ui-lib';
import {Bounceable} from 'rn-bounceable';
import {Icon} from './icon';
import {Icon, IconName} from './icon';

type ActionProps = {
title: string;
icon?: string;
rightIcon?: string;
icon?: IconName;
rightIcon?: IconName;
info?: string;
disabled?: boolean;
onPress?: () => void;
Expand Down
6 changes: 4 additions & 2 deletions src/components/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import {View, Colors, ViewProps} from 'react-native-ui-lib';
import {Ionicons} from '@expo/vector-icons';
import {Bounceable} from 'rn-bounceable';

export type IconName = keyof typeof Ionicons.glyphMap;

type IconProps = {
name: string;
name: IconName;
size?: number;
color?: string;
viewProps?: ViewProps;
Expand All @@ -26,7 +28,7 @@ export const Icon: React.FC<IconProps> = ({
const Icon = useMemo(
() => (
<View {...viewProps}>
<IconComponent name={name as any} size={size} color={color} />
<IconComponent name={name} size={size} color={color} />
</View>
),
[viewProps, name, size, color],
Expand Down
4 changes: 2 additions & 2 deletions src/screens/playground/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import {useStores} from '@app/stores';
import {useServices} from '@app/services';
import {useAppearance} from '@app/utils/hooks';
import {Row} from '@app/components/row';
import {Icon} from '@app/components/icon';
import {Icon, IconName} from '@app/components/icon';
import {Section} from '@app/components/section';
import {Alert} from 'react-native';

type SectionData = {
content: {
title: string;
subtitle?: string;
icon: string;
icon: IconName;
onPress: PureFunc;
}[];
};
Expand Down
4 changes: 2 additions & 2 deletions src/utils/designSystem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {Appearance as RNAppearance, Platform} from 'react-native';
import {Colors, Typography} from 'react-native-ui-lib';

import {stores} from '@app/stores';
import {Icon} from '@app/components/icon';
import {Icon, IconName} from '@app/components/icon';
import {Appearance} from '@app/utils/types/enums';

// =============
Expand Down Expand Up @@ -164,7 +164,7 @@ export const getTabBarIcon =
({focused, color, size}: {focused: boolean; color: string; size: number}) =>
<Icon name={getTabIconName(tabName, focused)} size={size} color={color} />;

const getTabIconName = (tabName: string, focused: boolean): string => {
const getTabIconName = (tabName: string, focused: boolean): IconName => {
if (tabName === 'MainTab') {
return focused ? 'home' : 'home-outline';
}
Expand Down

0 comments on commit 536b92f

Please sign in to comment.