Convert `CheckoutOrderNotes` to TS (https://github.com/woocommerce/woocommerce-blocks/pull/6118)
* Convert order-notes to TS * Rename onChange argument name To be consistent with the one in the `setOrderNotes` action
This commit is contained in:
parent
f7f1b89dc5
commit
e140901142
|
@ -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;
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue