Skip to content

Commit

Permalink
move divider to theme style
Browse files Browse the repository at this point in the history
  • Loading branch information
SerhiiTsybulskyi committed Aug 1, 2024
1 parent c9c30e1 commit 92d2986
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 1 addition & 8 deletions src/SessionsList/NewSessionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,11 @@ interface NewSessionButtonProps extends PropsWithChildren {
* Text for the new session button.
*/
newSessionText?: string | ReactNode;

/**
* Divider to render between the new session button and SessionsGroup.
*/
divider?: ReactNode;
}

export const NewSessionButton: FC<NewSessionButtonProps> = ({
children,
newSessionText = 'New Session',
divider = <Divider variant="secondary" />
newSessionText = 'New Session'
}) => {
const { theme, createSession, disabled } = useContext(ChatContext);
const Comp = children ? Slot : Button;
Expand All @@ -38,7 +32,6 @@ export const NewSessionButton: FC<NewSessionButtonProps> = ({
>
{children || newSessionText}
</Comp>
{divider}
</>
);
};
3 changes: 2 additions & 1 deletion src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ export const chatTheme: ChatTheme = {
console: 'min-w-[150px] w-[30%] max-w-[300px] bg-[#11111F] p-5 rounded-3xl',
companion: 'w-full h-full',
group: 'text-xs text-gray-400 mt-4 hover:bg-transparent mb-1',
create: 'mb-4 rounded-[10px]',
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',
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

0 comments on commit 92d2986

Please sign in to comment.