Skip to content

Commit

Permalink
Adds option to wrap messages in settings dropdown (#11)
Browse files Browse the repository at this point in the history
Implements #7
  • Loading branch information
amorey committed Feb 20, 2024
1 parent 939f699 commit 4480224
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion frontend/src/pages/console.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ const SettingsButton = (props: SettingsButtonProps) => {
['arch', false],
['node', false],
]));
const [wrap, setWrap] = useState(false);

const handleOnChange = (key: string, ev: React.ChangeEvent<HTMLInputElement>) => {
checkedCols.set(key, ev.target.checked);
Expand Down Expand Up @@ -527,6 +528,11 @@ const SettingsButton = (props: SettingsButtonProps) => {
);
}
})}
{wrap && (
<Fragment>
{`.col_message { white-space: normal !important; }`}
</Fragment>
)}
</style>
);

Expand All @@ -538,11 +544,18 @@ const SettingsButton = (props: SettingsButtonProps) => {
<SettingsIcon className={cn(props.className)} size={18} strokeWidth={1.5} />
</PopoverTrigger>
<PopoverContent
className="bg-white w-auto mr-1"
className="bg-white w-auto mr-1 text-sm"
onOpenAutoFocus={(ev) => ev.preventDefault()}
sideOffset={-1}
>
<div className="border-b mb-1">Columns:</div>
{checkboxEls}
<div className="border-b mt-2 mb-1">Options:</div>
<Form.Check
label="Wrap"
checked={wrap}
onChange={() => setWrap(!wrap)}
/>
</PopoverContent>
</Popover>
</>
Expand Down

0 comments on commit 4480224

Please sign in to comment.