Skip to content

Commit a21f432

Browse files
author
Sviatlana Marozka
committed
feat(chat): correct code formatting
1 parent 442c0d1 commit a21f432

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

apps/chat/src/components/Chat/MessageAttachment.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,12 @@ export const MessageAttachment = ({ attachment, isInner }: Props) => {
280280
<div
281281
data-no-context-menu
282282
className={classNames(
283-
'bg-layer-3 rounded px-1 py-2',
283+
'rounded bg-layer-3 px-1 py-2',
284284
isExpanded && 'col-span-1 col-start-1 sm:col-span-2 md:col-span-3',
285-
!isInner && 'border-secondary border',
286-
attachment.openFullScreen && isOpened && 'fixed inset-x-0 top-0 z-40 flex h-full flex-col',
285+
!isInner && 'border border-secondary',
286+
attachment.openFullScreen &&
287+
isOpened &&
288+
'fixed inset-x-0 top-0 z-40 flex h-full flex-col',
287289
)}
288290
>
289291
<div className="flex items-center gap-3 px-2">
@@ -304,7 +306,7 @@ export const MessageAttachment = ({ attachment, isInner }: Props) => {
304306
</a>
305307
</Tooltip>
306308
) : (
307-
<Icon size={18} className="text-secondary shrink-0" />
309+
<Icon size={18} className="shrink-0 text-secondary" />
308310
)}
309311
</div>
310312
<button
@@ -349,7 +351,7 @@ export const MessageAttachment = ({ attachment, isInner }: Props) => {
349351
height={18}
350352
width={18}
351353
className={classNames(
352-
'text-secondary shrink-0 transition',
354+
'shrink-0 text-secondary transition',
353355
isOpened && 'rotate-180',
354356
)}
355357
/>
@@ -373,8 +375,10 @@ export const MessageAttachment = ({ attachment, isInner }: Props) => {
373375
{isOpenable && isOpened && (
374376
<div
375377
className={classNames(
376-
'border-tertiary relative mt-2 w-full border-t p-3 pt-4 text-sm duration-200',
377-
attachment.openFullScreen ? 'grow overflow-auto' : 'h-auto overflow-hidden'
378+
'relative mt-2 w-full border-t border-tertiary p-3 pt-4 text-sm duration-200',
379+
attachment.openFullScreen
380+
? 'grow overflow-auto'
381+
: 'h-auto overflow-hidden',
378382
)}
379383
ref={anchorRef}
380384
>
@@ -392,7 +396,7 @@ export const MessageAttachment = ({ attachment, isInner }: Props) => {
392396
href={mappedAttachmentReferenceUrl}
393397
target="_blank"
394398
rel="noopener noreferrer"
395-
className="text-accent-primary mt-3 block"
399+
className="mt-3 block text-accent-primary"
396400
>
397401
{t('Reference...')}
398402
</a>

apps/chat/src/components/Plotly/Plotly.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ export const PlotlyComponent = memo(
2424
return;
2525
}
2626

27-
const containerHeight = containerRef.current.clientHeight;
28-
const layoutHeight = currentLayout.height && currentLayout.height > containerHeight ? currentLayout.height : containerHeight;
27+
const layoutHeight = Math.max(
28+
currentLayout.height ?? 0,
29+
containerRef.current.clientHeight,
30+
);
2931
setHeight(layoutHeight);
3032
setWidth(containerRef.current.scrollWidth);
31-
3233
}, []);
3334

3435
const handleRelayout = (newLayout: PlotRelayoutEvent) => {

0 commit comments

Comments
 (0)