Updates/adds to prop-types for homepage feed makeover. (#6128)
This commit is contained in:
parent
21d88399be
commit
bd24cf2a05
3 changed files with 45 additions and 0 deletions
|
|
@ -0,0 +1,42 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import { tagPropTypes } from './tag-prop-types';
|
||||
import { organizationPropType } from './organization-prop-type';
|
||||
|
||||
export const articleSnippetResultPropTypes = PropTypes.shape({
|
||||
body_text: PropTypes.shape({
|
||||
matchLevel: PropTypes.oneOf(['full', 'none']),
|
||||
value: PropTypes.string.isRequired,
|
||||
}),
|
||||
comments_blob: PropTypes.shape({
|
||||
matchLevel: PropTypes.oneOf(['full', 'none']),
|
||||
value: PropTypes.string.isRequired,
|
||||
}),
|
||||
});
|
||||
|
||||
export const articlePropTypes = PropTypes.shape({
|
||||
id: PropTypes.number.isRequired,
|
||||
title: PropTypes.string.isRequired,
|
||||
path: PropTypes.string.isRequired,
|
||||
cloudinary_video_url: PropTypes.string,
|
||||
video_duration_in_minutes: PropTypes.number,
|
||||
type_of: PropTypes.oneOf(['podcast_episodes']),
|
||||
class_name: PropTypes.oneOf(['PodcastEpisode', 'User', 'Article']),
|
||||
flare_tag: tagPropTypes,
|
||||
tag_list: PropTypes.arrayOf(PropTypes.string),
|
||||
cached_tag_list_array: PropTypes.arrayOf(PropTypes.string),
|
||||
podcast: PropTypes.shape({
|
||||
slug: PropTypes.string.isRequired,
|
||||
title: PropTypes.string.isRequired,
|
||||
image_url: PropTypes.string.isRequired,
|
||||
}),
|
||||
user_id: PropTypes.string.isRequired,
|
||||
user: PropTypes.shape({
|
||||
username: PropTypes.string.isRequired,
|
||||
name: PropTypes.string.isRequired,
|
||||
}),
|
||||
organization: organizationPropType,
|
||||
_snippetResult: articleSnippetResultPropTypes,
|
||||
positive_reactions_count: PropTypes.number,
|
||||
reactions_count: PropTypes.number,
|
||||
comments_count: PropTypes.number,
|
||||
});
|
||||
|
|
@ -2,3 +2,4 @@ export * from './user-prop-types';
|
|||
export * from './default-children-prop-types';
|
||||
export * from './organization-prop-type';
|
||||
export * from './tag-prop-types';
|
||||
export * from './article-prop-types';
|
||||
|
|
|
|||
|
|
@ -3,4 +3,6 @@ import PropTypes from 'prop-types';
|
|||
export const organizationPropType = PropTypes.shape({
|
||||
id: PropTypes.number.isRequired,
|
||||
name: PropTypes.string.isRequired,
|
||||
slug: PropTypes.string.isRequired,
|
||||
profile_image_90: PropTypes.string.isRequired,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue