mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-10 23:46:49 +02:00
Add eslint import rules
This commit is contained in:
parent
6717b3ca48
commit
c5c2816c3d
49 changed files with 139 additions and 79 deletions
|
@ -1,3 +1,11 @@
|
||||||
{
|
{
|
||||||
"extends": "next/core-web-vitals"
|
"extends": "next/core-web-vitals",
|
||||||
|
"plugins": ["simple-import-sort"],
|
||||||
|
"rules": {
|
||||||
|
"simple-import-sort/imports": "error",
|
||||||
|
"simple-import-sort/exports": "error",
|
||||||
|
"import/first": "error",
|
||||||
|
"import/newline-after-import": "error",
|
||||||
|
"import/no-duplicates": "error"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import ReactDOM from "react-dom";
|
import ReactDOM from "react-dom";
|
||||||
|
|
||||||
import Modal, { ModalProps } from "./modal/modal";
|
import Modal, { ModalProps } from "./modal/modal";
|
||||||
|
|
||||||
export const confirmPrompt = (props: ModalProps) => {
|
export const confirmPrompt = (props: ModalProps) => {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import Link from "next/link";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import ReactDOM from "react-dom";
|
import ReactDOM from "react-dom";
|
||||||
import { getPortal } from "utils/selectors";
|
import { getPortal } from "utils/selectors";
|
||||||
|
|
||||||
import CookiesIllustration from "./cookie-consent/cookies.svg";
|
import CookiesIllustration from "./cookie-consent/cookies.svg";
|
||||||
|
|
||||||
const CookieConsentPopover: React.VoidFunctionComponent = () => {
|
const CookieConsentPopover: React.VoidFunctionComponent = () => {
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import Button from "./button";
|
|
||||||
import Chat from "@/components/icons/chat.svg";
|
import Chat from "@/components/icons/chat.svg";
|
||||||
|
|
||||||
|
import Button from "./button";
|
||||||
|
|
||||||
const crispWebsiteId = process.env.NEXT_PUBLIC_CRISP_WEBSITE_ID;
|
const crispWebsiteId = process.env.NEXT_PUBLIC_CRISP_WEBSITE_ID;
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import * as React from "react";
|
||||||
import { Controller, useForm } from "react-hook-form";
|
import { Controller, useForm } from "react-hook-form";
|
||||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||||
import { useList } from "react-use";
|
import { useList } from "react-use";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
createComment,
|
createComment,
|
||||||
CreateCommentPayload,
|
CreateCommentPayload,
|
||||||
|
|
|
@ -4,6 +4,7 @@ import clsx from "clsx";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import ReactDOM from "react-dom";
|
import ReactDOM from "react-dom";
|
||||||
import { usePopper } from "react-popper";
|
import { usePopper } from "react-popper";
|
||||||
|
|
||||||
export interface DropdownProps {
|
export interface DropdownProps {
|
||||||
trigger?: React.ReactNode;
|
trigger?: React.ReactNode;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import StandardLayout from "./standard-layout";
|
|
||||||
import Button from "@/components/button";
|
import Button from "@/components/button";
|
||||||
import Chat from "@/components/icons/chat.svg";
|
import Chat from "@/components/icons/chat.svg";
|
||||||
import EmojiSad from "@/components/icons/emoji-sad.svg";
|
import EmojiSad from "@/components/icons/emoji-sad.svg";
|
||||||
|
|
||||||
import { showCrispChat } from "./crisp-chat";
|
import { showCrispChat } from "./crisp-chat";
|
||||||
|
import StandardLayout from "./standard-layout";
|
||||||
|
|
||||||
export interface ComponentProps {
|
export interface ComponentProps {
|
||||||
icon?: React.ComponentType<{ className?: string }>;
|
icon?: React.ComponentType<{ className?: string }>;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { addMinutes, setHours } from "date-fns/esm";
|
||||||
import isSameDay from "date-fns/isSameDay";
|
import isSameDay from "date-fns/isSameDay";
|
||||||
import { usePlausible } from "next-plausible";
|
import { usePlausible } from "next-plausible";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { DateTimeOption } from "..";
|
|
||||||
import {
|
import {
|
||||||
expectTimeOption,
|
expectTimeOption,
|
||||||
getDateProps,
|
getDateProps,
|
||||||
|
@ -24,6 +24,7 @@ import PlusSm from "../../../icons/plus-sm.svg";
|
||||||
import Trash from "../../../icons/trash.svg";
|
import Trash from "../../../icons/trash.svg";
|
||||||
import X from "../../../icons/x.svg";
|
import X from "../../../icons/x.svg";
|
||||||
import Switch from "../../../switch";
|
import Switch from "../../../switch";
|
||||||
|
import { DateTimeOption } from "..";
|
||||||
import { DateTimePickerProps } from "../types";
|
import { DateTimePickerProps } from "../types";
|
||||||
import { formatDateWithoutTime, formatDateWithoutTz } from "../utils";
|
import { formatDateWithoutTime, formatDateWithoutTz } from "../utils";
|
||||||
import TimePicker from "./time-picker";
|
import TimePicker from "./time-picker";
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import PageLayout from "./page-layout";
|
|
||||||
import Bonus from "./home/bonus";
|
import Bonus from "./home/bonus";
|
||||||
import Features from "./home/features";
|
import Features from "./home/features";
|
||||||
import Hero from "./home/hero";
|
import Hero from "./home/hero";
|
||||||
|
import PageLayout from "./page-layout";
|
||||||
|
|
||||||
const Home: React.VoidFunctionComponent = () => {
|
const Home: React.VoidFunctionComponent = () => {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import Ban from "./ban-ads.svg";
|
|
||||||
import Code from "@/components/icons/code.svg";
|
import Code from "@/components/icons/code.svg";
|
||||||
import Server from "@/components/icons/server.svg";
|
|
||||||
import CursorClick from "@/components/icons/cursor-click.svg";
|
import CursorClick from "@/components/icons/cursor-click.svg";
|
||||||
|
import Server from "@/components/icons/server.svg";
|
||||||
|
|
||||||
|
import Ban from "./ban-ads.svg";
|
||||||
|
|
||||||
const Bonus: React.VoidFunctionComponent = () => {
|
const Bonus: React.VoidFunctionComponent = () => {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import Bell from "@/components/icons/bell.svg";
|
import Bell from "@/components/icons/bell.svg";
|
||||||
import Chat from "@/components/icons/chat.svg";
|
import Chat from "@/components/icons/chat.svg";
|
||||||
import Clock from "@/components/icons/clock.svg";
|
import Clock from "@/components/icons/clock.svg";
|
||||||
import DeviceMobile from "@/components/icons/device-mobile.svg";
|
import DeviceMobile from "@/components/icons/device-mobile.svg";
|
||||||
import * as React from "react";
|
|
||||||
|
|
||||||
const Features: React.VoidFunctionComponent = () => {
|
const Features: React.VoidFunctionComponent = () => {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
import { useTranslation } from "next-i18next";
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { useTranslation } from "next-i18next";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { UserAvatarProvider } from "../poll/user-avatar";
|
import { UserAvatarProvider } from "../poll/user-avatar";
|
||||||
import PollDemo from "./poll-demo";
|
import PollDemo from "./poll-demo";
|
||||||
import ScribbleArrow from "./scribble-arrow.svg";
|
import ScribbleArrow from "./scribble-arrow.svg";
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { format } from "date-fns";
|
||||||
import { useTranslation } from "next-i18next";
|
import { useTranslation } from "next-i18next";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { useTimeoutFn } from "react-use";
|
import { useTimeoutFn } from "react-use";
|
||||||
|
|
||||||
import DateCard from "../date-card";
|
import DateCard from "../date-card";
|
||||||
import Score from "../poll/score";
|
import Score from "../poll/score";
|
||||||
import UserAvater from "../poll/user-avatar";
|
import UserAvater from "../poll/user-avatar";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import * as React from "react";
|
|
||||||
import { useTranslation } from "next-i18next";
|
import { useTranslation } from "next-i18next";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
const Stats: React.VoidFunctionComponent = () => {
|
const Stats: React.VoidFunctionComponent = () => {
|
||||||
const { t } = useTranslation("homepage");
|
const { t } = useTranslation("homepage");
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { useList } from "react-use";
|
import { useList } from "react-use";
|
||||||
|
|
||||||
import { useRequiredContext } from "../use-required-context";
|
import { useRequiredContext } from "../use-required-context";
|
||||||
import Modal, { ModalProps } from "./modal";
|
import Modal, { ModalProps } from "./modal";
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
import Link from "next/link";
|
|
||||||
import * as React from "react";
|
|
||||||
import Github from "./home/github.svg";
|
|
||||||
import Logo from "../public/logo.svg";
|
|
||||||
import Footer from "./page-layout/footer";
|
|
||||||
import Head from "next/head";
|
|
||||||
import { useRouter } from "next/router";
|
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import DotsVertical from "@/components/icons/dots-vertical.svg";
|
|
||||||
import dynamic from "next/dynamic";
|
import dynamic from "next/dynamic";
|
||||||
|
import Head from "next/head";
|
||||||
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import * as React from "react";
|
||||||
import { createBreakpoint } from "react-use";
|
import { createBreakpoint } from "react-use";
|
||||||
|
|
||||||
|
import DotsVertical from "@/components/icons/dots-vertical.svg";
|
||||||
|
|
||||||
|
import Logo from "../public/logo.svg";
|
||||||
|
import Github from "./home/github.svg";
|
||||||
|
import Footer from "./page-layout/footer";
|
||||||
|
|
||||||
const Popover = dynamic(() => import("./popover"), { ssr: false });
|
const Popover = dynamic(() => import("./popover"), { ssr: false });
|
||||||
export interface PageLayoutProps {
|
export interface PageLayoutProps {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { Trans, useTranslation } from "next-i18next";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import GitHubButton from "react-github-btn";
|
import GitHubButton from "react-github-btn";
|
||||||
import { Trans, useTranslation } from "next-i18next";
|
|
||||||
import Logo from "../../public/logo.svg";
|
import Logo from "../../public/logo.svg";
|
||||||
import Vercel from "../../public/vercel-logotype-dark.svg";
|
import Vercel from "../../public/vercel-logotype-dark.svg";
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import Speakerphone from "@/components/icons/speakerphone.svg";
|
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
|
import Speakerphone from "@/components/icons/speakerphone.svg";
|
||||||
|
|
||||||
const cookieName = "legacy-poll-notice";
|
const cookieName = "legacy-poll-notice";
|
||||||
|
|
||||||
const LegacyPollNotice: React.VoidFunctionComponent<{ show?: boolean }> = ({
|
const LegacyPollNotice: React.VoidFunctionComponent<{ show?: boolean }> = ({
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
import { Placement } from "@popperjs/core";
|
||||||
|
import { format } from "date-fns";
|
||||||
|
import { Trans,useTranslation } from "next-i18next";
|
||||||
|
import * as React from "react";
|
||||||
|
import { decodeDateOption, encodeDateOption } from "utils/date-time-utils";
|
||||||
|
|
||||||
import Button from "@/components/button";
|
import Button from "@/components/button";
|
||||||
import Cog from "@/components/icons/cog.svg";
|
import Cog from "@/components/icons/cog.svg";
|
||||||
import LockClosed from "@/components/icons/lock-closed.svg";
|
import LockClosed from "@/components/icons/lock-closed.svg";
|
||||||
|
@ -5,18 +11,13 @@ import LockOpen from "@/components/icons/lock-open.svg";
|
||||||
import Pencil from "@/components/icons/pencil-alt.svg";
|
import Pencil from "@/components/icons/pencil-alt.svg";
|
||||||
import Save from "@/components/icons/save.svg";
|
import Save from "@/components/icons/save.svg";
|
||||||
import Table from "@/components/icons/table.svg";
|
import Table from "@/components/icons/table.svg";
|
||||||
import { Placement } from "@popperjs/core";
|
|
||||||
import { format } from "date-fns";
|
|
||||||
import { useTranslation } from "next-i18next";
|
|
||||||
import * as React from "react";
|
|
||||||
import { decodeDateOption, encodeDateOption } from "utils/date-time-utils";
|
|
||||||
import Dropdown, { DropdownItem } from "../dropdown";
|
import Dropdown, { DropdownItem } from "../dropdown";
|
||||||
import { PollDetailsForm } from "../forms";
|
import { PollDetailsForm } from "../forms";
|
||||||
import { useModal } from "../modal";
|
import { useModal } from "../modal";
|
||||||
import { useModalContext } from "../modal/modal-provider";
|
import { useModalContext } from "../modal/modal-provider";
|
||||||
import { usePoll } from "../use-poll";
|
import { usePoll } from "../use-poll";
|
||||||
import { useUpdatePollMutation } from "./mutations";
|
import { useUpdatePollMutation } from "./mutations";
|
||||||
import { Trans } from "next-i18next";
|
|
||||||
|
|
||||||
const PollOptionsForm = React.lazy(() => import("../forms/poll-options-form"));
|
const PollOptionsForm = React.lazy(() => import("../forms/poll-options-form"));
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
import { usePoll } from "@/components/use-poll";
|
|
||||||
import { Listbox } from "@headlessui/react";
|
import { Listbox } from "@headlessui/react";
|
||||||
import { Participant, Vote } from "@prisma/client";
|
import { Participant, Vote } from "@prisma/client";
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import { useTranslation } from "next-i18next";
|
import { useTranslation } from "next-i18next";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Controller, useForm } from "react-hook-form";
|
import { Controller, useForm } from "react-hook-form";
|
||||||
|
|
||||||
|
import { usePoll } from "@/components/use-poll";
|
||||||
|
|
||||||
import { decodeDateOption } from "../../../utils/date-time-utils";
|
import { decodeDateOption } from "../../../utils/date-time-utils";
|
||||||
import { requiredString } from "../../../utils/form-validation";
|
import { requiredString } from "../../../utils/form-validation";
|
||||||
import Button from "../../button";
|
import Button from "../../button";
|
||||||
import DateCard from "../../date-card";
|
import DateCard from "../../date-card";
|
||||||
|
import CheckCircle from "../../icons/check-circle.svg";
|
||||||
import ChevronDown from "../../icons/chevron-down.svg";
|
import ChevronDown from "../../icons/chevron-down.svg";
|
||||||
import Pencil from "../../icons/pencil.svg";
|
import Pencil from "../../icons/pencil.svg";
|
||||||
import PlusCircle from "../../icons/plus-circle.svg";
|
import PlusCircle from "../../icons/plus-circle.svg";
|
||||||
import CheckCircle from "../../icons/check-circle.svg";
|
|
||||||
import Trash from "../../icons/trash.svg";
|
import Trash from "../../icons/trash.svg";
|
||||||
import { styleMenuItem } from "../../menu-styles";
|
import { styleMenuItem } from "../../menu-styles";
|
||||||
import NameInput from "../../name-input";
|
import NameInput from "../../name-input";
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { updatePoll, UpdatePollPayload } from "api-client/update-poll";
|
import { updatePoll, UpdatePollPayload } from "api-client/update-poll";
|
||||||
import { usePlausible } from "next-plausible";
|
import { usePlausible } from "next-plausible";
|
||||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||||
|
|
||||||
import { addParticipant } from "../../api-client/add-participant";
|
import { addParticipant } from "../../api-client/add-participant";
|
||||||
import {
|
import {
|
||||||
deleteParticipant,
|
deleteParticipant,
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
import * as React from "react";
|
|
||||||
import Tooltip from "../tooltip";
|
|
||||||
import { usePoll } from "../use-poll";
|
|
||||||
import { Trans, useTranslation } from "next-i18next";
|
import { Trans, useTranslation } from "next-i18next";
|
||||||
|
import { usePlausible } from "next-plausible";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import Button from "@/components/button";
|
import Button from "@/components/button";
|
||||||
import Bell from "@/components/icons/bell.svg";
|
import Bell from "@/components/icons/bell.svg";
|
||||||
import BellCrossed from "@/components/icons/bell-crossed.svg";
|
import BellCrossed from "@/components/icons/bell-crossed.svg";
|
||||||
|
|
||||||
|
import Tooltip from "../tooltip";
|
||||||
|
import { usePoll } from "../use-poll";
|
||||||
import { useUpdatePollMutation } from "./mutations";
|
import { useUpdatePollMutation } from "./mutations";
|
||||||
import { usePlausible } from "next-plausible";
|
|
||||||
|
|
||||||
export interface NotificationsToggleProps {}
|
export interface NotificationsToggleProps {}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
import { formatRelative } from "date-fns";
|
|
||||||
import * as React from "react";
|
|
||||||
import { Trans, useTranslation } from "next-i18next";
|
|
||||||
import Button from "../button";
|
|
||||||
import { usePoll } from "../use-poll";
|
|
||||||
import Popover from "../popover";
|
|
||||||
import { useMutation } from "react-query";
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { formatRelative } from "date-fns";
|
||||||
|
import { Trans, useTranslation } from "next-i18next";
|
||||||
|
import * as React from "react";
|
||||||
|
import { useMutation } from "react-query";
|
||||||
|
|
||||||
|
import Button from "../button";
|
||||||
|
import Popover from "../popover";
|
||||||
|
import { usePoll } from "../use-poll";
|
||||||
|
|
||||||
export interface PollSubheaderProps {}
|
export interface PollSubheaderProps {}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@ import debounce from "lodash/debounce";
|
||||||
import { useTranslation } from "next-i18next";
|
import { useTranslation } from "next-i18next";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { useMeasure } from "react-use";
|
import { useMeasure } from "react-use";
|
||||||
|
import smoothscroll from "smoothscroll-polyfill";
|
||||||
|
|
||||||
import { decodeDateOption } from "../../utils/date-time-utils";
|
import { decodeDateOption } from "../../utils/date-time-utils";
|
||||||
import Button from "../button";
|
import Button from "../button";
|
||||||
import DateCard from "../date-card";
|
import DateCard from "../date-card";
|
||||||
|
@ -11,6 +13,7 @@ import ArrowRight from "../icons/arrow-right.svg";
|
||||||
import PlusCircle from "../icons/plus-circle.svg";
|
import PlusCircle from "../icons/plus-circle.svg";
|
||||||
import TimeZonePicker from "../time-zone-picker";
|
import TimeZonePicker from "../time-zone-picker";
|
||||||
import { TransitionPopInOut } from "../transitions";
|
import { TransitionPopInOut } from "../transitions";
|
||||||
|
import { usePoll } from "../use-poll";
|
||||||
import { useAddParticipantMutation } from "./mutations";
|
import { useAddParticipantMutation } from "./mutations";
|
||||||
import ParticipantRow from "./participant-row";
|
import ParticipantRow from "./participant-row";
|
||||||
import ParticipantRowForm from "./participant-row-form";
|
import ParticipantRowForm from "./participant-row-form";
|
||||||
|
@ -18,8 +21,6 @@ import { PollContext, usePollContext } from "./poll-context";
|
||||||
import Score from "./score";
|
import Score from "./score";
|
||||||
import TimeRange from "./time-range";
|
import TimeRange from "./time-range";
|
||||||
import { PollProps } from "./types";
|
import { PollProps } from "./types";
|
||||||
import smoothscroll from "smoothscroll-polyfill";
|
|
||||||
import { usePoll } from "../use-poll";
|
|
||||||
|
|
||||||
if (typeof window !== "undefined") {
|
if (typeof window !== "undefined") {
|
||||||
smoothscroll.polyfill();
|
smoothscroll.polyfill();
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import ReactLinkify from "react-linkify";
|
import ReactLinkify from "react-linkify";
|
||||||
|
|
||||||
import Tooltip from "../tooltip";
|
import Tooltip from "../tooltip";
|
||||||
|
|
||||||
export const truncateLink = (href: string, text: string, key: number) => {
|
export const truncateLink = (href: string, text: string, key: number) => {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import React from "react";
|
|
||||||
import { usePopper } from "react-popper";
|
|
||||||
import { Popover as HeadlessPopover } from "@headlessui/react";
|
import { Popover as HeadlessPopover } from "@headlessui/react";
|
||||||
import clsx from "clsx";
|
|
||||||
import ReactDOM from "react-dom";
|
|
||||||
import { Placement } from "@popperjs/core";
|
import { Placement } from "@popperjs/core";
|
||||||
|
import clsx from "clsx";
|
||||||
|
import React from "react";
|
||||||
|
import ReactDOM from "react-dom";
|
||||||
|
import { usePopper } from "react-popper";
|
||||||
|
|
||||||
interface PopoverProps {
|
interface PopoverProps {
|
||||||
trigger: React.ReactNode;
|
trigger: React.ReactNode;
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { usePlausible } from "next-plausible";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { useCopyToClipboard } from "react-use";
|
import { useCopyToClipboard } from "react-use";
|
||||||
|
|
||||||
import Button from "./button";
|
import Button from "./button";
|
||||||
|
|
||||||
export interface SharingProps {
|
export interface SharingProps {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import Logo from "../public/logo.svg";
|
import Logo from "../public/logo.svg";
|
||||||
import Newspaper from "./icons/newspaper.svg";
|
import Newspaper from "./icons/newspaper.svg";
|
||||||
import Pencil from "./icons/pencil.svg";
|
import Pencil from "./icons/pencil.svg";
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
import * as React from "react";
|
|
||||||
import PageLayout from "./page-layout";
|
|
||||||
import { Disclosure } from "@headlessui/react";
|
import { Disclosure } from "@headlessui/react";
|
||||||
import Chat from "@/components/icons/chat.svg";
|
|
||||||
import Button from "@/components/button";
|
|
||||||
import { showCrispChat } from "./crisp-chat";
|
|
||||||
import { Trans, useTranslation } from "next-i18next";
|
import { Trans, useTranslation } from "next-i18next";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
|
import Button from "@/components/button";
|
||||||
|
import Chat from "@/components/icons/chat.svg";
|
||||||
|
|
||||||
|
import { showCrispChat } from "./crisp-chat";
|
||||||
|
import PageLayout from "./page-layout";
|
||||||
|
|
||||||
const Support: React.VoidFunctionComponent = () => {
|
const Support: React.VoidFunctionComponent = () => {
|
||||||
const { t } = useTranslation("support");
|
const { t } = useTranslation("support");
|
||||||
|
|
|
@ -7,6 +7,7 @@ import soft from "timezone-soft";
|
||||||
import ChevronDown from "../../components/icons/chevron-down.svg";
|
import ChevronDown from "../../components/icons/chevron-down.svg";
|
||||||
import { styleMenuItem } from "../menu-styles";
|
import { styleMenuItem } from "../menu-styles";
|
||||||
import timeZones from "./time-zones.json";
|
import timeZones from "./time-zones.json";
|
||||||
|
|
||||||
interface TimeZoneOption {
|
interface TimeZoneOption {
|
||||||
value: string;
|
value: string;
|
||||||
label: string;
|
label: string;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
import ErrorPage from "@/components/error-page";
|
import ErrorPage from "@/components/error-page";
|
||||||
import DocumentSearch from "@/components/icons/document-search.svg";
|
import DocumentSearch from "@/components/icons/document-search.svg";
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
const Custom404: React.VoidFunctionComponent = () => {
|
const Custom404: React.VoidFunctionComponent = () => {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,17 +1,20 @@
|
||||||
import ModalProvider from "@/components/modal/modal-provider";
|
import "react-big-calendar/lib/css/react-big-calendar.css";
|
||||||
|
import "tailwindcss/tailwind.css";
|
||||||
|
import "../style.css";
|
||||||
|
|
||||||
import { NextPage } from "next";
|
import { NextPage } from "next";
|
||||||
import { appWithTranslation } from "next-i18next";
|
|
||||||
import PlausibleProvider from "next-plausible";
|
|
||||||
import { AppProps } from "next/app";
|
import { AppProps } from "next/app";
|
||||||
import dynamic from "next/dynamic";
|
import dynamic from "next/dynamic";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import "react-big-calendar/lib/css/react-big-calendar.css";
|
import { appWithTranslation } from "next-i18next";
|
||||||
|
import PlausibleProvider from "next-plausible";
|
||||||
import toast, { Toaster } from "react-hot-toast";
|
import toast, { Toaster } from "react-hot-toast";
|
||||||
import { MutationCache, QueryClient, QueryClientProvider } from "react-query";
|
import { MutationCache, QueryClient, QueryClientProvider } from "react-query";
|
||||||
import { useSessionStorage } from "react-use";
|
import { useSessionStorage } from "react-use";
|
||||||
import "tailwindcss/tailwind.css";
|
|
||||||
|
import ModalProvider from "@/components/modal/modal-provider";
|
||||||
|
|
||||||
import { UserNameContext } from "../components/user-name-context";
|
import { UserNameContext } from "../components/user-name-context";
|
||||||
import "../style.css";
|
|
||||||
|
|
||||||
const CrispChat = dynamic(() => import("@/components/crisp-chat"), {
|
const CrispChat = dynamic(() => import("@/components/crisp-chat"), {
|
||||||
ssr: false,
|
ssr: false,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import NextErrorComponent, { ErrorProps as NextErrorProps } from "next/error";
|
|
||||||
import { NextPage, NextPageContext } from "next";
|
|
||||||
|
|
||||||
import * as Sentry from "@sentry/nextjs";
|
import * as Sentry from "@sentry/nextjs";
|
||||||
|
import { NextPage, NextPageContext } from "next";
|
||||||
|
import NextErrorComponent, { ErrorProps as NextErrorProps } from "next/error";
|
||||||
|
|
||||||
interface ErrorProps extends NextErrorProps {
|
interface ErrorProps extends NextErrorProps {
|
||||||
hasGetInitialPropsRun?: boolean;
|
hasGetInitialPropsRun?: boolean;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { NextMiddleware, NextResponse } from "next/server";
|
import { NextMiddleware, NextResponse } from "next/server";
|
||||||
|
|
||||||
import { isInMaintenanceMode } from "../utils/constants";
|
import { isInMaintenanceMode } from "../utils/constants";
|
||||||
|
|
||||||
export const middleware: NextMiddleware = async (req) => {
|
export const middleware: NextMiddleware = async (req) => {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { exclude, getQueryParam } from "utils/api-utils";
|
||||||
import { LegacyPoll } from "utils/legacy-utils";
|
import { LegacyPoll } from "utils/legacy-utils";
|
||||||
import { getMongoClient } from "utils/mongodb-client";
|
import { getMongoClient } from "utils/mongodb-client";
|
||||||
import { nanoid } from "utils/nanoid";
|
import { nanoid } from "utils/nanoid";
|
||||||
|
|
||||||
import { prisma } from "../../../db";
|
import { prisma } from "../../../db";
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import absoluteUrl from "utils/absolute-url";
|
import absoluteUrl from "utils/absolute-url";
|
||||||
|
|
||||||
import { prisma } from "../../../../../db";
|
import { prisma } from "../../../../../db";
|
||||||
import {
|
import {
|
||||||
getAdminLink,
|
getAdminLink,
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { GetPollApiResponse } from "api-client/get-poll";
|
import { GetPollApiResponse } from "api-client/get-poll";
|
||||||
import { NextApiResponse } from "next";
|
import { NextApiResponse } from "next";
|
||||||
import { resetDates } from "utils/legacy-utils";
|
import { resetDates } from "utils/legacy-utils";
|
||||||
|
|
||||||
import { UpdatePollPayload } from "../../../../api-client/update-poll";
|
import { UpdatePollPayload } from "../../../../api-client/update-poll";
|
||||||
import { prisma } from "../../../../db";
|
import { prisma } from "../../../../db";
|
||||||
import { exclude, withLink } from "../../../../utils/api-utils";
|
import { exclude, withLink } from "../../../../utils/api-utils";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { prisma } from "../../../../../db";
|
import { prisma } from "../../../../../db";
|
||||||
import { withLink, getQueryParam } from "../../../../../utils/api-utils";
|
import { getQueryParam,withLink } from "../../../../../utils/api-utils";
|
||||||
|
|
||||||
export default withLink(async (req, res, link) => {
|
export default withLink(async (req, res, link) => {
|
||||||
const participantId = getQueryParam(req, "participantId");
|
const participantId = getQueryParam(req, "participantId");
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import absoluteUrl from "utils/absolute-url";
|
import absoluteUrl from "utils/absolute-url";
|
||||||
|
|
||||||
import { AddParticipantPayload } from "../../../../../api-client/add-participant";
|
import { AddParticipantPayload } from "../../../../../api-client/add-participant";
|
||||||
import { prisma } from "../../../../../db";
|
import { prisma } from "../../../../../db";
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import absoluteUrl from "utils/absolute-url";
|
import absoluteUrl from "utils/absolute-url";
|
||||||
|
|
||||||
import { prisma } from "../../../../db";
|
import { prisma } from "../../../../db";
|
||||||
import { sendEmailTemplate, withLink } from "../../../../utils/api-utils";
|
import { sendEmailTemplate, withLink } from "../../../../utils/api-utils";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { addMinutes } from "date-fns";
|
import { addMinutes } from "date-fns";
|
||||||
import { NextApiRequest, NextApiResponse } from "next";
|
import { NextApiRequest, NextApiResponse } from "next";
|
||||||
import { nanoid } from "utils/nanoid";
|
import { nanoid } from "utils/nanoid";
|
||||||
|
|
||||||
import { prisma } from "../../../db";
|
import { prisma } from "../../../db";
|
||||||
|
|
||||||
const participantData = [
|
const participantData = [
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { NextApiRequest, NextApiResponse } from "next";
|
import { NextApiRequest, NextApiResponse } from "next";
|
||||||
import { sendEmailTemplate } from "utils/api-utils";
|
import { sendEmailTemplate } from "utils/api-utils";
|
||||||
import { nanoid } from "utils/nanoid";
|
import { nanoid } from "utils/nanoid";
|
||||||
|
|
||||||
import { CreatePollPayload } from "../../../api-client/create-poll";
|
import { CreatePollPayload } from "../../../api-client/create-poll";
|
||||||
import { prisma } from "../../../db";
|
import { prisma } from "../../../db";
|
||||||
import absoluteUrl from "../../../utils/absolute-url";
|
import absoluteUrl from "../../../utils/absolute-url";
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import { GetStaticProps, NextPage } from "next";
|
import { GetStaticProps, NextPage } from "next";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
import { useTranslation } from "next-i18next";
|
import { useTranslation } from "next-i18next";
|
||||||
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
||||||
import { usePlausible } from "next-plausible";
|
import { usePlausible } from "next-plausible";
|
||||||
import { useRouter } from "next/router";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useMount } from "react-use";
|
import { useMount } from "react-use";
|
||||||
|
|
||||||
import { createDemo } from "../api-client/create-demo";
|
import { createDemo } from "../api-client/create-demo";
|
||||||
import FullPageLoader from "../components/full-page-loader";
|
import FullPageLoader from "../components/full-page-loader";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { GetStaticProps } from "next";
|
import { GetStaticProps } from "next";
|
||||||
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
||||||
|
|
||||||
export { default } from "@/components/home";
|
export { default } from "@/components/home";
|
||||||
|
|
||||||
export const getStaticProps: GetStaticProps = async ({ locale = "en" }) => {
|
export const getStaticProps: GetStaticProps = async ({ locale = "en" }) => {
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
import { GetServerSideProps, NextPage } from "next";
|
import { GetServerSideProps, NextPage } from "next";
|
||||||
import { useTranslation } from "next-i18next";
|
|
||||||
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
|
||||||
import { usePlausible } from "next-plausible";
|
|
||||||
import dynamic from "next/dynamic";
|
import dynamic from "next/dynamic";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
import { useTranslation } from "next-i18next";
|
||||||
|
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
||||||
|
import { usePlausible } from "next-plausible";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useMutation } from "react-query";
|
import { useMutation } from "react-query";
|
||||||
import { useSessionStorage } from "react-use";
|
import { useSessionStorage } from "react-use";
|
||||||
|
|
||||||
import { createPoll } from "../api-client/create-poll";
|
import { createPoll } from "../api-client/create-poll";
|
||||||
import Button from "../components/button";
|
import Button from "../components/button";
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
import axios from "axios";
|
||||||
|
import { GetServerSideProps, NextPage } from "next";
|
||||||
|
import Head from "next/head";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import { useTranslation } from "next-i18next";
|
||||||
|
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
||||||
|
import { usePlausible } from "next-plausible";
|
||||||
|
import React from "react";
|
||||||
|
import { toast } from "react-hot-toast";
|
||||||
|
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||||
|
import { useMount } from "react-use";
|
||||||
|
import { preventWidows } from "utils/prevent-widows";
|
||||||
|
|
||||||
import Button from "@/components/button";
|
import Button from "@/components/button";
|
||||||
import ErrorPage from "@/components/error-page";
|
import ErrorPage from "@/components/error-page";
|
||||||
import FullPageLoader from "@/components/full-page-loader";
|
import FullPageLoader from "@/components/full-page-loader";
|
||||||
|
@ -16,18 +29,7 @@ import Sharing from "@/components/sharing";
|
||||||
import StandardLayout from "@/components/standard-layout";
|
import StandardLayout from "@/components/standard-layout";
|
||||||
import { PollContext, usePoll } from "@/components/use-poll";
|
import { PollContext, usePoll } from "@/components/use-poll";
|
||||||
import { useUserName } from "@/components/user-name-context";
|
import { useUserName } from "@/components/user-name-context";
|
||||||
import axios from "axios";
|
|
||||||
import { GetServerSideProps, NextPage } from "next";
|
|
||||||
import { useTranslation } from "next-i18next";
|
|
||||||
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
|
||||||
import { usePlausible } from "next-plausible";
|
|
||||||
import Head from "next/head";
|
|
||||||
import { useRouter } from "next/router";
|
|
||||||
import React from "react";
|
|
||||||
import { toast } from "react-hot-toast";
|
|
||||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
|
||||||
import { useMount } from "react-use";
|
|
||||||
import { preventWidows } from "utils/prevent-widows";
|
|
||||||
import { GetPollResponse } from "../api-client/get-poll";
|
import { GetPollResponse } from "../api-client/get-poll";
|
||||||
import { getBrowserTimeZone } from "../utils/date-time-utils";
|
import { getBrowserTimeZone } from "../utils/date-time-utils";
|
||||||
import Custom404 from "./404";
|
import Custom404 from "./404";
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import PageLayout from "@/components/page-layout";
|
|
||||||
import { GetStaticProps } from "next";
|
import { GetStaticProps } from "next";
|
||||||
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
||||||
|
|
||||||
|
import PageLayout from "@/components/page-layout";
|
||||||
|
|
||||||
const PrivacyPolicy = () => {
|
const PrivacyPolicy = () => {
|
||||||
return (
|
return (
|
||||||
<PageLayout>
|
<PageLayout>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { GetStaticProps } from "next";
|
import { GetStaticProps } from "next";
|
||||||
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
||||||
|
|
||||||
export { default } from "@/components/support";
|
export { default } from "@/components/support";
|
||||||
|
|
||||||
export const getStaticProps: GetStaticProps = async ({ locale = "en" }) => {
|
export const getStaticProps: GetStaticProps = async ({ locale = "en" }) => {
|
||||||
|
|
|
@ -3023,7 +3023,7 @@ eslint-plugin-react@^7.27.0:
|
||||||
|
|
||||||
eslint-plugin-simple-import-sort@^7.0.0:
|
eslint-plugin-simple-import-sort@^7.0.0:
|
||||||
version "7.0.0"
|
version "7.0.0"
|
||||||
resolved "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-7.0.0.tgz"
|
resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-7.0.0.tgz#a1dad262f46d2184a90095a60c66fef74727f0f8"
|
||||||
integrity sha512-U3vEDB5zhYPNfxT5TYR7u01dboFZp+HNpnGhkDB2g/2E4wZ/g1Q9Ton8UwCLfRV9yAKyYqDh62oHOamvkFxsvw==
|
integrity sha512-U3vEDB5zhYPNfxT5TYR7u01dboFZp+HNpnGhkDB2g/2E4wZ/g1Q9Ton8UwCLfRV9yAKyYqDh62oHOamvkFxsvw==
|
||||||
|
|
||||||
eslint-scope@^5.0.0, eslint-scope@^5.1.1:
|
eslint-scope@^5.0.0, eslint-scope@^5.1.1:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue