1
Fork 0
mirror of https://github.com/Steffo99/todocolors.git synced 2024-11-21 15:54:18 +00:00

Pass lang down

This commit is contained in:
Steffo 2024-09-13 23:43:28 +02:00
parent 8de6ddebb4
commit a39ec41a19
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
4 changed files with 5 additions and 4 deletions

View file

@ -12,7 +12,7 @@ import {SyntheticEvent, useCallback} from "react"
import style from "./TaskEditor.module.css"
export function TaskEditor({t, className, editorHook: {input, setInput, task, setTask}}: { t: TFunction, className?: string, editorHook: ReturnType<typeof useTaskEditor> }) {
export function TaskEditor({lang, t, className, editorHook: {input, setInput, task, setTask}}: { lang: string, t: TFunction, className?: string, editorHook: ReturnType<typeof useTaskEditor> }) {
const {isReady, sendRequest} = useBoardConsumer()
const nextIcon = useCallback((e: SyntheticEvent<HTMLButtonElement>) => {
@ -33,7 +33,7 @@ export function TaskEditor({t, className, editorHook: {input, setInput, task, se
return
}
sendRequest({"Task": [null, task]})
setInput(taskToString({...task, text: ""}))
setInput(taskToString({...task, text: ""}, lang))
}, [sendRequest, task, setInput])
if(!isReady) {

View file

@ -6,7 +6,7 @@ import {TFunction} from "i18next"
import style from "./BoardEditor.module.css"
export function BoardEditor({className, t, editorHook}: {className?: string, t: TFunction, editorHook: ReturnType<typeof useTaskEditor>}) {
export function BoardEditor({className, lang, t, editorHook}: {className?: string, lang: string, t: TFunction, editorHook: ReturnType<typeof useTaskEditor>}) {
const {boardState: {locked}} = useBoardConsumer()
if(locked) return null;

View file

@ -37,6 +37,7 @@ export function BoardPage({lang}: {lang: string}) {
setEditorInput={editorHook.setInput}
/>
<BoardEditor
lang={lang}
t={t}
className={style.pageEditor}
editorHook={editorHook}

2
todored/Cargo.lock generated
View file

@ -1151,7 +1151,7 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "todored"
version = "0.3.0"
version = "0.4.0"
dependencies = [
"axum",
"chrono",