Skip to content

Commit

Permalink
Loader migrated to TS #1002 (#1056)
Browse files Browse the repository at this point in the history
* Loader component mirated to TS

* Default props for loader component

* Default value for type prop
  • Loading branch information
Gauravsharma-20 authored Sep 27, 2021
1 parent ee6b1f8 commit 0f0d417
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';

import common from '../../common.scss';
import styles from './styles.scss';

const Loader = props => {
type LoaderProps = {
type: string;
}

const Loader: React.FC<LoaderProps> = ({
type='default'
}) => {
return (
<span className={cx(
common.nuclear,
props.type,
type,
styles.loader
)}>
<span />
Expand All @@ -20,12 +25,4 @@ const Loader = props => {
);
};

Loader.propTypes = {
type: PropTypes.string
};

Loader.defaultProps = {
type: 'default'
};

export default Loader;

0 comments on commit 0f0d417

Please sign in to comment.