* Convert order-notes to TS

* Rename onChange argument name

To be consistent with the one in the `setOrderNotes` action
This commit is contained in:
Alba Rincón 2022-03-28 15:44:25 +02:00 committed by GitHub
parent f7f1b89dc5
commit e140901142
2 changed files with 14 additions and 2 deletions

View File

@ -9,7 +9,7 @@ import classnames from 'classnames';
import './style.scss';
interface TextareaProps {
className: string;
className?: string;
disabled: boolean;
onTextChange: ( newText: string ) => void;
placeholder: string;

View File

@ -11,7 +11,19 @@ import { Textarea } from '@woocommerce/base-components/textarea';
*/
import './style.scss';
const CheckoutOrderNotes = ( { disabled, onChange, placeholder, value } ) => {
interface CheckoutOrderNotesProps {
disabled: boolean;
onChange: ( orderNotes: string ) => void;
placeholder: string;
value: string;
}
const CheckoutOrderNotes = ( {
disabled,
onChange,
placeholder,
value,
}: CheckoutOrderNotesProps ): JSX.Element => {
const [ withOrderNotes, setWithOrderNotes ] = useState( false );
// Store order notes when the textarea is hidden. This allows us to recover
// text entered previously by the user when the checkbox is re-enabled