chore: web app use client directive (#4747)

* chore: use client directive

* chore: use client directive
This commit is contained in:
Anmol Singh Bhatia 2024-06-10 15:13:10 +05:30 committed by GitHub
parent c880e8b48c
commit d3556f457b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
313 changed files with 649 additions and 45 deletions

View File

@ -1,3 +1,5 @@
"use client";
import React, { FC, useMemo, useState } from "react";
import { useForm } from "react-hook-form";
// types

View File

@ -1,3 +1,4 @@
"use client";
import { FC } from "react";
import { useForm } from "react-hook-form";
import { IFormattedInstanceConfiguration, TInstanceImageConfigurationKeys } from "@plane/types";

View File

@ -1,3 +1,5 @@
"use client";
import Link from "next/link";
import { Tooltip } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
import React from "react";
import Link from "next/link";
// headless ui
@ -43,33 +45,22 @@ export const ConfirmDiscardModal: React.FC<Props> = (props) => {
<div className="px-4 pb-4 pt-5 sm:p-6 sm:pb-4">
<div className="sm:flex sm:items-start">
<div className="mt-3 text-center sm:mt-0 sm:text-left">
<Dialog.Title
as="h3"
className="text-lg font-medium leading-6 text-custom-text-300"
>
<Dialog.Title as="h3" className="text-lg font-medium leading-6 text-custom-text-300">
You have unsaved changes
</Dialog.Title>
<div className="mt-2">
<p className="text-sm text-custom-text-400">
Changes you made will be lost if you go back. Do you
wish to go back?
Changes you made will be lost if you go back. Do you wish to go back?
</p>
</div>
</div>
</div>
</div>
<div className="flex justify-end items-center p-4 sm:px-6 gap-2">
<Button
variant="neutral-primary"
size="sm"
onClick={handleClose}
>
<Button variant="neutral-primary" size="sm" onClick={handleClose}>
Keep editing
</Button>
<Link
href={onDiscardHref}
className={getButtonStyling("primary", "sm")}
>
<Link href={onDiscardHref} className={getButtonStyling("primary", "sm")}>
Go back
</Link>
</div>

View File

@ -1,3 +1,5 @@
"use client";
import React from "react";
import Image from "next/image";
import { Button } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
import { useTheme } from "next-themes";
// ui
import { Toast as ToastComponent } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
import { useState } from "react";
import { NodeViewWrapper, NodeViewContent } from "@tiptap/react";
import { common, createLowlight } from "lowlight";

View File

@ -1,3 +1,5 @@
"use client";
import { Editor } from "@tiptap/react";
import { forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
import { cn } from "src/lib/utils";

View File

@ -1,3 +1,5 @@
"use client";
import { cn } from "@plane/editor-core";
import { Editor } from "@tiptap/core";
import tippy from "tippy.js";

View File

@ -1,3 +1,5 @@
"use client";
// @ts-nocheck
import { Button } from "@plane/ui";
import { NodeViewWrapper } from "@tiptap/react";

View File

@ -1,3 +1,5 @@
"use client";
import React, { useEffect, useState, useCallback } from "react";
// editor
import { EditorMenuItemNames, EditorRefApi } from "@plane/lite-text-editor";

View File

@ -1,3 +1,5 @@
"use client";
// ui
import { StateGroupIcon } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
import React, { useRef } from "react";
import { observer } from "mobx-react-lite";
import { useForm, Controller } from "react-hook-form";

View File

@ -1,3 +1,5 @@
"use client";
import React from "react";
import { observer } from "mobx-react-lite";
import { usePathname, useRouter, useSearchParams } from "next/navigation";

View File

@ -1,3 +1,5 @@
"use client";
import { observer } from "mobx-react-lite";
// components
import { Loader } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
import React from "react";
import { observer } from "mobx-react-lite";
import { Link2, MoveRight } from "lucide-react";

View File

@ -1,3 +1,5 @@
"use client";
import React from "react";
import { observer } from "mobx-react-lite";
import Link from "next/link";

View File

@ -1,3 +1,5 @@
"use client";
import { observer } from "mobx-react-lite";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
// lib

View File

@ -1,3 +1,5 @@
"use client";
import { CalendarCheck2, Signal } from "lucide-react";
// ui
import { DoubleCircleIcon, StateGroupIcon, TOAST_TYPE, setToast } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
import { observer } from "mobx-react-lite";
// components
import { Loader } from "@plane/ui";

View File

@ -1,3 +1,4 @@
"use client";
import { useCallback } from "react";
import { observer } from "mobx-react";
import Link from "next/link";

View File

@ -1,3 +1,4 @@
"use client";
import { useState } from "react";
import Image from "next/image";
import { useParams } from "next/navigation";

View File

@ -1,3 +1,4 @@
"use client";
import { Command } from "cmdk";
import { FileText, GithubIcon, MessageSquare, Rocket } from "lucide-react";
// ui

View File

@ -1,3 +1,4 @@
"use client";
import React from "react";
import Image from "next/image";

View File

@ -1,3 +1,4 @@
"use client";
import React, { useState } from "react";
import Image from "next/image";

View File

@ -1,3 +1,4 @@
"use client";
import React from "react";
import useSWR from "swr";
// headless ui

View File

@ -1,3 +1,4 @@
"use client";
import { Fragment } from "react";
import { DayPicker } from "react-day-picker";

View File

@ -1,3 +1,4 @@
"use client";
import React from "react";
import { CalendarDays } from "lucide-react";
// ui

View File

@ -1,3 +1,4 @@
"use client";
import React, { FC } from "react";
import { useRouter } from "next/navigation";
// ui

View File

@ -1,3 +1,4 @@
"use client";
import { AlertTriangle, Info, LucideIcon } from "lucide-react";
// ui
import { Button, TButtonVariant } from "@plane/ui";

View File

@ -1,3 +1,4 @@
"use client";
// ui
import { Checkbox } from "@plane/ui";
// helpers

View File

@ -1,3 +1,4 @@
"use client";
// ui
import { Checkbox } from "@plane/ui";
// helpers

View File

@ -1,3 +1,4 @@
"use client";
import { observer } from "mobx-react";
// icons
import { Pencil, Trash2, LinkIcon, ExternalLink } from "lucide-react";

View File

@ -1,3 +1,4 @@
"use client";
import React from "react";
import { observer } from "mobx-react";
import Image from "next/image";

View File

@ -1,3 +1,4 @@
"use client";
import { FC, Fragment } from "react";
// react-form
import { ColorResult, SketchPicker } from "react-color";

View File

@ -1,3 +1,5 @@
"use client";
import { observer } from "mobx-react";
import { useTheme } from "next-themes";
import { Controller, useForm } from "react-hook-form";

View File

@ -1,3 +1,5 @@
"use client";
import { FC } from "react";
// constants
import { CustomSelect } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
import { FC, Fragment } from "react";
import { observer } from "mobx-react";
import Link from "next/link";

View File

@ -1,3 +1,5 @@
"use client";
import { FC } from "react";
import Link from "next/link";
// types

View File

@ -1,3 +1,5 @@
"use client";
import { FC } from "react";
import Link from "next/link";
// types

View File

@ -1,3 +1,5 @@
"use client";
import { observer } from "mobx-react-lite";
import useSWR from "swr";
// ui

View File

@ -1,3 +1,5 @@
"use client";
import React, { Fragment } from "react";
import { Tab } from "@headlessui/react";
import { ICycle } from "@plane/types";

View File

@ -1,3 +1,5 @@
"use client";
import { useRef } from "react";
import { observer } from "mobx-react";
import Link from "next/link";

View File

@ -1,3 +1,5 @@
"use client";
import { useState, Fragment } from "react";
import { useRouter } from "next/navigation";
import { Dialog, Transition } from "@headlessui/react";

View File

@ -1,3 +1,5 @@
"use client";
import { FC, MouseEvent, useRef } from "react";
import { observer } from "mobx-react";
import Link from "next/link";
@ -136,8 +138,8 @@ export const CyclesBoardCard: FC<ICyclesBoardCard> = observer((props) => {
e.preventDefault();
e.stopPropagation();
const query = generateQueryParams(searchParams, ['peekCycle']);
if (searchParams.has('peekCycle')) {
const query = generateQueryParams(searchParams, ["peekCycle"]);
if (searchParams.has("peekCycle")) {
router.push(`${pathname}?${query}`);
} else {
router.push(`${pathname}?${query}&peekCycle=${cycleId}`);

View File

@ -1,3 +1,5 @@
"use client";
import { useState } from "react";
import { observer } from "mobx-react";
import { useParams, useRouter, useSearchParams } from "next/navigation";

View File

@ -1,3 +1,5 @@
"use client";
import { useEffect } from "react";
import { Controller, useForm } from "react-hook-form";
// types

View File

@ -1,3 +1,5 @@
"use client";
import { observer } from "mobx-react";
import Link from "next/link";
import { useRouter } from "next/navigation";

View File

@ -1,3 +1,5 @@
"use client";
import React, { FC } from "react";
import { ChevronDown } from "lucide-react";
// types

View File

@ -1,3 +1,5 @@
"use client";
import React, { FC, MouseEvent } from "react";
import { observer } from "mobx-react";
import { CalendarCheck2, CalendarClock, MoveRight, Users } from "lucide-react";

View File

@ -1,3 +1,5 @@
"use client";
import { FC, MouseEvent, useRef } from "react";
import { observer } from "mobx-react";
import { usePathname, useRouter, useSearchParams } from "next/navigation";

View File

@ -1,3 +1,5 @@
"use client";
import React, { useEffect, useState } from "react";
// types
import type { CycleDateCheckData, ICycle, TCycleTabOptions } from "@plane/types";

View File

@ -1,3 +1,5 @@
"use client";
import { useState } from "react";
import { observer } from "mobx-react";
import { useRouter } from "next/navigation";

View File

@ -1,3 +1,5 @@
"use client";
import React, { useCallback, useEffect, useState } from "react";
import isEmpty from "lodash/isEmpty";
import isEqual from "lodash/isEqual";

View File

@ -1,3 +1,5 @@
"use client";
import React, { useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";

View File

@ -1,3 +1,5 @@
"use client";
import React from "react";
import isEmpty from "lodash/isEmpty";

View File

@ -1,3 +1,5 @@
"use client";
import { observer } from "mobx-react";
import Image from "next/image";
// ui

View File

@ -1,3 +1,5 @@
"use client";
import { useState } from "react";
import { ChevronDown } from "lucide-react";
// components

View File

@ -1,3 +1,5 @@
"use client";
import { AlertTriangle, RefreshCcw } from "lucide-react";
// ui
import { Button } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
import isToday from "date-fns/isToday";
import { observer } from "mobx-react-lite";
import { TIssue, TWidgetIssue } from "@plane/types";

View File

@ -1,3 +1,5 @@
"use client";
import Link from "next/link";
import { TAssignedIssuesWidgetResponse, TCreatedIssuesWidgetResponse, TIssue, TIssuesListTypes } from "@plane/types";
// hooks

View File

@ -1,3 +1,5 @@
"use client";
// ui
import { Loader } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
// ui
import { Loader } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
// ui
import { Loader } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
// ui
import { Loader } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
// ui
import { Loader } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
// ui
import { Loader } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
// ui
import { Loader } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
import { useEffect } from "react";
import { observer } from "mobx-react";
import Link from "next/link";

View File

@ -1,3 +1,5 @@
"use client";
import { useEffect } from "react";
import { observer } from "mobx-react";
import Link from "next/link";

View File

@ -1,3 +1,5 @@
"use client";
import { useState } from "react";
// components
import { Button } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
import { useState } from "react";
import Image from "next/image";
import { useTheme } from "next-themes";

View File

@ -1,3 +1,5 @@
"use client";
import { useEffect } from "react";
import { observer } from "mobx-react";
import Link from "next/link";

View File

@ -1,3 +1,5 @@
"use client";
// helpers
import { Tooltip } from "@plane/ui";
import { cn } from "@/helpers/common.helper";

View File

@ -1,3 +1,5 @@
"use client";
import { FC, useEffect, useRef, useState } from "react";
import { Placement } from "@popperjs/core";
import { observer } from "mobx-react";

View File

@ -1,3 +1,5 @@
"use client";
import { Fragment, ReactNode, useRef, useState } from "react";
import { observer } from "mobx-react-lite";
import { ChevronDown } from "lucide-react";

View File

@ -1,3 +1,5 @@
"use client";
import React, { useEffect, useRef, useState } from "react";
import { Placement } from "@popperjs/core";
import { DateRange, DayPicker, Matcher } from "react-day-picker";

View File

@ -1,3 +1,5 @@
"use client";
import { observer } from "mobx-react";
// icons
import { LucideIcon, Users } from "lucide-react";
@ -36,9 +38,5 @@ export const ButtonAvatars: React.FC<AvatarProps> = observer((props) => {
}
}
return Icon ? (
<Icon className="h-3 w-3 flex-shrink-0" />
) : (
<Users className="h-3 w-3 flex-shrink-0" />
);
return Icon ? <Icon className="h-3 w-3 flex-shrink-0" /> : <Users className="h-3 w-3 flex-shrink-0" />;
});

View File

@ -1,3 +1,5 @@
"use client";
import { useEffect, useRef, useState } from "react";
import { Placement } from "@popperjs/core";
import { observer } from "mobx-react";

View File

@ -1,3 +1,5 @@
"use client";
import { Fragment, ReactNode, useEffect, useRef, useState } from "react";
import { observer } from "mobx-react-lite";
import { ChevronDown, X } from "lucide-react";

View File

@ -1,3 +1,5 @@
"use client";
import { useEffect, useRef, useState } from "react";
import { Placement } from "@popperjs/core";
import { observer } from "mobx-react";

View File

@ -1,3 +1,5 @@
"use client";
import { Fragment, ReactNode, useRef, useState } from "react";
import { useTheme } from "next-themes";
import { usePopper } from "react-popper";

View File

@ -1,3 +1,5 @@
"use client";
import { Fragment, ReactNode, useEffect, useRef, useState } from "react";
import { observer } from "mobx-react";
import { usePopper } from "react-popper";

View File

@ -1,3 +1,5 @@
"use client";
import React, { useEffect, useState, useCallback } from "react";
import { Globe2, Lock, LucideIcon } from "lucide-react";
// editor

View File

@ -1,3 +1,5 @@
"use client";
import React from "react";
import { observer } from "mobx-react";
import Image from "next/image";

View File

@ -1,3 +1,5 @@
"use client";
import { FC, useEffect, useMemo, useState } from "react";
import { observer } from "mobx-react";
import { ChevronLeft } from "lucide-react";

View File

@ -1,3 +1,5 @@
"use client";
import { FC } from "react";
import { Crown, Info } from "lucide-react";
import { TEstimateSystemKeys } from "@plane/types";

View File

@ -1,3 +1,5 @@
"use client";
import { FC, useState } from "react";
import { observer } from "mobx-react";
import { Button, TOAST_TYPE, setToast } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
import { FC } from "react";
import Image from "next/image";
import { useTheme } from "next-themes";

View File

@ -1,3 +1,5 @@
"use client";
import { FC } from "react";
import { observer } from "mobx-react";
import { TOAST_TYPE, ToggleSwitch, setToast } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
import { FC } from "react";
import { Loader } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
import { Dispatch, FC, SetStateAction, useCallback, useState } from "react";
import { observer } from "mobx-react";
import { Plus } from "lucide-react";

View File

@ -1,3 +1,5 @@
"use client";
import { FC, MouseEvent, FocusEvent, useState } from "react";
import { observer } from "mobx-react";
import { Check, Info, X } from "lucide-react";

View File

@ -1,3 +1,5 @@
"use client";
import { FC, useState } from "react";
import { observer } from "mobx-react";
import { MoveRight, Trash2, X } from "lucide-react";

View File

@ -1,3 +1,5 @@
"use client";
import { FC, useRef, Fragment, useState } from "react";
import { Info, Check, ChevronDown } from "lucide-react";
import { Listbox, Transition } from "@headlessui/react";

View File

@ -1,3 +1,5 @@
"use client";
import { FC, MouseEvent, useEffect, FocusEvent, useState } from "react";
import { observer } from "mobx-react";
import { Check, Info, X } from "lucide-react";

View File

@ -1,3 +1,5 @@
"use client";
import { FC } from "react";
import { observer } from "mobx-react";
import { Button } from "@plane/ui";

View File

@ -1,3 +1,5 @@
"use client";
import { FC } from "react";
import { Crown } from "lucide-react";
import { TEstimateUpdateStageKeys } from "@plane/types";

View File

@ -1,3 +1,5 @@
"use client";
import React, { useState } from "react";
import { observer } from "mobx-react";
import { useParams, useRouter } from "next/navigation";

View File

@ -1,3 +1,5 @@
"use client";
import { useState } from "react";
import { observer } from "mobx-react";
import Image from "next/image";

Some files were not shown because too many files have changed in this diff Show More