-
Notifications
You must be signed in to change notification settings - Fork 166
fix: replacing select with multiselect for content type picker modal [INTEG-3378] #10380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… removing `SelectedContentTypes` type
| @@ -1,9 +1,9 @@ | |||
| import { useState, useCallback } from 'react'; | |||
| import { SelectedContentType } from '../locations/Page/components/modals/step_2/SelectContentTypeModal'; | |||
| import { ContentTypeProps } from 'contentful-management'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 💪
apps/google-docs/src/locations/Page/components/modals/step_2/SelectContentTypeModal.tsx
Outdated
Show resolved
Hide resolved
| isLoading | ||
| ? 'Loading content types...' | ||
| : contentTypes.length === 0 | ||
| ? 'No content types in space' | ||
| : selectedContentTypes.length === 0 | ||
| ? 'Select one or more' | ||
| : `${selectedContentTypes.length} selected` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nested turnaries are hard for me to read to be honest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a helper function getPlaceHoldertext()
const getPlaceholderText = () => {
if (isLoading) return 'Loading content types...';
if (contentTypes.length === 0) return 'No content types in space';
if (selectedContentTypes.length === 0) return 'Select one or more';
return `${selectedContentTypes.length} selected`;
};
SelectedContentTypestype, usingContentTypePropscma type insteadhttps://contentful.atlassian.net/browse/INTEG-3378
Screen.Recording.2025-12-30.at.9.39.37.PM.mov