Skip to content

Commit

Permalink
Apply progressive loader to whole dashboard item component (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
neeilya authored Apr 15, 2019
1 parent ad3e3c3 commit 78c6dea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
21 changes: 8 additions & 13 deletions src/components/Item/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import ListItem from './ListItem/Item';
import TextItem from './TextItem/Item';
import AppItem from './AppItem/Item';
import SpacerItem from './SpacerItem/Item';
import ProgressiveLoadingContainer from './ProgressiveLoadingContainer';
import {
APP,
REPORT_TABLE,
Expand Down Expand Up @@ -53,17 +52,13 @@ export const Item = props => {
const GridItem = getGridItem(props.item.type);

return (
<ProgressiveLoadingContainer>
<GridItem
item={props.item}
editMode={props.editMode}
itemFilters={
props.editMode
? DEFAULT_STATE_ITEM_FILTERS
: props.itemFilters
}
onToggleItemExpanded={props.onToggleItemExpanded}
/>
</ProgressiveLoadingContainer>
<GridItem
item={props.item}
editMode={props.editMode}
itemFilters={
props.editMode ? DEFAULT_STATE_ITEM_FILTERS : props.itemFilters
}
onToggleItemExpanded={props.onToggleItemExpanded}
/>
);
};
8 changes: 6 additions & 2 deletions src/components/ItemGrid/ItemGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
sGetDashboardById,
sGetDashboardItems,
} from '../../reducers/dashboards';
import ProgressiveLoadingContainer from '../Item/ProgressiveLoadingContainer';

// Component

Expand Down Expand Up @@ -137,7 +138,10 @@ export class ItemGrid extends Component {
].join(' ');

return (
<div key={item.i} className={itemClassNames}>
<ProgressiveLoadingContainer
key={item.i}
className={itemClassNames}
>
{edit ? (
<DeleteItemButton
onClick={this.onRemoveItemWrapper(
Expand All @@ -152,7 +156,7 @@ export class ItemGrid extends Component {
this.onToggleItemExpanded
}
/>
</div>
</ProgressiveLoadingContainer>
);
})}
</ReactGridLayout>
Expand Down

0 comments on commit 78c6dea

Please sign in to comment.