Skip to content

Commit

Permalink
add: autofocus on text area and width issue fixed in waifu chat
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivaBhattacharjee committed May 12, 2024
1 parent 19a3523 commit 9dc2b4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion public/sw.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/app/waifu/[waifuid]/[animename]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const Page = ({ params }: { params: { waifuid: string; animename: string } }) =>
{message.map((msg, index) => (
<React.Fragment key={index}>
{msg.text !== "" && (
<div className={`break-words max-w-auto min-w-[100%] lg:max-w-auto lg:min-w-[60%] ${msg.isBot ? "self-start break-words" : "self-end"} px-3 py-3`}>
<div className={`break-words ${msg.isBot ? "self-start break-words" : "self-end"} px-3 py-3`}>
<div className={`${msg.isBot ? "bg-white/20 text-white rounded-lg " : " bg-white/10 text-white w-auto font-bold rounded-lg break-words"} p-4 rounded-lg whitespace-pre-wrap`} style={{ wordBreak: "break-all" }}>
<ReactMarkdown>{msg.text}</ReactMarkdown>
</div>
Expand Down Expand Up @@ -129,7 +129,7 @@ const Page = ({ params }: { params: { waifuid: string; animename: string } }) =>
</div>
) : (
<>
<textarea onKeyDown={handleTextareaKeyDown} placeholder="Enter a message" rows={1} onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) => setPrompt(e.target.value)} className="border-0 font-medium bg-transparent outline-none overflow-hidden w-[96%] " typeof="text" />
<textarea autoFocus={true} onKeyDown={handleTextareaKeyDown} placeholder="Enter a message" rows={1} onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) => setPrompt(e.target.value)} className="border-0 font-medium bg-transparent outline-none overflow-hidden w-[96%] " typeof="text" />
{!loading && (
<button className="absolute duration-200 hover:bg-transparent hover:border-2 hover:border-white hover:text-white cursor-pointer right-3 p-2 top-4 bg-white/10 text-white rounded-full">
<SendHorizonal />
Expand Down

0 comments on commit 9dc2b4a

Please sign in to comment.