Skip to content

Commit 4590b1a

Browse files
author
André Luiz
authored
Improve filters layout on smaller screens (#1837)
* fix(style): prevent drawer content from overflowing on small screens Change w-fit to w-full so the filter container respects the viewport width instead of expanding to its natural content width. * style: adress the linter concern The linter politely pointed out that `file?.['name']` is more concise than `file && file['name']` Closes #1419 * fix: remove checkbox and text misalignment Closes #1419
1 parent 1e925d5 commit 4590b1a

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

dashboard/src/components/Checkbox/Checkbox.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,21 @@ const Checkbox = ({
4545
'border-blue': isChecked,
4646
})}
4747
>
48-
<input type="checkbox" checked={isChecked} onChange={onToggle} />
48+
<input
49+
className="mr-4"
50+
type="checkbox"
51+
checked={isChecked}
52+
onChange={onToggle}
53+
/>
4954
{shouldTruncateResult ? (
5055
<Tooltip>
5156
<TooltipTrigger asChild>
52-
<span className="ml-4">{truncatedText}</span>
57+
<span>{truncatedText}</span>
5358
</TooltipTrigger>
5459
<TooltipContent>{text}</TooltipContent>
5560
</Tooltip>
5661
) : (
57-
<span className="ml-4">{truncatedText}</span>
62+
<span>{truncatedText}</span>
5863
)}
5964
</label>
6065
);

dashboard/src/components/Filter/Drawer.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const DrawerHeader = (): JSX.Element => {
4040
return (
4141
<header className="mb-7 w-full">
4242
<DrawerTitle>
43-
<div className="mx-auto mb-4 flex w-[1400px] items-center justify-between">
43+
<div className="mx-auto mb-4 flex max-w-[1400px] items-center justify-between">
4444
<span className="text-2xl/[42px] font-bold">
4545
<FormattedMessage id="filter.filtering" />
4646
</span>
@@ -58,12 +58,12 @@ const DrawerHeader = (): JSX.Element => {
5858
const DrawerLink = ({ title, value, url }: IDrawerLink): JSX.Element => {
5959
return (
6060
<div className="mb-8 flex items-center justify-between">
61-
<div className="border-dark-gray flex h-[52px] w-full flex-col border bg-white px-4 py-2">
61+
<div className="border-dark-gray flex min-h-[52px] max-w-full flex-col border bg-white px-4 py-2">
6262
<span className="text-dark-gray2 text-xs">
6363
<FormattedMessage id={title} />
6464
</span>
6565
<a
66-
className="text-dim-black text-base underline"
66+
className="text-dim-black text-base break-all underline"
6767
href={url ?? '#'}
6868
target={url ? '_blank' : undefined}
6969
rel="noreferrer"
@@ -168,7 +168,7 @@ const Drawer = ({
168168
<DrawerHeader />
169169
<section className="h-full overflow-y-auto">
170170
{drawerLinkComponent}
171-
<div className="w-[1000px] rounded-lg bg-white px-6 py-5">
171+
<div className="w-auto rounded-lg bg-white px-6 py-5">
172172
{showLegend && <Legend />}
173173
<div>{children}</div>
174174
</div>

dashboard/src/hooks/useLogData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const processLogData = (
5656
: undefined;
5757

5858
const logExcerptFileLink = data?.output_files?.find(
59-
file => file && file['name'] === 'log_excerpt',
59+
file => file?.['name'] === 'log_excerpt',
6060
)?.['url'];
6161

6262
return {

0 commit comments

Comments
 (0)