refactor(client): slim-width-row to TypeScript
This commit is contained in:
@ -1,8 +1,13 @@
|
|||||||
import React from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { Row, Col } from '@freecodecamp/react-bootstrap';
|
import { Row, Col } from '@freecodecamp/react-bootstrap';
|
||||||
|
|
||||||
function SlimWidthRow({ children, ...restProps }) {
|
interface SlimWidthRowProps {
|
||||||
|
children: ReactNode;
|
||||||
|
}
|
||||||
|
function SlimWidthRow({
|
||||||
|
children,
|
||||||
|
...restProps
|
||||||
|
}: SlimWidthRowProps): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<Row {...restProps}>
|
<Row {...restProps}>
|
||||||
<Col md={6} mdOffset={3} sm={12}>
|
<Col md={6} mdOffset={3} sm={12}>
|
||||||
@ -13,8 +18,5 @@ function SlimWidthRow({ children, ...restProps }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SlimWidthRow.displayName = 'SlimWidthRow';
|
SlimWidthRow.displayName = 'SlimWidthRow';
|
||||||
SlimWidthRow.propTypes = {
|
|
||||||
children: PropTypes.any
|
|
||||||
};
|
|
||||||
|
|
||||||
export default SlimWidthRow;
|
export default SlimWidthRow;
|
||||||
|
Reference in New Issue
Block a user