From aaeccfbec539b2e2f036451ba028a9144b54e0f3 Mon Sep 17 00:00:00 2001 From: Qubasa Date: Sun, 22 Oct 2023 22:17:10 +0200 Subject: [PATCH] Fixed linting problem --- .../ui/src/components/hooks/useAppContext.tsx | 7 +- pkgs/ui/src/views/joinPrequel.tsx | 65 ------------------- 2 files changed, 2 insertions(+), 70 deletions(-) delete mode 100644 pkgs/ui/src/views/joinPrequel.tsx diff --git a/pkgs/ui/src/components/hooks/useAppContext.tsx b/pkgs/ui/src/components/hooks/useAppContext.tsx index 8317bfc..a749aaf 100644 --- a/pkgs/ui/src/components/hooks/useAppContext.tsx +++ b/pkgs/ui/src/components/hooks/useAppContext.tsx @@ -1,6 +1,4 @@ -import { useListMachines } from "@/api/default/default"; -import { MachinesResponse } from "@/api/model"; -import { AxiosError, AxiosResponse } from "axios"; +import { AxiosError } from "axios"; import React, { createContext, Dispatch, @@ -8,7 +6,6 @@ import React, { SetStateAction, useState, } from "react"; -import { KeyedMutator } from "swr"; type AppContextType = { data: AppState; @@ -21,7 +18,7 @@ type AppContextType = { export const AppContext = createContext({} as AppContextType); -type AppState = {}; +type AppState = NonNullable; interface AppContextProviderProps { children: ReactNode; diff --git a/pkgs/ui/src/views/joinPrequel.tsx b/pkgs/ui/src/views/joinPrequel.tsx deleted file mode 100644 index 4b87689..0000000 --- a/pkgs/ui/src/views/joinPrequel.tsx +++ /dev/null @@ -1,65 +0,0 @@ -"use client"; -import { IconButton, Input, InputAdornment } from "@mui/material"; -import { useSearchParams } from "next/navigation"; -import { Suspense } from "react"; - -import { Confirm } from "@/components/join/confirm"; -import { Layout } from "@/components/join/layout"; -import { ChevronRight } from "@mui/icons-material"; -import { Controller, useForm } from "react-hook-form"; - -type FormValues = { - flakeUrl: string; -}; - -export default function JoinPrequel() { - const queryParams = useSearchParams(); - const flakeUrl = queryParams.get("flake") || ""; - const flakeAttr = queryParams.get("attr") || "default"; - const { handleSubmit, control, formState, getValues, reset } = - useForm({ defaultValues: { flakeUrl: "" } }); - - return ( - - - {!formState.isSubmitted && !flakeUrl && ( -
{})} - className="w-full max-w-2xl justify-self-center" - > - ( - Clan - } - endAdornment={ - - - - - - } - /> - )} - /> - - )} - {(formState.isSubmitted || flakeUrl) && ( - reset()} - flakeUrl={formState.isSubmitted ? getValues("flakeUrl") : flakeUrl} - flakeAttr={flakeAttr} - /> - )} -
-
- ); -}