Skip to content

Commit d8906a5

Browse files
committed
feat: add labels to form fields
1 parent d90f647 commit d8906a5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

apps/frontend/src/components/questionnaire/calendar/EntryForm.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { isInRange, isNotEmpty, useForm } from "@mantine/form";
2-
import { Button, Group, Stack, TimeInput, NumberInput, ActionIcon, IconMinus, Flex } from "@quassel/ui";
2+
import { Button, Group, Stack, TimeInput, NumberInput, ActionIcon, IconMinus } from "@quassel/ui";
33
import { i18n } from "../../../stores/i18n";
44
import { useStore } from "@nanostores/react";
55
import { useEffect } from "react";
@@ -18,6 +18,8 @@ type FormValues = {
1818

1919
const messages = i18n("entityForm", {
2020
addDialectAction: "Add dialect",
21+
labelCarer: "Carer",
22+
labelLanguage: "Language",
2123
validationRatio: "Ratio must be between 1 and 100.",
2224
validationTotalRatio: "Total Ratio must always be 100%.",
2325
validationNotEmpty: "Field must not be empty.",
@@ -84,13 +86,13 @@ export function EntityForm({ onSave, actionLabel, entry }: EntityFormProps) {
8486
return (
8587
<form onSubmit={f.onSubmit(onSave)}>
8688
<Stack>
87-
<CarerSelect {...f.getInputProps("carerId")} />
89+
<CarerSelect {...f.getInputProps("carerId")} placeholder={t.labelCarer} />
8890

8991
{f.getValues().languageEntries.map((_, index) => (
9092
// TODO: make key either languageId or name of new language entry
9193
<Group key={`entry-${index}`} justify="stretch">
92-
<NumberInput {...f.getInputProps(`languageEntries.${index}.ratio`)} max={100} min={1} w={80} />
93-
<LanguageSelect {...f.getInputProps(`languageEntries.${index}.languageId`)} flex={1} />
94+
<NumberInput {...f.getInputProps(`languageEntries.${index}.ratio`)} max={100} min={1} w={80} rightSection="%" />
95+
<LanguageSelect {...f.getInputProps(`languageEntries.${index}.languageId`)} flex={1} placeholder={t.labelLanguage} />
9496
{!!index && (
9597
<ActionIcon
9698
variant="light"

0 commit comments

Comments
 (0)