Skip to content

Commit

Permalink
feat(chat): improve styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Mati365 committed Feb 22, 2025
1 parent 5c37ef8 commit 976e542
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type Props = {
readOnly?: boolean;
archived?: boolean;
showToolbars?: boolean;
showAvatar?: boolean;
onRefreshResponse?: (message: Omit<SdkRepeatedMessageItemT, 'content'>) => void;
onReply?: (message: SdkRepeatedMessageItemT) => void;
onAction?: (action: string) => void;
Expand All @@ -55,6 +56,7 @@ export function ChatMessage(
actionsToolbar,
isLast,
readOnly,
showAvatar = true,
showToolbars = true,
onRefreshResponse,
onReply,
Expand Down Expand Up @@ -99,7 +101,7 @@ export function ChatMessage(
className,
)}
>
{(!isYou || isAI) && (
{showAvatar && (!isYou || isAI) && (
<div
className={clsx(
'flex flex-shrink-0 justify-center items-center border rounded-full w-8 h-8',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export function PinnedMessageCard({ pinnedMessage }: Props) {
className="mx-auto mb-0 max-w-[750px]"
message={{ ...message, repeats: [] }}
showToolbars={false}
showAvatar={false}
showAnim={false}
actionsToolbar={(
<ToolbarSmallActionButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,23 @@ export function PinnedMessagesContainer({ storeDataInUrl = false }: Props) {

return (
<section>
<PaginationToolbar className="mb-6">
<PaginationSearchToolbarItem
{...pagination.bind.path('phrase', {
relatedInputs: ({ newGlobalValue, newControlValue }) => ({
...newGlobalValue,
sort: newControlValue ? 'score:desc' : 'createdAt:asc',
}),
})}
/>
<PaginationToolbar
className="mb-6"
suffix={(
<>
<PaginationSearchToolbarItem
{...pagination.bind.path('phrase', {
relatedInputs: ({ newGlobalValue, newControlValue }) => ({
...newGlobalValue,
sort: newControlValue ? 'score:desc' : 'createdAt:asc',
}),
})}
/>

<ResetFiltersButton onClick={reset} />
</PaginationToolbar>
<ResetFiltersButton onClick={reset} />
</>
)}
/>

<PaginatedList
result={mappedResult}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ export function PinnedMessagesTimeline({ items }: TimelineProps) {
const isEven = index % 2 === 0;

return (
<div key={item.id} className="relative" style={{ marginTop: index === 0 ? '2rem' : '-4rem' }}>
<div
key={item.id}
className="relative"
style={{
marginTop: index === 0 ? '2rem' : '-4rem',
zIndex: items.length - index + 1,
}}
>
<div className="top-[29px] left-1/2 z-10 absolute bg-white border-2 border-gray-300 rounded-full w-3 h-3 -translate-x-1/2" />

<div className="top-[29px] left-1/2 absolute -translate-x-1/2 -translate-y-12">
Expand Down

0 comments on commit 976e542

Please sign in to comment.