Skip to content

Commit 486766e

Browse files
committed
messageinputのdaisyUI移行
1 parent 4d05867 commit 486766e

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

web/components/chat/MessageInput.tsx

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import SendIcon from "@mui/icons-material/Send";
2-
import { Box, IconButton, Stack, TextField, Typography } from "@mui/material";
31
import { useEffect, useState } from "react";
2+
import { MdSend } from "react-icons/md";
43
import type { DMOverview, SendMessage, UserID } from "~/common/types";
54
import { parseContent } from "~/common/zod/methods";
65

@@ -58,34 +57,30 @@ export function MessageInput({ send, room }: Props) {
5857
}
5958

6059
return (
61-
<Box sx={{ padding: "0px" }}>
60+
<div className="p-0">
6261
<form onSubmit={submit}>
63-
<Stack direction="row" spacing={1} alignItems="center" margin={2}>
64-
<TextField
62+
<div className="flex items-center space-x-2 p-2">
63+
<textarea
6564
name="message"
6665
placeholder="メッセージを入力"
67-
variant="outlined"
68-
size="small"
66+
className={`textarea textarea-bordered w-full resize-none ${
67+
error ? "textarea-error" : ""
68+
}`}
6969
value={message}
70-
fullWidth
71-
multiline
72-
minRows={1}
73-
maxRows={3}
70+
rows={1}
7471
onChange={(e) => setMessage(e.target.value)}
7572
onKeyDown={handleKeyDown}
76-
error={!!error}
7773
autoComplete="off"
7874
/>
79-
<IconButton type="submit" color="primary">
80-
<SendIcon />
81-
</IconButton>
82-
</Stack>
83-
{error && (
84-
<Typography color="error" variant="body2" marginLeft={2}>
85-
{error}
86-
</Typography>
87-
)}
75+
<button
76+
type="submit"
77+
className="btn btn-primary btn-circle flex items-center justify-center"
78+
>
79+
<MdSend />
80+
</button>
81+
</div>
82+
{error && <p className="ml-2 text-red-500 text-sm">{error}</p>}
8883
</form>
89-
</Box>
84+
</div>
9085
);
9186
}

0 commit comments

Comments
 (0)