feat: optimize message style
This commit is contained in:
parent
bd865f0270
commit
3d801f1552
Binary file not shown.
|
Before Width: | Height: | Size: 9.0 KiB |
BIN
src/renderer/src/assets/images/models/qwen.png
Normal file
BIN
src/renderer/src/assets/images/models/qwen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@ -33,6 +33,7 @@
|
|||||||
--color-border: #ffffff20;
|
--color-border: #ffffff20;
|
||||||
--color-error: #f44336;
|
--color-error: #f44336;
|
||||||
|
|
||||||
|
--navbar-background: #1f1f1f;
|
||||||
--navbar-height: 42px;
|
--navbar-height: 42px;
|
||||||
--sidebar-width: 55px;
|
--sidebar-width: 55px;
|
||||||
--assistants-width: 250px;
|
--assistants-width: 250px;
|
||||||
|
|||||||
@ -26,7 +26,7 @@ const NavbarContainer = styled.div`
|
|||||||
min-height: var(--navbar-height);
|
min-height: var(--navbar-height);
|
||||||
max-height: var(--navbar-height);
|
max-height: var(--navbar-height);
|
||||||
-webkit-app-region: drag;
|
-webkit-app-region: drag;
|
||||||
background-color: #1f1f1f;
|
background-color: var(--navbar-background);
|
||||||
margin-left: calc(var(--sidebar-width) * -1);
|
margin-left: calc(var(--sidebar-width) * -1);
|
||||||
padding-left: var(--sidebar-width);
|
padding-left: var(--sidebar-width);
|
||||||
border-bottom: 0.5px solid var(--color-border);
|
border-bottom: 0.5px solid var(--color-border);
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import ChatGPTModelLogo from '@renderer/assets/images/models/chatgpt.jpeg'
|
|||||||
import ChatGLMModelLogo from '@renderer/assets/images/models/chatglm.jpeg'
|
import ChatGLMModelLogo from '@renderer/assets/images/models/chatglm.jpeg'
|
||||||
import DeepSeekModelLogo from '@renderer/assets/images/models/deepseek.png'
|
import DeepSeekModelLogo from '@renderer/assets/images/models/deepseek.png'
|
||||||
import GemmaModelLogo from '@renderer/assets/images/models/gemma.jpeg'
|
import GemmaModelLogo from '@renderer/assets/images/models/gemma.jpeg'
|
||||||
import QwenModelLogo from '@renderer/assets/images/models/qwen.jpeg'
|
import QwenModelLogo from '@renderer/assets/images/models/qwen.png'
|
||||||
import YiModelLogo from '@renderer/assets/images/models/yi.svg'
|
import YiModelLogo from '@renderer/assets/images/models/yi.svg'
|
||||||
import LlamaModelLogo from '@renderer/assets/images/models/llama.jpeg'
|
import LlamaModelLogo from '@renderer/assets/images/models/llama.jpeg'
|
||||||
import MixtralModelLogo from '@renderer/assets/images/models/mixtral.jpeg'
|
import MixtralModelLogo from '@renderer/assets/images/models/mixtral.jpeg'
|
||||||
|
|||||||
@ -83,11 +83,11 @@ const MessageItem: FC<Props> = ({ message, index, showMenu, onDeleteMessage }) =
|
|||||||
<MessageHeader>
|
<MessageHeader>
|
||||||
<AvatarWrapper>
|
<AvatarWrapper>
|
||||||
{message.role === 'assistant' ? (
|
{message.role === 'assistant' ? (
|
||||||
<Avatar src={message.modelId ? getModelLogo(message.modelId) : Logo}>
|
<Avatar src={message.modelId ? getModelLogo(message.modelId) : Logo} size={35}>
|
||||||
{firstLetter(message.modelId).toUpperCase()}
|
{firstLetter(message.modelId).toUpperCase()}
|
||||||
</Avatar>
|
</Avatar>
|
||||||
) : (
|
) : (
|
||||||
<Avatar src={avatar} />
|
<Avatar src={avatar} size={35} />
|
||||||
)}
|
)}
|
||||||
<UserWrap>
|
<UserWrap>
|
||||||
<UserName>{getUserName()}</UserName>
|
<UserName>{getUserName()}</UserName>
|
||||||
@ -147,9 +147,9 @@ const MessageItem: FC<Props> = ({ message, index, showMenu, onDeleteMessage }) =
|
|||||||
const MessageContainer = styled.div`
|
const MessageContainer = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 10px 18px;
|
padding: 10px;
|
||||||
position: relative;
|
position: relative;
|
||||||
border-bottom: 0.5px solid var(--color-border);
|
border-bottom: 0.5px dotted var(--color-border);
|
||||||
.menubar {
|
.menubar {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity 0.2s ease;
|
transition: opacity 0.2s ease;
|
||||||
@ -171,7 +171,6 @@ const MessageContainer = styled.div`
|
|||||||
|
|
||||||
const MessageHeader = styled.div`
|
const MessageHeader = styled.div`
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
margin-bottom: 10px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -187,20 +186,19 @@ const AvatarWrapper = styled.div`
|
|||||||
|
|
||||||
const UserWrap = styled.div`
|
const UserWrap = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: column;
|
||||||
align-items: center;
|
justify-content: space-between;
|
||||||
`
|
|
||||||
|
|
||||||
const MessageTime = styled.div`
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--color-text-2);
|
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
`
|
`
|
||||||
|
|
||||||
const UserName = styled.div`
|
const UserName = styled.div`
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
margin-left: 12px;
|
`
|
||||||
|
|
||||||
|
const MessageTime = styled.div`
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--color-text-3);
|
||||||
`
|
`
|
||||||
|
|
||||||
const MessageContent = styled.div`
|
const MessageContent = styled.div`
|
||||||
@ -208,6 +206,8 @@ const MessageContent = styled.div`
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
margin-left: 46px;
|
||||||
|
margin-top: 5px;
|
||||||
`
|
`
|
||||||
|
|
||||||
const MessageContentLoading = styled.div`
|
const MessageContentLoading = styled.div`
|
||||||
|
|||||||
@ -119,7 +119,7 @@ const Container = styled.div`
|
|||||||
flex-direction: column-reverse;
|
flex-direction: column-reverse;
|
||||||
max-height: calc(100vh - var(--input-bar-height) - var(--navbar-height));
|
max-height: calc(100vh - var(--input-bar-height) - var(--navbar-height));
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 10px;
|
||||||
.message:first-child {
|
.message:first-child {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user