Fixed types

This commit is contained in:
Kasper Juul Hermansen 2021-11-21 21:05:06 +01:00
parent 43eef83aa8
commit 8ce54d0766
Signed by: kjuulh
GPG Key ID: DCD9397082D97069
5 changed files with 9 additions and 8 deletions

View File

@ -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("");

View File

@ -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);
}}

View File

@ -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;

View File

@ -6,7 +6,7 @@ export const StatusState: { done: Done; notDone: NotDone } = {
notDone: false,
};
enum Priorities {
export enum Priorities {
p1 = "p1",
p2 = "p2",
p3 = "p3",

View File

@ -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(),