Skip to content

Commit

Permalink
migrate DragHandle component from jsx to tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Damans227 committed Nov 3, 2021
1 parent a2a457b commit fd1c2fe
Showing 1 changed file with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,22 @@
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';
import PropTypes from 'prop-types';
import React, { LegacyRef } from 'react';
import cx from 'classnames';

const propTypes = {
position: PropTypes.oneOf(['left', 'top']),
innerRef: PropTypes.func,
dotCount: PropTypes.number,
};
interface DragHandleProps {
position: 'left' | 'top';
innerRef: LegacyRef<HTMLDivElement> | undefined;
dotCount: number;
}

const defaultProps = {
position: 'left',
innerRef: null,
dotCount: 8,
};
export default class DragHandle extends React.PureComponent<DragHandleProps> {
static defaultProps = {
position: 'left',
innerRef: null,
dotCount: 8,
};

export default class DragHandle extends React.PureComponent {
render() {
const { innerRef, position, dotCount } = this.props;
return (
Expand All @@ -53,6 +52,3 @@ export default class DragHandle extends React.PureComponent {
);
}
}

DragHandle.propTypes = propTypes;
DragHandle.defaultProps = defaultProps;

0 comments on commit fd1c2fe

Please sign in to comment.