Desktop poll improvements (#1638)

This commit is contained in:
Luke Vella 2025-03-25 11:06:43 +00:00 committed by GitHub
parent f075c98f6e
commit 1889cffa91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,6 +15,7 @@ import {
import * as React from "react";
import { RemoveScroll } from "react-remove-scroll";
import { useMeasure, useScroll } from "react-use";
import useClickAway from "react-use/lib/useClickAway";
import { TimesShownIn } from "@/components/clock";
import {
@ -129,6 +130,12 @@ const DesktopPoll: React.FunctionComponent = () => {
const { x } = useScroll(scrollRef);
const containerRef = React.useRef<HTMLDivElement>(null);
useClickAway(containerRef, () => {
collapse();
});
function TableControls() {
return (
<div className="flex items-center gap-4">
@ -240,11 +247,12 @@ const DesktopPoll: React.FunctionComponent = () => {
>
<div
className={cn(
"flex max-h-full max-w-7xl flex-col overflow-hidden rounded-md bg-white",
"flex max-h-full flex-col overflow-hidden rounded-md bg-white",
{
"shadow-huge": expanded,
"shadow-huge w-full max-w-7xl": expanded,
},
)}
ref={containerRef}
>
<CardHeader className="flex items-center justify-between gap-4">
<div className="flex items-center gap-x-2.5">