Skip to content

Commit

Permalink
style updates
Browse files Browse the repository at this point in the history
  • Loading branch information
SerhiiTsybulskyi committed Aug 2, 2024
1 parent da9aa9b commit b48eb25
Show file tree
Hide file tree
Showing 7 changed files with 803 additions and 30 deletions.
6 changes: 4 additions & 2 deletions src/SessionMessages/SessionMessage/MessageSource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ export interface MessageSourceProps extends ConversationSource {
}

export const MessageSource: FC<MessageSourceProps> = ({ title, url, image, limit = 50 }) => {
const { theme } = useContext(ChatContext);
const { theme, isCompact } = useContext(ChatContext);

return (
<figure
className={cn(theme.messages.message.sources.source.base)}
className={cn(theme.messages.message.sources.source.base, {
[theme.messages.message.sources.source.companion]: isCompact
})}
onClick={() => {
if (url) {
window.open(url, '_blank');
Expand Down
2 changes: 1 addition & 1 deletion src/SessionMessages/SessionMessagePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const SessionMessagePanel: FC<PropsWithChildren> = ({ children }) => {
className={cn(theme.messages.back)}
>
<BackIcon />
Back
Back
</Button>
)}
{children}
Expand Down
500 changes: 500 additions & 0 deletions src/assets/placeholder-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
258 changes: 258 additions & 0 deletions src/assets/placeholder.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 15 additions & 10 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface ChatTheme {
base: string;
source: {
base: string;
companion: string;
image: string;
title: string;
url: string;
Expand Down Expand Up @@ -82,7 +83,7 @@ export interface ChatTheme {

export const chatTheme: ChatTheme = {
base: 'dark:text-white text-gray-500',
console: 'flex w-full gap-5 h-full',
console: 'flex w-full gap-10 h-full',
companion: 'w-full h-full overflow-hidden',
empty: 'text-center flex-1',
sessions: {
Expand All @@ -95,14 +96,15 @@ export const chatTheme: ChatTheme = {
create: 'relative mb-4 rounded-[10px] text-white',
session: {
base: [
'my-1 rounded-[10px] p-2 text-gray-500 border border-transparent hover:bg-gray-300 hover:border-gray-400 [&_svg]:text-gray-500',
'group my-1 rounded-[10px] p-2 text-gray-500 border border-transparent hover:bg-gray-300 hover:border-gray-400 [&_svg]:text-gray-500',
'dark:text-typography dark:text-gray-400 dark:hover:bg-gray-800/50 dark:hover:border-gray-700/50 dark:[&_svg]:text-gray-200'
].join(' '),
active: [
'border border-gray-300 hover:border-gray-400 text-gray-700 bg-gray-200 hover:bg-gray-300 ',
'dark:text-gray-500 dark:bg-gray-800/70 dark:border-gray-700/50 dark:text-white dark:border-gray-700/70 dark:hover:bg-gray-800/50'
'dark:text-gray-500 dark:bg-gray-800/70 dark:border-gray-700/50 dark:text-white dark:border-gray-700/70 dark:hover:bg-gray-800/50',
'[&_button]:!opacity-100'
].join(' '),
delete: '[&>svg]:w-4 [&>svg]:h-4 opacity-50'
delete: '[&>svg]:w-4 [&>svg]:h-4 opacity-0 group-hover:!opacity-50'
}
},
messages: {
Expand All @@ -111,8 +113,10 @@ export const chatTheme: ChatTheme = {
companion: 'flex w-full h-full',
back: 'self-start p-0 my-2',
inner: 'flex-1 h-full flex flex-col',
title: ['text-2xl font-bold text-gray-500', 'dark:text-gray-200'].join(' '),
date: 'text-sm whitespace-nowrap pt-2 text-gray-400',
title: ['text-base font-bold text-gray-500', 'dark:text-gray-200'].join(
' '
),
date: 'text-xs whitespace-nowrap pt-2 text-gray-400',
content: [
'mt-2 flex-1 overflow-auto [&_hr]:bg-gray-200',
'dark:[&_hr]:bg-gray-800/60'
Expand All @@ -125,7 +129,7 @@ export const chatTheme: ChatTheme = {
'dark:bg-panel'
].join(' '),
question: [
'font-semibold mb-4 px-4 py-3 pb-1 rounded-3xl rounded-br-none text-typography border bg-gray-200 border-gray-300 text-gray-900',
'font-semibold mb-4 px-4 py-4 pb-2 rounded-3xl rounded-br-none text-typography border bg-gray-200 border-gray-300 text-gray-900',
'dark:bg-gray-900/60 dark:border-gray-700/50 dark:text-gray-100'
].join(' '),
response: ['text-gray-900', 'dark:text-gray-100'].join(' '),
Expand All @@ -134,7 +138,7 @@ export const chatTheme: ChatTheme = {
base: 'mb-2 flex flex-wrap gap-3 ',
file: {
base: [
'flex items-center gap-2 border border-gray-300 p-2 rounded cursor-pointer',
'flex items-center gap-2 border border-gray-300 px-3 py-2 rounded-lg cursor-pointer',
'dark:border-gray-700'
].join(' '),
name: ['text-sm text-gray-500', 'dark:text-gray-200'].join(' ')
Expand All @@ -144,10 +148,11 @@ export const chatTheme: ChatTheme = {
base: 'my-4 flex flex-wrap gap-3',
source: {
base: [
'flex gap-2 border border-gray-200 p-2 rounded cursor-pointer',
'flex gap-2 border border-gray-200 px-4 py-2 rounded-lg cursor-pointer',
'dark:border-gray-700'
].join(' '),
image: 'w-6 h-6 rounded-md',
companion: 'flex-1 px-3 py-1.5',
image: 'max-w-10 max-h-10 rounded-md w-full h-fit self-center',
title: 'text-md block',
url: 'text-sm text-blue-400 underline'
}
Expand Down
Loading

0 comments on commit b48eb25

Please sign in to comment.