Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

feat: add helper text #1419

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/input/MultiSelectChipInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import {
Typography,
} from '@mui/material';

import { useBuilderTranslation } from '@/config/i18n';
import {
MULTI_SELECT_CHIP_ADD_BUTTON_ID,
MULTI_SELECT_CHIP_CONTAINER_ID,
MULTI_SELECT_CHIP_INPUT_ID,
buildMultiSelectChipsSelector,
} from '@/config/selectors';
import { BUILDER } from '@/langs/constants';

import { useMultiSelectChipInput } from './MultiSelectChipInput.hook';

Expand All @@ -31,6 +33,7 @@ export const MultiSelectChipInput = ({
label,
onSave,
}: Props): JSX.Element | null => {
const { t } = useBuilderTranslation();
const {
values,
currentValue,
Expand Down Expand Up @@ -68,12 +71,12 @@ export const MultiSelectChipInput = ({
{...params}
variant="outlined"
label={label}
helperText={t(BUILDER.ITEM_TAGS_HELPER_TEXT)}
inputProps={{
...params.inputProps,
value: currentValue,
}}
error={hasError}
// helperText={error}
sx={{
// Avoid to resize the textfield on hover when next tag will be on new line.
'& .MuiAutocomplete-input': {
Expand Down
1 change: 1 addition & 0 deletions src/langs/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ export const BUILDER = {
ITEM_TAGS_CHIP_BUTTON_EDIT: 'ITEM_TAGS_CHIP_BUTTON_EDIT',
ITEM_TAGS_TITLE: 'ITEM_TAGS_TITLE',
ITEM_TAGS_LABEL: 'ITEM_TAGS_LABEL',
ITEM_TAGS_HELPER_TEXT: 'ITEM_TAGS_HELPER_TEXT',
ITEM_TAGS_MISSING_WARNING: 'ITEM_TAGS_MISSING_WARNING',
ITEMS_GRID_ITEMS_PER_PAGE_TITLE: 'ITEMS_GRID_ITEMS_PER_PAGE_TITLE',
ITEMS_TABLE_ACTIONS_HEADER: 'ITEMS_TABLE_ACTIONS_HEADER',
Expand Down
1 change: 1 addition & 0 deletions src/langs/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
"ITEM_TAGS_CHIP_BUTTON_EDIT": "Edit Tags",
"ITEM_TAGS_TITLE": "Tags",
"ITEM_TAGS_LABEL": "Edit tags",
"ITEM_TAGS_HELPER_TEXT": "Use the 'Enter' key to add a new tag",
"ITEM_TAGS_MISSING_WARNING": "Add at least one tag to better explain who could use your publication",
"ITEMS_GRID_ITEMS_PER_PAGE_TITLE": "Items per page",
"ITEMS_TABLE_ACTIONS_HEADER": "Actions",
Expand Down