fix unused vars
This commit is contained in:
parent
195ee714e9
commit
419eed81e6
|
|
@ -3,7 +3,6 @@ import { useForm } from "react-hook-form";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import ReactPlayer from "react-player/lazy";
|
import ReactPlayer from "react-player/lazy";
|
||||||
import { useNavigate } from "react-router-dom";
|
|
||||||
|
|
||||||
import { FormLabel } from "~/shared/ui/form-label";
|
import { FormLabel } from "~/shared/ui/form-label";
|
||||||
import { Input } from "~/shared/ui/input";
|
import { Input } from "~/shared/ui/input";
|
||||||
|
|
@ -14,7 +13,6 @@ import { HiddenFileInput } from "~/shared/ui/hidden-file-input";
|
||||||
import { useRootStore } from "~/shared/stores/root";
|
import { useRootStore } from "~/shared/stores/root";
|
||||||
import { Checkbox } from "~/shared/ui/checkbox";
|
import { Checkbox } from "~/shared/ui/checkbox";
|
||||||
import { useAuth } from "~/shared/services/auth";
|
import { useAuth } from "~/shared/services/auth";
|
||||||
import { Routes } from "~/app/router/constants";
|
|
||||||
|
|
||||||
type DataStepProps = {
|
type DataStepProps = {
|
||||||
nextStep(): void;
|
nextStep(): void;
|
||||||
|
|
@ -24,8 +22,6 @@ export const DataStep = ({ nextStep }: DataStepProps) => {
|
||||||
const rootStore = useRootStore();
|
const rootStore = useRootStore();
|
||||||
const auth = useAuth();
|
const auth = useAuth();
|
||||||
|
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
const formSchema = useMemo(() => {
|
const formSchema = useMemo(() => {
|
||||||
return z.object({
|
return z.object({
|
||||||
name: z.string().min(1, "Обязательное поле"),
|
name: z.string().min(1, "Обязательное поле"),
|
||||||
|
|
@ -45,24 +41,24 @@ export const DataStep = ({ nextStep }: DataStepProps) => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
// form.handleSubmit(async (values: FormValues) => {
|
form.handleSubmit(async (values: FormValues) => {
|
||||||
// try {
|
try {
|
||||||
// rootStore.setName(values.name);
|
rootStore.setName(values.name);
|
||||||
//
|
|
||||||
// if (values.author) {
|
if (values.author) {
|
||||||
// rootStore.setAuthor(values.author);
|
rootStore.setAuthor(values.author);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// const res = await auth.mutateAsync();
|
const res = await auth.mutateAsync();
|
||||||
// sessionStorage.setItem("auth_v1_token", res.data.auth_v1_token);
|
sessionStorage.setItem("auth_v1_token", res.data.auth_v1_token);
|
||||||
//
|
|
||||||
// nextStep();
|
nextStep();
|
||||||
// } catch (error) {
|
} catch (error) {
|
||||||
// console.error("Error:", error);
|
console.error("Error:", error);
|
||||||
// }
|
}
|
||||||
// })();
|
})();
|
||||||
// };
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className={"mt-4 px-4 pb-8"}>
|
<section className={"mt-4 px-4 pb-8"}>
|
||||||
|
|
@ -158,15 +154,14 @@ export const DataStep = ({ nextStep }: DataStepProps) => {
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
className={"mt-[30px]"}
|
className={"mt-[30px]"}
|
||||||
// onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
onClick={() => navigate(Routes.ViewContent)}
|
|
||||||
includeArrows={true}
|
includeArrows={true}
|
||||||
label={"Готово"}
|
label={"Готово"}
|
||||||
// disabled={
|
disabled={
|
||||||
// !form.formState.isValid ||
|
!form.formState.isValid ||
|
||||||
// !rootStore.file ||
|
!rootStore.file ||
|
||||||
// (rootStore.allowCover && !rootStore.cover)
|
(rootStore.allowCover && !rootStore.cover)
|
||||||
// }
|
}
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue