Fixed types
This commit is contained in:
parent
43eef83aa8
commit
8ce54d0766
@ -2,17 +2,18 @@ import { FC, useState } from "react";
|
||||
import { OutlinedButton } from "@src/components/common/buttons/outlinedButton";
|
||||
import { PrimaryButton } from "@src/components/common/buttons/primaryButton";
|
||||
import { TodoShortForm } from "@src/components/todos/collapsed/todoShortForm";
|
||||
import { Priorities } from "@src/core/entities/todo";
|
||||
|
||||
export const AddTodoForm: FC<{
|
||||
onAdd: (
|
||||
todoName: string,
|
||||
project: string,
|
||||
description: string,
|
||||
priority: string
|
||||
priority?: Priorities
|
||||
) => void;
|
||||
onClose: () => void;
|
||||
project: string;
|
||||
priority: string;
|
||||
priority?: Priorities;
|
||||
}> = ({ onAdd, onClose, ...props }) => {
|
||||
const [todoName, setTodoName] = useState("");
|
||||
const [todoDescription, setTodoDescription] = useState("");
|
||||
|
@ -22,7 +22,6 @@ export function AddTodo(props: { project: string }) {
|
||||
return (
|
||||
<AddTodoForm
|
||||
project={props.project}
|
||||
priority={""}
|
||||
onAdd={(todoName, project, description, priority) => {
|
||||
createTodo(todoName, description, project, priority);
|
||||
}}
|
||||
|
@ -1,12 +1,13 @@
|
||||
import TextareaAutosize from "react-textarea-autosize";
|
||||
import { AddProjectButton } from "@src/components/todos/add/addProjectButton";
|
||||
import { AddPriorityButton } from "@src/components/todos/add/addPriorityButton";
|
||||
import { Priorities } from "@src/core/entities/todo";
|
||||
|
||||
export const TodoShortForm = (props: {
|
||||
project: string;
|
||||
onProjectChanged: (project: string) => void;
|
||||
priority: string;
|
||||
onPriorityChanged: (project: string) => void;
|
||||
priority: Priorities;
|
||||
onPriorityChanged: (project: Priorities) => void;
|
||||
name: string;
|
||||
onNameChange: (e) => void;
|
||||
description: string;
|
||||
|
@ -6,7 +6,7 @@ export const StatusState: { done: Done; notDone: NotDone } = {
|
||||
notDone: false,
|
||||
};
|
||||
|
||||
enum Priorities {
|
||||
export enum Priorities {
|
||||
p1 = "p1",
|
||||
p2 = "p2",
|
||||
p3 = "p3",
|
||||
|
@ -2,7 +2,7 @@ import { useEffect } from "react";
|
||||
import { useAppSelector } from "@src/infrastructure/store";
|
||||
import { todosSelectors } from "@src/infrastructure/state/todo";
|
||||
import { todosApi } from "@src/infrastructure/apis/todosApi";
|
||||
import { Todo } from "@src/core/entities/todo";
|
||||
import { Priorities, Todo } from "@src/core/entities/todo";
|
||||
import { nanoid } from "@reduxjs/toolkit";
|
||||
|
||||
export const useSelectInboxTodos = () => {
|
||||
@ -22,7 +22,7 @@ export const useCreateTodo = () => {
|
||||
todoName: string,
|
||||
description: string,
|
||||
project?: string,
|
||||
priority?: string
|
||||
priority?: Priorities
|
||||
) => {
|
||||
createTodo({
|
||||
id: nanoid(),
|
||||
|
Loading…
Reference in New Issue
Block a user