react-native-material-elements
Version:
React native material elements is a sophisticated UI library crafted to enhance your React Native development workflow. Designed for simplicity and elegance, nex-ui provides a rich collection of components and utilities to effortlessly create polished mob
25 lines (22 loc) • 846 B
text/typescript
import { ColorValue } from 'react-native';
import { getVariant, GetVariantArgs } from '../../utils';
import { GetActivityIndicatorColor } from './ActivityIndicator.types';
import { green, grey, lightBlue, primary, red, secondary, yellow } from '../../libraries';
const colorConfig: GetVariantArgs<unknown>['config'] = {
primary: { color: primary[500] },
secondary: { color: secondary[400] },
error: { color: red[500] },
info: { color: lightBlue[500] },
success: { color: green[500] },
warning: { color: yellow[500] },
grey: { color: grey[50] },
lightGrey: { color: grey[500] },
};
export const getActivityIndicatorColor = ({ variant, colors, switchMode }: GetActivityIndicatorColor): ColorValue => {
const color = getVariant({
variant,
colors,
...(!switchMode && { config: colorConfig }),
});
return color;
};