mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 21:53:58 +01:00
style updates
This commit is contained in:
parent
3abf98c89d
commit
60401a491e
|
@ -7,12 +7,6 @@ import ChatTitle from './ChatTitle';
|
|||
import Message from './Message';
|
||||
import NewMessageButton from './Message/NewMessageButton';
|
||||
|
||||
import { getChatCompletionStream as getChatCompletionStreamFree } from '@api/freeApi';
|
||||
import { getChatCompletionStream as getChatCompletionStreamCustom } from '@api/customApi';
|
||||
import { parseEventSource } from '@api/helper';
|
||||
|
||||
import RefreshIcon from '@icon/RefreshIcon';
|
||||
import { MessageInterface } from '@type/chat';
|
||||
import useSubmit from '@hooks/useSubmit';
|
||||
|
||||
const ChatContent = () => {
|
||||
|
|
|
@ -6,11 +6,12 @@ import MessageContent from './MessageContent';
|
|||
import { Role } from '@type/chat';
|
||||
import RoleSelector from './RoleSelector';
|
||||
|
||||
const backgroundStyle: { [role in Role]: string } = {
|
||||
user: 'dark:bg-gray-800',
|
||||
assistant: 'bg-gray-50 dark:bg-[#444654]',
|
||||
system: 'bg-gray-50 dark:bg-[#444654]',
|
||||
};
|
||||
// const backgroundStyle: { [role in Role]: string } = {
|
||||
// user: 'dark:bg-gray-800',
|
||||
// assistant: 'bg-gray-50 dark:bg-[#444654]',
|
||||
// system: 'bg-gray-50 dark:bg-[#444654]',
|
||||
// };
|
||||
const backgroundStyle = ['dark:bg-gray-800', 'bg-gray-50 dark:bg-[#444654]'];
|
||||
|
||||
const Message = ({
|
||||
role,
|
||||
|
@ -25,7 +26,9 @@ const Message = ({
|
|||
}) => {
|
||||
return (
|
||||
<div
|
||||
className={`w-full border-b border-black/10 dark:border-gray-900/50 text-gray-800 dark:text-gray-100 group ${backgroundStyle[role]}`}
|
||||
className={`w-full border-b border-black/10 dark:border-gray-900/50 text-gray-800 dark:text-gray-100 group ${
|
||||
backgroundStyle[messageIndex % 2]
|
||||
}`}
|
||||
key={
|
||||
messageIndex !== -1
|
||||
? `${messageIndex}-${content}`
|
||||
|
|
|
@ -300,13 +300,15 @@ const EditView = ({
|
|||
<>
|
||||
<textarea
|
||||
ref={textareaRef}
|
||||
className='m-0 resize-none rounded-lg bg-transparent overflow-y-hidden focus:ring-0 focus-visible:ring-0 focus:outline-none leading-7'
|
||||
className={`m-0 resize-none rounded-lg bg-transparent overflow-y-hidden focus:ring-0 focus-visible:ring-0 leading-7 ${
|
||||
sticky ? 'border border-gray-400/30 px-2 py-1' : 'focus:outline-none'
|
||||
}`}
|
||||
onChange={(e) => {
|
||||
_setContent(e.target.value);
|
||||
}}
|
||||
value={_content}
|
||||
onInput={handleInput}
|
||||
rows={1}
|
||||
rows={sticky ? 10 : 1}
|
||||
></textarea>
|
||||
<div className='text-center mt-2 flex justify-center'>
|
||||
<button
|
||||
|
|
Loading…
Reference in a new issue