mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-06 01:48:32 +02:00
✨ Desktop poll improvements (#1638)
This commit is contained in:
parent
f075c98f6e
commit
1889cffa91
1 changed files with 10 additions and 2 deletions
|
@ -15,6 +15,7 @@ import {
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { RemoveScroll } from "react-remove-scroll";
|
import { RemoveScroll } from "react-remove-scroll";
|
||||||
import { useMeasure, useScroll } from "react-use";
|
import { useMeasure, useScroll } from "react-use";
|
||||||
|
import useClickAway from "react-use/lib/useClickAway";
|
||||||
|
|
||||||
import { TimesShownIn } from "@/components/clock";
|
import { TimesShownIn } from "@/components/clock";
|
||||||
import {
|
import {
|
||||||
|
@ -129,6 +130,12 @@ const DesktopPoll: React.FunctionComponent = () => {
|
||||||
|
|
||||||
const { x } = useScroll(scrollRef);
|
const { x } = useScroll(scrollRef);
|
||||||
|
|
||||||
|
const containerRef = React.useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
|
useClickAway(containerRef, () => {
|
||||||
|
collapse();
|
||||||
|
});
|
||||||
|
|
||||||
function TableControls() {
|
function TableControls() {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
|
@ -240,11 +247,12 @@ const DesktopPoll: React.FunctionComponent = () => {
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={cn(
|
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">
|
<CardHeader className="flex items-center justify-between gap-4">
|
||||||
<div className="flex items-center gap-x-2.5">
|
<div className="flex items-center gap-x-2.5">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue