Moved the types out into their own type files
This commit is contained in:
parent
41c8de7b50
commit
a2d68bca09
@ -17,7 +17,6 @@ html {
|
|||||||
font-size: 16pt;
|
font-size: 16pt;
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
border-style: line;
|
border-style: line;
|
||||||
|
|
||||||
background-color: #404552;
|
background-color: #404552;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,20 +2,8 @@ import React from "react";
|
|||||||
import KBColumn from "./components/KBColumn";
|
import KBColumn from "./components/KBColumn";
|
||||||
import "./App.css";
|
import "./App.css";
|
||||||
import Header from "./components/Header";
|
import Header from "./components/Header";
|
||||||
import Task from "./types/Task";
|
import Column from "./types/Column";
|
||||||
type TaskPassback = {
|
import TaskPassback from "./types/TaskPassback";
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
priority: "normal" | "important" | "urgent";
|
|
||||||
column: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
type Column = {
|
|
||||||
id: number;
|
|
||||||
name: string;
|
|
||||||
color: string;
|
|
||||||
tasks: Task[];
|
|
||||||
};
|
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
columns: Column[];
|
columns: Column[];
|
||||||
|
@ -1,16 +1,9 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import Modal from "./Modal";
|
import Modal from "./Modal";
|
||||||
import Task from "../types/Task";
|
import Column from "../types/Column";
|
||||||
import Column from "../types/Column"
|
import TaskPassback from "../types/TaskPassback";
|
||||||
type TaskPassback = {
|
import Priority from "../types/Priority";
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
priority: priority;
|
|
||||||
column: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
type priority = "normal" | "important" | "urgent";
|
|
||||||
type HeaderProps = {
|
type HeaderProps = {
|
||||||
addColumn: () => void;
|
addColumn: () => void;
|
||||||
addTask: (taskInstance?: TaskPassback) => void;
|
addTask: (taskInstance?: TaskPassback) => void;
|
||||||
@ -21,7 +14,7 @@ type State = {
|
|||||||
show: boolean;
|
show: boolean;
|
||||||
titleVar: string;
|
titleVar: string;
|
||||||
descVar: string;
|
descVar: string;
|
||||||
prioVar: priority;
|
prioVar: Priority;
|
||||||
columnNumber: number;
|
columnNumber: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -62,7 +55,7 @@ class Header extends React.Component<HeaderProps, State> {
|
|||||||
|
|
||||||
handleSelectChange(event: React.ChangeEvent<HTMLSelectElement>) {
|
handleSelectChange(event: React.ChangeEvent<HTMLSelectElement>) {
|
||||||
if (event.target.id === "prioritySelect") {
|
if (event.target.id === "prioritySelect") {
|
||||||
const selectedValue = event.target.value as priority;
|
const selectedValue = event.target.value as Priority;
|
||||||
this.setState({ prioVar: selectedValue });
|
this.setState({ prioVar: selectedValue });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
ReactLearning/kanban-board/src/types/Priority.ts
Normal file
2
ReactLearning/kanban-board/src/types/Priority.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
type Priority = "normal" | "important" | "urgent";
|
||||||
|
export default Priority;
|
10
ReactLearning/kanban-board/src/types/TaskPassback.ts
Normal file
10
ReactLearning/kanban-board/src/types/TaskPassback.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import Priority from "./Priority";
|
||||||
|
|
||||||
|
type TaskPassback = {
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
priority: Priority;
|
||||||
|
column: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default TaskPassback;
|
Loading…
Reference in New Issue
Block a user