From 67e1082cf57944221fa60bd3c65ef8e3de80ebf9 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Fri, 14 Aug 2020 12:44:58 -0500 Subject: [PATCH] Updated placeholder component structures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Updated: - placeholder component structures --- .../placeholder/account_placeholder.js | 18 +++--- .../placeholder/comment_placeholder.js | 4 -- .../group_list_item_placeholder.js | 14 +++-- .../placeholder/list_item_placeholder.js | 16 ++--- .../placeholder/media_gallery_placeholder.js | 6 -- .../placeholder/notification_placeholder.js | 58 ++++++++++--------- .../placeholder/placeholder_layout.js | 37 ++++++------ .../profile_info_panel_placeholder.js | 2 +- 8 files changed, 76 insertions(+), 79 deletions(-) diff --git a/app/javascript/gabsocial/components/placeholder/account_placeholder.js b/app/javascript/gabsocial/components/placeholder/account_placeholder.js index cf8d789e..3f548186 100644 --- a/app/javascript/gabsocial/components/placeholder/account_placeholder.js +++ b/app/javascript/gabsocial/components/placeholder/account_placeholder.js @@ -2,12 +2,7 @@ import { CX } from '../../constants' import { getRandomInt } from '../../utils/numbers' import PlaceholderLayout from './placeholder_layout' -export default class AccountPlaceholder extends PureComponent { - - static propTypes = { - isLast: PropTypes.bool, - isSmall: PropTypes.bool, - } +class AccountPlaceholder extends PureComponent { render() { const { isLast, isSmall } = this.props @@ -38,11 +33,18 @@ export default class AccountPlaceholder extends PureComponent {
- +
) } -} \ No newline at end of file +} + +AccountPlaceholder.propTypes = { + isLast: PropTypes.bool, + isSmall: PropTypes.bool, +} + +export default AccountPlaceholder \ No newline at end of file diff --git a/app/javascript/gabsocial/components/placeholder/comment_placeholder.js b/app/javascript/gabsocial/components/placeholder/comment_placeholder.js index 73d69259..7d7d382f 100644 --- a/app/javascript/gabsocial/components/placeholder/comment_placeholder.js +++ b/app/javascript/gabsocial/components/placeholder/comment_placeholder.js @@ -4,10 +4,6 @@ import PlaceholderLayout from './placeholder_layout' export default class CommentPlaceholder extends PureComponent { - static propTypes = { - isLast: PropTypes.bool, - } - render() { const classes = CX({ default: 1, diff --git a/app/javascript/gabsocial/components/placeholder/group_list_item_placeholder.js b/app/javascript/gabsocial/components/placeholder/group_list_item_placeholder.js index 10ff3b3f..f223f283 100644 --- a/app/javascript/gabsocial/components/placeholder/group_list_item_placeholder.js +++ b/app/javascript/gabsocial/components/placeholder/group_list_item_placeholder.js @@ -2,12 +2,8 @@ import { CX } from '../../constants' import { getRandomInt } from '../../utils/numbers' import PlaceholderLayout from './placeholder_layout' -export default class GroupListItemPlaceholder extends PureComponent { +class GroupListItemPlaceholder extends PureComponent { - static propTypes = { - isLast: PropTypes.bool, - } - render() { const { isLast } = this.props @@ -32,4 +28,10 @@ export default class GroupListItemPlaceholder extends PureComponent { ) } -} \ No newline at end of file +} + +GroupListItemPlaceholder.propTypes = { + isLast: PropTypes.bool, +} + +export default GroupListItemPlaceholder \ No newline at end of file diff --git a/app/javascript/gabsocial/components/placeholder/list_item_placeholder.js b/app/javascript/gabsocial/components/placeholder/list_item_placeholder.js index f10cd55c..0aef0b4e 100644 --- a/app/javascript/gabsocial/components/placeholder/list_item_placeholder.js +++ b/app/javascript/gabsocial/components/placeholder/list_item_placeholder.js @@ -3,11 +3,7 @@ import { getRandomInt } from '../../utils/numbers' import PlaceholderLayout from './placeholder_layout' import ResponsiveClassesComponent from '../../features/ui/util/responsive_classes_component' -export default class ListItemPlaceholder extends PureComponent { - - static propTypes = { - isLast: PropTypes.bool, - } +class ListItemPlaceholder extends PureComponent { render() { const { isLast } = this.props @@ -36,11 +32,17 @@ export default class ListItemPlaceholder extends PureComponent { classNamesXS={classesXS} > - + ) } -} \ No newline at end of file +} + +ListItemPlaceholder.propTypes = { + isLast: PropTypes.bool, +} + +export default ListItemPlaceholder diff --git a/app/javascript/gabsocial/components/placeholder/media_gallery_placeholder.js b/app/javascript/gabsocial/components/placeholder/media_gallery_placeholder.js index fbfdf88b..cc93bc48 100644 --- a/app/javascript/gabsocial/components/placeholder/media_gallery_placeholder.js +++ b/app/javascript/gabsocial/components/placeholder/media_gallery_placeholder.js @@ -1,14 +1,8 @@ import PlaceholderLayout from './placeholder_layout' export default class MediaGalleryPlaceholder extends PureComponent { - - static propTypes = { - type: PropTypes.string, - } render() { - const { type } = this.props - return (
diff --git a/app/javascript/gabsocial/components/placeholder/notification_placeholder.js b/app/javascript/gabsocial/components/placeholder/notification_placeholder.js index 05dc38e3..43d84409 100644 --- a/app/javascript/gabsocial/components/placeholder/notification_placeholder.js +++ b/app/javascript/gabsocial/components/placeholder/notification_placeholder.js @@ -7,11 +7,7 @@ import { getRandomInt } from '../../utils/numbers' import ResponsiveComponent from '../../features/ui/util/responsive_component' import PlaceholderLayout from './placeholder_layout' -export default class NotificationPlaceholder extends PureComponent { - - static propTypes = { - isLast: PropTypes.bool, - } +class NotificationPlaceholder extends PureComponent { render() { const { isLast } = this.props @@ -42,21 +38,21 @@ export default class NotificationPlaceholder extends PureComponent {
- - - + + + - - - + + + - - - - + + + + - - + +
@@ -66,16 +62,16 @@ export default class NotificationPlaceholder extends PureComponent {
- - - - - - - - - - + + + + + + + + + +
@@ -85,4 +81,10 @@ export default class NotificationPlaceholder extends PureComponent { ) } -} \ No newline at end of file +} + +NotificationPlaceholder.propTypes = { + isLast: PropTypes.bool, +} + +export default NotificationPlaceholder diff --git a/app/javascript/gabsocial/components/placeholder/placeholder_layout.js b/app/javascript/gabsocial/components/placeholder/placeholder_layout.js index 9eb71bff..8139e4dc 100644 --- a/app/javascript/gabsocial/components/placeholder/placeholder_layout.js +++ b/app/javascript/gabsocial/components/placeholder/placeholder_layout.js @@ -2,26 +2,8 @@ import { defineMessages, injectIntl } from 'react-intl' import ContentLoader from 'react-content-loader' import { DEFAULT_THEME } from '../../constants' -const messages = defineMessages({ - loading: { id: 'loading_indicator.label', defaultMessage: 'Loading..' }, -}) - -const mapStateToProps = (state) => ({ - theme: state.getIn(['settings', 'displayOptions', 'theme'], DEFAULT_THEME), -}) - -export default -@injectIntl -@connect(mapStateToProps) class PlaceholderLayout extends PureComponent { - static propTypes = { - children: PropTypes.node, - intl: PropTypes.object.isRequired, - theme: PropTypes.string.isRequired, - viewBox: PropTypes.object.isRequired, - } - render() { const { intl, @@ -46,4 +28,21 @@ class PlaceholderLayout extends PureComponent { ) } -} \ No newline at end of file +} + +const messages = defineMessages({ + loading: { id: 'loading_indicator.label', defaultMessage: 'Loading...' }, +}) + +const mapStateToProps = (state) => ({ + theme: state.getIn(['settings', 'displayOptions', 'theme'], DEFAULT_THEME), +}) + +PlaceholderLayout.propTypes = { + children: PropTypes.node, + intl: PropTypes.object.isRequired, + theme: PropTypes.string.isRequired, + viewBox: PropTypes.object.isRequired, +} + +export default injectIntl(connect(mapStateToProps)(PlaceholderLayout)) diff --git a/app/javascript/gabsocial/components/placeholder/profile_info_panel_placeholder.js b/app/javascript/gabsocial/components/placeholder/profile_info_panel_placeholder.js index bc02de51..4cecca84 100644 --- a/app/javascript/gabsocial/components/placeholder/profile_info_panel_placeholder.js +++ b/app/javascript/gabsocial/components/placeholder/profile_info_panel_placeholder.js @@ -4,7 +4,7 @@ export default class ProfileInfoPanelPlaceholder extends PureComponent { render() { return ( -
+