mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 21:34:00 +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 Message from './Message';
|
||||||
import NewMessageButton from './Message/NewMessageButton';
|
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';
|
import useSubmit from '@hooks/useSubmit';
|
||||||
|
|
||||||
const ChatContent = () => {
|
const ChatContent = () => {
|
||||||
|
|
|
@ -6,11 +6,12 @@ import MessageContent from './MessageContent';
|
||||||
import { Role } from '@type/chat';
|
import { Role } from '@type/chat';
|
||||||
import RoleSelector from './RoleSelector';
|
import RoleSelector from './RoleSelector';
|
||||||
|
|
||||||
const backgroundStyle: { [role in Role]: string } = {
|
// const backgroundStyle: { [role in Role]: string } = {
|
||||||
user: 'dark:bg-gray-800',
|
// user: 'dark:bg-gray-800',
|
||||||
assistant: 'bg-gray-50 dark:bg-[#444654]',
|
// assistant: 'bg-gray-50 dark:bg-[#444654]',
|
||||||
system: '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 = ({
|
const Message = ({
|
||||||
role,
|
role,
|
||||||
|
@ -25,7 +26,9 @@ const Message = ({
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<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={
|
key={
|
||||||
messageIndex !== -1
|
messageIndex !== -1
|
||||||
? `${messageIndex}-${content}`
|
? `${messageIndex}-${content}`
|
||||||
|
|
|
@ -300,13 +300,15 @@ const EditView = ({
|
||||||
<>
|
<>
|
||||||
<textarea
|
<textarea
|
||||||
ref={textareaRef}
|
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) => {
|
onChange={(e) => {
|
||||||
_setContent(e.target.value);
|
_setContent(e.target.value);
|
||||||
}}
|
}}
|
||||||
value={_content}
|
value={_content}
|
||||||
onInput={handleInput}
|
onInput={handleInput}
|
||||||
rows={1}
|
rows={sticky ? 10 : 1}
|
||||||
></textarea>
|
></textarea>
|
||||||
<div className='text-center mt-2 flex justify-center'>
|
<div className='text-center mt-2 flex justify-center'>
|
||||||
<button
|
<button
|
||||||
|
|
Loading…
Reference in a new issue