Skip to content

Commit

Permalink
fix: improve tags preview, fix placeholder text
Browse files Browse the repository at this point in the history
  • Loading branch information
louisewang1 committed Mar 1, 2022
1 parent 01ac543 commit ad1519d
Show file tree
Hide file tree
Showing 3 changed files with 252 additions and 221 deletions.
2 changes: 1 addition & 1 deletion src/components/item/sharing/CategorySelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const CategorySelection = ({ item, edit }) => {
// eslint-disable-next-line react/jsx-props-no-spreading
{...params}
variant="outlined"
placeholder={t('Please choose from the list')}
placeholder={t('Please choose from list')}
/>
)}
/>
Expand Down
11 changes: 9 additions & 2 deletions src/components/item/sharing/CustomizedTagsEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import { useParams } from 'react-router';
import { MUTATION_KEYS } from '@graasp/query-client';
import { useMutation } from '../../../config/queryClient';
import { CurrentUserContext } from '../../context/CurrentUserContext';
import { buildCustomizedTagsSelector, ITEM_TAGS_EDIT_INPUT_ID, ITEM_TAGS_EDIT_SUBMIT_BUTTON_ID } from '../../../config/selectors';
import {
buildCustomizedTagsSelector,
ITEM_TAGS_EDIT_INPUT_ID,
ITEM_TAGS_EDIT_SUBMIT_BUTTON_ID,
} from '../../../config/selectors';

const useStyles = makeStyles((theme) => ({
title: {
Expand Down Expand Up @@ -59,7 +63,10 @@ const CustomizedTagsEdit = ({ item, edit }) => {
const handleSubmit = (event) => {
event.preventDefault();
const tagsList =
displayValues?.split(',').map((entry) => entry.trim()) || [];
displayValues
?.split(',')
.map((entry) => entry.trim())
.filter(Boolean) || [];
updateCustomizedTags({
id: itemId,
name: itemName,
Expand Down
Loading

0 comments on commit ad1519d

Please sign in to comment.