Skip to content

Commit

Permalink
tooltip for calculation source
Browse files Browse the repository at this point in the history
  • Loading branch information
LMacPhail committed Dec 12, 2023
1 parent cf3886f commit dd5d5d1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
16 changes: 15 additions & 1 deletion src/components/content/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ const faqs: { question: string; answer: JSX.Element }[] = [
</p>
),
},
{
question: ' How have you calculated "chance of winning"?',
answer: (
<p>
Our measure is based on the Electoral Calculus "chance of winning"
measure{" "}
<TextLink link="https://www.electoralcalculus.co.uk/fcgi-bin/calcwork23.py?seat=Glasgow+North+East">
(see an example here)
</TextLink>
. We have included all Labour MPs who hadn't been previously elected and
have more than an 80% chance of winning (data collected December 2023).
</p>
),
},
{
question: "How have you chosen the candidates?",
answer: (
Expand Down Expand Up @@ -174,7 +188,6 @@ const faqs: { question: string; answer: JSX.Element }[] = [
},
{
question: ' How have you calculated "chance of winning"?',

answer: (
<p>
Our measure is based on the Electoral Calculus "chance of winning"
Expand All @@ -192,6 +205,7 @@ const faqs: { question: string; answer: JSX.Element }[] = [
const About: React.FC = () => {
return (
<div className="max-w-[70rem] mx-auto pb-10">
<h2 className="h2">About The Project</h2>
<div className="flex flex-col gap-2">
<p>
MPs can be difficult to build relationships with and influence. They
Expand Down
13 changes: 9 additions & 4 deletions src/components/filters/Filters.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from "react";
import { useDispatch } from "react-redux";
import { SET_SORTBY_ACTION } from "../../state/actions";
import TextLink from "../atoms/Link";
import { Question } from "@phosphor-icons/react";

type SelectedSortDirection = "highest" | "lowest";

Expand All @@ -24,9 +24,14 @@ export const SortByDropdown: React.FC = () => {
<div>
<span className="text-xs">
Sort by chance of winning:{" "}
<TextLink link="https://www.electoralcalculus.co.uk/">
(source)
</TextLink>
<span
className="tooltip-click tooltip-right z-40"
data-tooltip="See FAQ"
>
<button>
<Question size={12} />
</button>
</span>
</span>
<select
className="select select-ghost-primary select-sm capitalize"
Expand Down

0 comments on commit dd5d5d1

Please sign in to comment.