Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

💄 Move score summary to table header

Luke Vella0e2704506fe9
diff --git a/apps/web/src/components/poll/desktop-poll.tsx b/apps/web/src/components/poll/desktop-poll.tsx
index a8b2fb493..411f94d92 100644
--- a/apps/web/src/components/poll/desktop-poll.tsx
+++ b/apps/web/src/components/poll/desktop-poll.tsx
@@ -25,9 +25,7 @@ import {
} from "@/app/components/empty-state";
import { useTranslation } from "@/app/i18n/client";
import { TimesShownIn } from "@/components/clock";
-import { ConnectedScoreSummary } from "@/components/poll/score-summary";
import { useVotingForm } from "@/components/poll/voting-form";
-import { IfScoresVisible } from "@/components/visibility";
import { usePermissions } from "@/contexts/permissions";
import { usePoll } from "@/contexts/poll";
@@ -306,26 +304,6 @@ const DesktopPoll: React.FunctionComponent = () => {
})
: null}
</tbody>
- <IfScoresVisible>
- <tfoot>
- <tr>
- <th className="sticky bottom-0 left-0 z-20 h-12 bg-white"></th>
- {poll.options.map((option) => {
- return (
- <th
- className="sticky bottom-0 border-l border-t bg-gray-50 p-2"
- key={option.id}
- >
- <div className="flex justify-center">
- <ConnectedScoreSummary optionId={option.id} />
- </div>
- </th>
- );
- })}
- <th className="bg-diagonal-lines -ml-4 w-full min-w-4 border-l"></th>
- </tr>
- </tfoot>
- </IfScoresVisible>
</table>
</RemoveScroll>
</div>
diff --git a/apps/web/src/components/poll/desktop-poll/poll-header.tsx b/apps/web/src/components/poll/desktop-poll/poll-header.tsx
index 613f35f78..231062973 100644
--- a/apps/web/src/components/poll/desktop-poll/poll-header.tsx
+++ b/apps/web/src/components/poll/desktop-poll/poll-header.tsx
@@ -9,6 +9,7 @@ import {
import { ClockIcon } from "lucide-react";
import * as React from "react";
+import { ConnectedScoreSummary } from "@/components/poll/score-summary";
import { useOptions } from "@/components/poll-context";
import { Trans } from "@/components/trans";
@@ -141,7 +142,7 @@ const PollHeader: React.FunctionComponent = () => {
style={{ minWidth: 80, maxWidth: 90, top: scoreRowTop }}
className="sticky z-20 border-l bg-gray-50 pb-2.5 align-top"
>
- <div className="flex flex-col items-center gap-2.5">
+ <div className="flex flex-col items-center gap-3">
{option.type === "timeSlot" ? (
<TimeRange
start={option.startTime}
@@ -153,6 +154,7 @@ const PollHeader: React.FunctionComponent = () => {
<Trans i18nKey="allDay" defaults="All-Day" />
</p>
)}
+ <ConnectedScoreSummary optionId={option.optionId} />
</div>
</th>
);