Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: code style #307

Merged
merged 1 commit into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/layout/chat/conversation-window.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const ConversationWindow = ({
};

return (
<div className='container mx-auto flex w-10/12 flex-col items-start justify-start gap-3'>
<div className='container mx-auto flex flex-col items-start justify-start gap-3 md:w-11/12 xl:w-10/12'>
{messages.map((m) => (
<div key={m.id}>
{m.role == 'user' ? (
Expand Down
2 changes: 1 addition & 1 deletion components/layout/chat/input-box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const InputBox = ({
};

return (
<form className='container relative bottom-5 mx-auto w-full space-y-2 pb-3 md:w-10/12' onSubmit={loading ? handleStop : handleSubmit} onKeyDown={handleKeyDown}>
<form className='container relative bottom-5 mx-auto w-full space-y-2 pb-3 md:w-11/12 xl:w-10/12' onSubmit={loading ? handleStop : handleSubmit} onKeyDown={handleKeyDown}>
<div className='mx-3 flex justify-start space-x-3'>
<button
onClick={() => router.push('?open=settings')}
Expand Down
7 changes: 6 additions & 1 deletion components/layout/message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ export const renderMarkdownMessage = (content: string, hightlight?: string, setH
{children}
</Link>
),
pre: ({ children, ...props }: any) => (
<pre className='overflow-auto whitespace-pre-wrap rounded-md bg-neutral-200 p-1 dark:bg-neutral-600' {...props}>
{children}
</pre>
),
Comment on lines +86 to +90
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code_refinement): Consider specifying a more precise type than any for props.

Using any can lead to potential type safety issues. It would be beneficial to define a more specific type or interface for the props to ensure better type checking and maintainability.

Suggested change
pre: ({ children, ...props }: any) => (
<pre className='overflow-auto whitespace-pre-wrap rounded-md bg-neutral-200 p-1 dark:bg-neutral-600' {...props}>
{children}
</pre>
),
pre: ({ children, ...props }: React.HTMLAttributes<HTMLPreElement>) => (
<pre className='overflow-auto whitespace-pre-wrap rounded-md bg-neutral-200 p-1 dark:bg-neutral-600' {...props}>
{children}
</pre>
),

code: ({ children, ...props }: any) => (
<code className='rounded-md bg-gray-200 p-1' {...props}>
<code className='overflow-auto whitespace-pre-wrap rounded-md bg-neutral-200 p-1 dark:bg-neutral-600' {...props}>
{children}
</code>
),
Expand Down