Skip to content

Commit

Permalink
feat: ✨ added useSpinnerProps hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik-B-06 committed Nov 24, 2021
1 parent d304168 commit 2be93ed
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/components/spinner/SpinnerProps.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { pick } from 'lodash';
import { SpinnerLibProps, SpinnerProps } from 'react-native-system';
import { SPINNER_LIB_KEYS } from './__keys';

interface SpinnerPropsReturnType {
_spinnerProps: SpinnerLibProps;
}

export const useSpinnerProps = (
props: React.PropsWithChildren<Partial<SpinnerProps>>
): SpinnerPropsReturnType => {
props = { size: 'md', stroke: 'transparent', ...props };
const _spinnerBasicProps = pick(props, SPINNER_LIB_KEYS) as SpinnerLibProps;
return { _spinnerProps: _spinnerBasicProps };
};

0 comments on commit 2be93ed

Please sign in to comment.