Skip to content

Commit

Permalink
style improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
amcdnl committed Aug 1, 2024
1 parent 203f2f7 commit 88100d3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
4 changes: 3 additions & 1 deletion src/SessionMessages/SessionMessage/SessionMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ export const SessionMessage: FC<SessionMessageProps> = ({
</>
)}
</Card>
<Divider />
{!isLast && (
<Divider />
)}
</motion.div>
);
};
2 changes: 1 addition & 1 deletion src/SessionsList/NewSessionButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, cn, Divider } from 'reablocks';
import { Button, cn } from 'reablocks';
import { FC, PropsWithChildren, ReactNode, useContext } from 'react';
import { ChatContext } from '@/ChatContext';
import { Slot } from '@radix-ui/react-slot';
Expand Down
9 changes: 1 addition & 8 deletions src/SessionsList/SessionsGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
import { FC, PropsWithChildren, ReactNode, useContext } from 'react';
import { ChatContext } from '@/ChatContext';
import { Divider, ListItem, cn } from 'reablocks';
import { ListItem, cn } from 'reablocks';

interface SessionsGroupProps extends PropsWithChildren {
/**
* Heading for the session group.
*/
heading?: string | ReactNode;

/**
* Divider to render between the children.
*/
divider?: ReactNode;
}

export const SessionsGroup: FC<SessionsGroupProps> = ({
heading,
children,
divider = <Divider variant="secondary" />
}) => {
const { theme } = useContext(ChatContext);
return (
Expand All @@ -32,7 +26,6 @@ export const SessionsGroup: FC<SessionsGroupProps> = ({
</ListItem>
)}
{children}
{divider}
</>
);
};
2 changes: 1 addition & 1 deletion src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const chatTheme: ChatTheme = {
companion: 'w-full h-full',
group: 'text-xs text-gray-400 mt-4 hover:bg-transparent mb-1',
create:
'relative mb-4 rounded-[10px] after:-bottom-5 after:w-full after:absolute after:h-px after:content[""] after:bg-gradient-to-r after:from-transparent after:to-transparent after:via-blue-500',
'relative mb-4 rounded-[10px]',
session: {
base: 'my-1 rounded-[10px] p-2 text-typography hover:bg-gray-800/50 border border-transparent hover:border-gray-700/50',
active:
Expand Down
3 changes: 1 addition & 2 deletions stories/Console.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import { MessageFiles } from '@/SessionMessages';
import { MessageQuestion } from '@/SessionMessages';
import { MessageResponse } from '@/SessionMessages';
import { MessageSources } from '@/SessionMessages';
import ChatIcon from '@/assets/chat.svg?react';
import {
fakeSessions,
fakeSessionsWithEmbeds,
Expand Down Expand Up @@ -1184,7 +1183,7 @@ export const CustomComponents = () => {
<NewSessionButton>
<button className="text-blue-500">New Session</button>
</NewSessionButton>
<Divider />
<Divider variant="secondary" />
<SessionGroups>
{groups =>
groups.map(({ heading, sessions }) => (
Expand Down

0 comments on commit 88100d3

Please sign in to comment.