|
1 | 1 | import './textInput.css' |
2 | 2 |
|
3 | 3 | import SendIcon from '@mui/icons-material/Send' |
| 4 | +import Box from '@mui/material/Box' |
4 | 5 | import IconButton from '@mui/material/IconButton' |
5 | | -import InputAdornment from '@mui/material/InputAdornment' |
6 | 6 | import TextField from '@mui/material/TextField' |
7 | 7 | import { useState } from 'react' |
8 | 8 | import React from 'react' |
@@ -61,36 +61,32 @@ export default function TextInput(props: TextInputProps) { |
61 | 61 | } |
62 | 62 |
|
63 | 63 | return ( |
64 | | - <TextField |
65 | | - data-cy="text-input" |
66 | | - className="rustic-text-input" |
67 | | - variant="outlined" |
68 | | - value={messageText} |
69 | | - label={props.label} |
70 | | - maxRows={props.maxRows} |
71 | | - multiline={props.multiline} |
72 | | - fullWidth={props.fullWidth} |
73 | | - onKeyDown={handleKeyDown} |
74 | | - onChange={handleOnChange} |
75 | | - sx={{ |
76 | | - backgroundColor: 'background.paper', |
77 | | - }} |
78 | | - InputProps={{ |
79 | | - endAdornment: ( |
80 | | - <InputAdornment position="end"> |
81 | | - <IconButton |
82 | | - data-cy="send-button" |
83 | | - aria-label="send message" |
84 | | - onClick={handleSendMessage} |
85 | | - disabled={isEmptyMessage} |
86 | | - color="primary" |
87 | | - > |
88 | | - <SendIcon /> |
89 | | - </IconButton> |
90 | | - </InputAdornment> |
91 | | - ), |
92 | | - }} |
93 | | - /> |
| 64 | + <Box className="rustic-text-input-container"> |
| 65 | + <TextField |
| 66 | + data-cy="text-input" |
| 67 | + className="rustic-text-input" |
| 68 | + variant="outlined" |
| 69 | + value={messageText} |
| 70 | + label={props.label} |
| 71 | + maxRows={props.maxRows} |
| 72 | + multiline={props.multiline} |
| 73 | + fullWidth={props.fullWidth} |
| 74 | + onKeyDown={handleKeyDown} |
| 75 | + onChange={handleOnChange} |
| 76 | + sx={{ |
| 77 | + backgroundColor: 'background.paper', |
| 78 | + }} |
| 79 | + /> |
| 80 | + <IconButton |
| 81 | + data-cy="send-button" |
| 82 | + aria-label="send message" |
| 83 | + onClick={handleSendMessage} |
| 84 | + disabled={isEmptyMessage} |
| 85 | + color="primary" |
| 86 | + > |
| 87 | + <SendIcon /> |
| 88 | + </IconButton> |
| 89 | + </Box> |
94 | 90 | ) |
95 | 91 | } |
96 | 92 |
|
|
0 commit comments