Skip to content

Commit

Permalink
fix: raw block code
Browse files Browse the repository at this point in the history
  • Loading branch information
willydouhard committed Jan 7, 2025
1 parent c747770 commit a991071
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion backend/chainlit/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
}
},
"DeleteThreadButton": {
"confirmMessage": "This will delete the thread as well as it's messages and elements.",
"confirmMessage": "This will delete the thread as well as its messages and elements.",
"cancel": "Cancel",
"confirm": "Confirm",
"deletingChat": "Deleting chat",
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/AutoResizeTextarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const AutoResizeTextarea = ({
useEffect(() => {
const textarea = textareaRef.current;
if (!textarea || !maxHeight) return;
textarea.style.height = 'auto';
textarea.style.height = '40px';
const newHeight = Math.min(textarea.scrollHeight, maxHeight);
textarea.style.height = `${newHeight}px`;
}, [props.value]);
Expand All @@ -55,7 +55,7 @@ const AutoResizeTextarea = ({
onCompositionStart={() => setIsComposing(true)}
onCompositionEnd={() => setIsComposing(false)}
className={cn(
'p-0 min-h-6 rounded-none resize-none border-none overflow-y-auto shadow-none focus:ring-0 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-offset-0',
'p-0 min-h-[40px] h-[40px] rounded-none resize-none border-none overflow-y-auto shadow-none focus:ring-0 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-offset-0',
className
)}
placeholder={placeholder}
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/CodeSnippet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const HighlightedCode = ({ language, children }: CodeSnippetProps) => {
<pre className="m-0">
<code
ref={codeRef}
className={`language-${language} font-mono text-sm rounded-b-lg block`}
className={`language-${language} font-mono text-sm rounded-b-md block`}
>
{children}
</code>
Expand All @@ -51,7 +51,7 @@ interface CodeProps {
};
}

export default function CodeSnippet({ children, ...props }: CodeProps) {
export default function CodeSnippet({ ...props }: CodeProps) {
const codeChildren = props.node?.children?.[0];
const className = codeChildren?.properties?.className?.[0];
const match = /language-(\w+)/.exec(className || '');
Expand All @@ -64,8 +64,8 @@ export default function CodeSnippet({ children, ...props }: CodeProps) {
) : null;

const nonHighlightedCode = showSyntaxHighlighter ? null : (
<div className="rounded-lg p-2 min-h-20 overflow-x-auto bg-accent">
<code className="whitespace-pre-wrap">{children}</code>
<div className="p-2 rounded-b-md min-h-20 overflow-x-auto bg-accent">
<code className="whitespace-pre-wrap">{code}</code>
</div>
);

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/chat/MessageComposer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export default function MessageComposer({
onPaste={onPaste}
onEnter={submit}
onChange={(e) => setValue(e.target.value)}
className="mt-1 bg-transparent placeholder:text-base placeholder:font-medium text-base"
className="bg-transparent placeholder:text-base placeholder:font-medium text-base"
maxHeight={250}
placeholder={t('components.organisms.chat.inputBox.input.placeholder')}
/>
Expand Down

0 comments on commit a991071

Please sign in to comment.