1
Fork 0
mirror of https://github.com/Steffo99/todocolors.git synced 2024-10-16 07:17:28 +00:00

Pass lang down

This commit is contained in:
Steffo 2024-09-14 00:19:13 +02:00
parent cd05b15c7b
commit 1b6306b03c
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
2 changed files with 4 additions and 2 deletions

View file

@ -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}
/>

View file

@ -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])