Skip to content

Commit 943ef27

Browse files
committed
Refactor ChatInputArea to support dynamic height adjustment and update styles for improved layout consistency.
1 parent 15a41c2 commit 943ef27

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

workshop-ui/src/app/chat/[exercise]/page.module.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,6 @@
166166
transform: translateX(-50%);
167167
width: calc(100% - 40px);
168168
max-width: 760px;
169-
display: flex;
170-
flex-direction: column;
171-
gap: 0;
172-
padding: 0;
173169
}
174170

175171
.loader {

workshop-ui/src/app/chat/[exercise]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ export default function Home() {
382382

383383
{/* Input Area */}
384384
<div className={styles.inputAreaContainer} style={{ height: `${inputAreaHeight}px` }}>
385-
<ChatInputArea inputRef={inputRef} inputValue={input} setInputValue={setInput} onSubmit={handleSubmit} isLoading={isLoading} messageCount={messages.length} />
385+
<ChatInputArea inputRef={inputRef} inputValue={input} setInputValue={setInput} onSubmit={handleSubmit} isLoading={isLoading} messageCount={messages.length} fillContainer={true} />
386386
</div>
387387
</div>
388388
);

workshop-ui/src/components/chat/ChatInputArea.module.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
.wrapper {
22
display: flex;
33
flex-direction: column;
4-
height: 100%;
54
gap: 10px;
65
}
76

7+
.fillContainer {
8+
height: 100%;
9+
}
10+
811
.inputForm {
912
display: flex;
1013
gap: 10px;

workshop-ui/src/components/chat/ChatInputArea.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ interface ChatInputAreaProps {
1010
onSubmit: (e: React.FormEvent) => void;
1111
isLoading: boolean;
1212
messageCount: number;
13+
fillContainer?: boolean;
1314
}
1415

1516
export default function ChatInputArea({
@@ -18,7 +19,8 @@ export default function ChatInputArea({
1819
setInputValue,
1920
onSubmit,
2021
isLoading,
21-
messageCount
22+
messageCount,
23+
fillContainer = false
2224
}: Readonly<ChatInputAreaProps>) {
2325

2426
const handleInputChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
@@ -28,7 +30,7 @@ export default function ChatInputArea({
2830
}
2931
};
3032
return (
31-
<div className={styles.wrapper}>
33+
<div className={`${styles.wrapper} ${fillContainer ? styles.fillContainer : ''}`}>
3234
<form onSubmit={onSubmit} className={styles.inputForm}>
3335
<textarea
3436
ref={inputRef}

0 commit comments

Comments
 (0)