Skip to content

Commit

Permalink
fix(dashboardeditor): add padding around skeletontext in loading
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdickerson committed Dec 9, 2020
1 parent 9986d4f commit 7da9a63
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
13 changes: 5 additions & 8 deletions src/components/DashboardEditor/DashboardEditor.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { InlineNotification } from 'carbon-components-react';
import { InlineNotification, SkeletonText } from 'carbon-components-react';
import isNil from 'lodash/isNil';
import classnames from 'classnames';
import update from 'immutability-helper';
Expand All @@ -11,12 +11,7 @@ import {
CARD_ACTIONS,
CARD_TYPES,
} from '../../constants/LayoutConstants';
import {
DashboardGrid,
CardEditor,
ErrorBoundary,
SkeletonText,
} from '../../index';
import { DashboardGrid, CardEditor, ErrorBoundary } from '../../index';
import ImageGalleryModal, {
ImagePropTypes,
} from '../ImageGalleryModal/ImageGalleryModal';
Expand Down Expand Up @@ -394,7 +389,9 @@ const DashboardEditor = ({
});

return isLoading ? (
<SkeletonText width="30%" />
<div className={baseClassName}>
<SkeletonText width="30%" />
</div>
) : (
<div className={baseClassName}>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4326,14 +4326,18 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT Exper
}
}
>
<p
className="bx--skeleton__text"
style={
Object {
"width": "30%",
<div
className="iot--dashboard-editor"
>
<p
className="bx--skeleton__text"
style={
Object {
"width": "30%",
}
}
}
/>
/>
</div>
</div>
</div>
<button
Expand Down
4 changes: 4 additions & 0 deletions src/components/DashboardEditor/_dashboard-editor.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.#{$iot-prefix}--dashboard-editor {
display: flex;
height: 100%;
> .#{$prefix}--skeleton__text {
margin-top: 1rem;
margin-left: 1rem;
}

&__overflow {
overflow-x: auto; // allows a larger width
Expand Down

0 comments on commit 7da9a63

Please sign in to comment.