First public commit

This commit is contained in:
Luke Vella 2022-04-12 07:14:28 +01:00
commit e05cd62e53
228 changed files with 17717 additions and 0 deletions

12
components/use-poll.ts Normal file
View file

@ -0,0 +1,12 @@
import { GetPollResponse } from "api-client/get-poll";
import React from "react";
export const PollContext = React.createContext<GetPollResponse | null>(null);
export const usePoll = () => {
const context = React.useContext(PollContext);
if (!context) {
throw new Error("Tried to get poll from context but got undefined");
}
return context;
};