mirror of
https://github.com/Steffo99/todocolors.git
synced 2024-12-18 04:44:22 +00:00
i forgor again
This commit is contained in:
parent
1b6306b03c
commit
07e2cb391d
9 changed files with 13 additions and 13 deletions
|
@ -2,7 +2,7 @@ import {ICONS} from "@/app/[lang]/board/[board]/(api)/(task)/TaskIcon"
|
||||||
import {useBoardConsumer} from "@/app/[lang]/board/[board]/(layout)/(contextBoard)"
|
import {useBoardConsumer} from "@/app/[lang]/board/[board]/(layout)/(contextBoard)"
|
||||||
import {TaskEditorIcon} from "@/app/[lang]/board/[board]/(page)/(edit)/(task)/TaskEditorIcon"
|
import {TaskEditorIcon} from "@/app/[lang]/board/[board]/(page)/(edit)/(task)/TaskEditorIcon"
|
||||||
import {TaskEditorInput} from "@/app/[lang]/board/[board]/(page)/(edit)/(task)/TaskEditorInput"
|
import {TaskEditorInput} from "@/app/[lang]/board/[board]/(page)/(edit)/(task)/TaskEditorInput"
|
||||||
import {taskToString} from "@/app/[lang]/board/[board]/(page)/(edit)/taskToString"
|
import {taskToString} from "@/app/[lang]/board/[board]/(page)/(edit)/convertTTS"
|
||||||
import {TaskContainer} from "@/app/[lang]/board/[board]/(page)/(task)/TaskContainer"
|
import {TaskContainer} from "@/app/[lang]/board/[board]/(page)/(task)/TaskContainer"
|
||||||
import {TaskSimplifiedStatus} from "@/app/[lang]/board/[board]/(page)/(task)/TaskSimplifiedStatus"
|
import {TaskSimplifiedStatus} from "@/app/[lang]/board/[board]/(page)/(task)/TaskSimplifiedStatus"
|
||||||
import {useTaskEditor} from "@/app/[lang]/board/[board]/(page)/useTaskEditor"
|
import {useTaskEditor} from "@/app/[lang]/board/[board]/(page)/useTaskEditor"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {Task, TaskImportance} from "@/app/[lang]/board/[board]/(api)/(task)"
|
import {Task, TaskImportance} from "@/app/[lang]/board/[board]/(api)/(task)"
|
||||||
import {DEADLINE_GLYPH_RE} from "@/app/[lang]/board/[board]/(page)/(edit)/deadline"
|
import {DEADLINE_GLYPH_RE} from "@/app/[lang]/board/[board]/(page)/(edit)/taskDeadline"
|
||||||
import {ICON_DEFAULT, ICON_GLYPH_RE} from "@/app/[lang]/board/[board]/(page)/(edit)/icon"
|
import {ICON_DEFAULT, ICON_GLYPH_RE} from "@/app/[lang]/board/[board]/(page)/(edit)/taskIcon"
|
||||||
import {IMPORTANCE_GLYPH_RE} from "@/app/[lang]/board/[board]/(page)/(edit)/importance"
|
import {IMPORTANCE_GLYPH_RE} from "@/app/[lang]/board/[board]/(page)/(edit)/taskImportance"
|
||||||
import {default as dateParser} from "any-date-parser"
|
import {default as dateParser} from "any-date-parser"
|
||||||
|
|
||||||
// ahhh i love typescript shenanigans
|
// ahhh i love typescript shenanigans
|
||||||
|
@ -16,7 +16,7 @@ const VALUE_TO_TASK_IMPORTANCE = {
|
||||||
"5": TaskImportance.Lowest,
|
"5": TaskImportance.Lowest,
|
||||||
}
|
}
|
||||||
|
|
||||||
export function stringToTask(text: string, lang: string): Task {
|
export function convertSTT(text: string, lang: string): Task {
|
||||||
const importanceMatch = IMPORTANCE_GLYPH_RE.exec(text)
|
const importanceMatch = IMPORTANCE_GLYPH_RE.exec(text)
|
||||||
const iconMatch = ICON_GLYPH_RE.exec(text)
|
const iconMatch = ICON_GLYPH_RE.exec(text)
|
||||||
const deadlineMatch = DEADLINE_GLYPH_RE.exec(text)
|
const deadlineMatch = DEADLINE_GLYPH_RE.exec(text)
|
|
@ -1,7 +1,7 @@
|
||||||
import {Task, TaskImportance} from "@/app/[lang]/board/[board]/(api)/(task)"
|
import {Task, TaskImportance} from "@/app/[lang]/board/[board]/(api)/(task)"
|
||||||
import {DEADLINE_DEFAULT, DEADLINE_GLYPH_END, DEADLINE_GLYPH_START} from "@/app/[lang]/board/[board]/(page)/(edit)/deadline"
|
import {DEADLINE_DEFAULT, DEADLINE_GLYPH_END, DEADLINE_GLYPH_START} from "@/app/[lang]/board/[board]/(page)/(edit)/taskDeadline"
|
||||||
import {ICON_DEFAULT, ICON_GLYPH} from "@/app/[lang]/board/[board]/(page)/(edit)/icon"
|
import {ICON_DEFAULT, ICON_GLYPH} from "@/app/[lang]/board/[board]/(page)/(edit)/taskIcon"
|
||||||
import {IMPORTANCE_DEFAULT, IMPORTANCE_GLYPH} from "@/app/[lang]/board/[board]/(page)/(edit)/importance"
|
import {IMPORTANCE_DEFAULT, IMPORTANCE_GLYPH} from "@/app/[lang]/board/[board]/(page)/(edit)/taskImportance"
|
||||||
|
|
||||||
|
|
||||||
const TASK_IMPORTANCE_TO_VALUE = {
|
const TASK_IMPORTANCE_TO_VALUE = {
|
|
@ -1,6 +1,6 @@
|
||||||
import {ModifyTaskBoardRequest} from "@/app/[lang]/board/[board]/(api)/(request)"
|
import {ModifyTaskBoardRequest} from "@/app/[lang]/board/[board]/(api)/(request)"
|
||||||
import {useBoardConsumer} from "@/app/[lang]/board/[board]/(layout)/(contextBoard)"
|
import {useBoardConsumer} from "@/app/[lang]/board/[board]/(layout)/(contextBoard)"
|
||||||
import {taskToString} from "@/app/[lang]/board/[board]/(page)/(edit)/taskToString"
|
import {taskToString} from "@/app/[lang]/board/[board]/(page)/(edit)/convertTTS"
|
||||||
import {TaskActions} from "@/app/[lang]/board/[board]/(page)/(task)/TaskActions"
|
import {TaskActions} from "@/app/[lang]/board/[board]/(page)/(task)/TaskActions"
|
||||||
import {TaskContainer} from "@/app/[lang]/board/[board]/(page)/(task)/TaskContainer"
|
import {TaskContainer} from "@/app/[lang]/board/[board]/(page)/(task)/TaskContainer"
|
||||||
import {TaskDescription} from "@/app/[lang]/board/[board]/(page)/(task)/TaskDescription"
|
import {TaskDescription} from "@/app/[lang]/board/[board]/(page)/(task)/TaskDescription"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {DeleteTaskBoardRequest} from "@/app/[lang]/board/[board]/(api)/(request)"
|
import {DeleteTaskBoardRequest} from "@/app/[lang]/board/[board]/(api)/(request)"
|
||||||
import {useBoardConsumer} from "@/app/[lang]/board/[board]/(layout)/(contextBoard)"
|
import {useBoardConsumer} from "@/app/[lang]/board/[board]/(layout)/(contextBoard)"
|
||||||
import {taskToString} from "@/app/[lang]/board/[board]/(page)/(edit)/taskToString"
|
import {taskToString} from "@/app/[lang]/board/[board]/(page)/(edit)/convertTTS"
|
||||||
import {TaskButton} from "@/app/[lang]/board/[board]/(page)/(task)/TaskButton"
|
import {TaskButton} from "@/app/[lang]/board/[board]/(page)/(task)/TaskButton"
|
||||||
import {TaskWithId} from "@/app/[lang]/board/[board]/(page)/(task)/TaskWithId"
|
import {TaskWithId} from "@/app/[lang]/board/[board]/(page)/(task)/TaskWithId"
|
||||||
import {fas} from "@awesome.me/kit-dfe340c874/icons"
|
import {fas} from "@awesome.me/kit-dfe340c874/icons"
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import {Task} from "@/app/[lang]/board/[board]/(api)/(task)"
|
import {Task} from "@/app/[lang]/board/[board]/(api)/(task)"
|
||||||
import {stringToTask} from "@/app/[lang]/board/[board]/(page)/(edit)/stringToTask"
|
import {convertSTT} from "@/app/[lang]/board/[board]/(page)/(edit)/convertSTT"
|
||||||
import {taskToString} from "@/app/[lang]/board/[board]/(page)/(edit)/taskToString"
|
import {taskToString} from "@/app/[lang]/board/[board]/(page)/(edit)/convertTTS"
|
||||||
import {useCallback, useMemo, useState} from "react"
|
import {useCallback, useMemo, useState} from "react"
|
||||||
|
|
||||||
|
|
||||||
export function useTaskEditor(lang: string) {
|
export function useTaskEditor(lang: string) {
|
||||||
const [input, setInput] = useState<string>("")
|
const [input, setInput] = useState<string>("")
|
||||||
const task = useMemo(() => stringToTask(input, lang), [input, lang])
|
const task = useMemo(() => convertSTT(input, lang), [input, lang])
|
||||||
|
|
||||||
const setTask = useCallback((t: Task) => {
|
const setTask = useCallback((t: Task) => {
|
||||||
setInput(taskToString(t, lang))
|
setInput(taskToString(t, lang))
|
||||||
|
|
Loading…
Reference in a new issue