1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 11:28:51 +01:00
metamask-extension/ui/components/institutional/note-to-trader/note-to-trader.js
George Marshall e75535ddfb
Update Text import paths: /institutional (#20064)
* Updating Text import paths and deprecated consts

* Update to button
2023-07-18 08:15:25 -07:00

59 lines
1.5 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import {
Display,
FlexDirection,
JustifyContent,
} from '../../../helpers/constants/design-system';
import { Label, Box, Text } from '../../component-library';
const NoteToTrader = (props) => {
const { placeholder, maxLength, onChange, noteText, labelText } = props;
return (
<Box className="confirm-page-container-content__data">
<Box
display={Display.Flex}
flexDirection={FlexDirection.Column}
padding={4}
>
<Box
className="note-header"
display={Display.Flex}
justifyContent={JustifyContent.spaceBetween}
>
<Label htmlFor="transaction-note">{labelText}</Label>
<Text className="note-header__counter">
{noteText.length}/{maxLength}
</Text>
</Box>
<Box
display={Display.Flex}
flexDirection={FlexDirection.Column}
className="note-field"
>
<textarea
id="transaction-note"
data-testid="transaction-note"
onChange={({ target: { value } }) => onChange(value)}
autoFocus
maxLength={maxLength}
placeholder={placeholder}
value={noteText}
/>
</Box>
</Box>
</Box>
);
};
NoteToTrader.propTypes = {
placeholder: PropTypes.string,
maxLength: PropTypes.string,
onChange: PropTypes.func,
noteText: PropTypes.string,
labelText: PropTypes.string,
};
export default NoteToTrader;