Skip to content

Commit 7cd3ad7

Browse files
author
André Luiz
authored
fix: improve logview UI (#1808)
* style: set max height and max width for code component This is made not only to stop the logviewer to overflow its height, which could be done by other means, but also to force the component to occupy a determined share of the screen * style: improve WrapperSheetContent component Such improvement was made by locking a maximun height value and the optimal value for clamp function How were these values set? Empirically; no specific technique has been used to set them. Closes #1429 * style: wrap elements on log viewer subtitle * style: allow log view to cover all space on smallest screen * style: stack footer buttons vertically below lg break Add flex-col/lg:flex-row so detailsButton and nav buttons stack on small screens and align side by side on lg+. * style: improve WrapperSheetContent footer responsiveness Restructure footer buttons for small screens: wrap nav buttons with grid-cols-1/lg:grid-cols-3, add vertical spacing (mt/mb) on mobile removed on lg+, and distribute items with justify-evenly on small screens and justify-end on lg+. * style: remove horizontal margin on certain breakpoints This was made as it was causing the middle button to shrink on smaller breakpoints
1 parent 7833866 commit 7cd3ad7

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

dashboard/src/components/Filter/CodeBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ const CodeBlock = ({
256256

257257
return (
258258
<>
259-
<div className="min-h-[300px]">
259+
<div className="min-h-[300px] w-full">
260260
<div className="pl-3">
261261
{variant === 'log-viewer' && (
262262
<h3 className="py-1 text-2xl font-bold">

dashboard/src/components/Log/LogViewerCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export const LogViewerCard = ({
123123

124124
return (
125125
<div className="gap-0">
126-
<div className="flex items-start justify-between p-4 text-lg">
126+
<div className="grid grid-cols-1 items-start justify-between p-4 text-lg md:grid-cols-2">
127127
{isLoading ? (
128128
<FormattedMessage id="global.loading" />
129129
) : (

dashboard/src/components/Sheet/WrapperSheetContent.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,21 @@ export const WrapperSheetContent = ({
9595

9696
<div
9797
className={cn(
98-
'mt-auto flex',
99-
detailsButton ? 'justify-between' : 'justify-end',
98+
'mt-auto flex flex-col lg:flex-row',
99+
detailsButton ? 'lg:justify-between' : 'lg:justify-end',
100100
)}
101101
>
102-
{detailsButton}
103-
<div className="flex">
104-
<div className="mt-auto flex justify-end">
102+
<div className="flex justify-around">{detailsButton}</div>
103+
<div className="flex flex-wrap justify-evenly lg:justify-end">
104+
<div className="mt-auto grid grid-cols-1 lg:grid-cols-3">
105105
{navigationLogsActions && (
106106
<>
107107
<Tooltip>
108108
<TooltipTrigger asChild>
109109
<Button
110110
onClick={navigationLogsActions.previousItem}
111111
disabled={!navigationLogsActions.hasPrevious}
112-
className="rounded-3xl bg-[#11B3E6] px-14 font-bold text-white"
112+
className="mt-4 mb-2 rounded-3xl bg-[#11B3E6] px-14 font-bold text-white lg:my-0"
113113
>
114114
<FormattedMessage
115115
id="global.prev"
@@ -124,7 +124,7 @@ export const WrapperSheetContent = ({
124124
<Button
125125
onClick={navigationLogsActions.nextItem}
126126
disabled={!navigationLogsActions.hasNext}
127-
className="mx-5 rounded-3xl bg-[#11B3E6] px-14 font-bold text-white"
127+
className="mx-0 my-2 rounded-3xl bg-[#11B3E6] px-14 font-bold text-white lg:mx-5 lg:my-0"
128128
>
129129
<FormattedMessage
130130
id="global.next"
@@ -136,12 +136,12 @@ export const WrapperSheetContent = ({
136136
</Tooltip>
137137
</>
138138
)}
139+
<SheetTrigger asChild>
140+
<Button className="mt-2 rounded-3xl bg-[#11B3E6] px-14 font-bold text-white lg:mt-0">
141+
<FormattedMessage id="global.close" defaultMessage="Close" />
142+
</Button>
143+
</SheetTrigger>
139144
</div>
140-
<SheetTrigger asChild>
141-
<Button className="rounded-3xl bg-[#11B3E6] px-14 font-bold text-white">
142-
<FormattedMessage id="global.close" defaultMessage="Close" />
143-
</Button>
144-
</SheetTrigger>
145145
</div>
146146
</div>
147147
</SheetContent>

dashboard/src/components/ui/sheet.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ const sheetVariants = cva(
3636
top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
3737
bottom:
3838
'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
39-
left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
39+
left: 'inset-y-0 left-0 h-full w-full border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
4040
right:
41-
'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right-[100%] data-[state=open]:slide-in-from-right-[100%] sm:max-w-sm',
41+
'inset-y-0 right-0 h-full w-full border-l data-[state=closed]:slide-out-to-right-[100%] data-[state=open]:slide-in-from-right-[100%] sm:max-w-sm',
4242
},
4343
},
4444
defaultVariants: {

0 commit comments

Comments
 (0)