mirror of
https://github.com/Steffo99/todocolors.git
synced 2024-11-22 00:04:18 +00:00
Pass lang down
This commit is contained in:
parent
cd05b15c7b
commit
1b6306b03c
2 changed files with 4 additions and 2 deletions
|
@ -104,6 +104,7 @@ export function TaskViewer({lang, t, taskWithId: [id, task], setEditorInput}: {l
|
|||
goAwayButton = (
|
||||
<TaskViewerRecreateButton
|
||||
t={t}
|
||||
lang={lang}
|
||||
taskWithId={[id, task]}
|
||||
setEditorInput={setEditorInput}
|
||||
/>
|
||||
|
|
|
@ -10,12 +10,13 @@ import {Dispatch, SetStateAction, SyntheticEvent, useCallback} from "react"
|
|||
|
||||
export type TaskViewerRecreateButtonProps = {
|
||||
t: TFunction,
|
||||
lang: string,
|
||||
taskWithId: TaskWithId,
|
||||
setEditorInput: Dispatch<SetStateAction<string>>,
|
||||
}
|
||||
|
||||
|
||||
export function TaskViewerRecreateButton({t, taskWithId: [id, task], setEditorInput}: TaskViewerRecreateButtonProps) {
|
||||
export function TaskViewerRecreateButton({t, lang, taskWithId: [id, task], setEditorInput}: TaskViewerRecreateButtonProps) {
|
||||
const {sendRequest, boardState: {locked}} = useBoardConsumer()
|
||||
|
||||
const recreateTask = useCallback((e: SyntheticEvent<HTMLButtonElement>) => {
|
||||
|
@ -26,7 +27,7 @@ export function TaskViewerRecreateButton({t, taskWithId: [id, task], setEditorIn
|
|||
}
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
setEditorInput(taskToString(task))
|
||||
setEditorInput(taskToString(task, lang))
|
||||
const request: DeleteTaskBoardRequest = {"Task": [id, null]};
|
||||
sendRequest(request)
|
||||
}, [task, setEditorInput, sendRequest])
|
||||
|
|
Loading…
Reference in a new issue