-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: empty state within the dashboard to help guide users how to cre…
…ate their dashboard
- Loading branch information
1 parent
337bcaf
commit f59a069
Showing
4 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
packages/dashboard/src/components/internalDashboard/dashboardEmptyState.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.dashboard-empty-state { | ||
position: fixed; | ||
top: 50%; | ||
right: 50%; | ||
border: dashed; | ||
height: 200px; | ||
margin-top: -100px; | ||
width: 350px; | ||
margin-right: -125px; | ||
text-align: center; | ||
font-size: 16px !important; | ||
font-weight: 600 !important; | ||
} | ||
|
||
.dashboard-empty-state img { | ||
width: 50px; | ||
height: 50px; | ||
} |
30 changes: 30 additions & 0 deletions
30
packages/dashboard/src/components/internalDashboard/dashboardEmptyState.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import { | ||
colorTextBodySecondary, | ||
spaceStaticS, | ||
spaceStaticXs, | ||
spaceStaticXxl, | ||
spaceStaticXxxl, | ||
} from '@cloudscape-design/design-tokens'; | ||
|
||
import { default as lineSvg } from '../../customization/widgets/lineChart/line.svg'; | ||
import './dashboardEmptyState.css'; | ||
|
||
const emptyState = { | ||
borderColor: colorTextBodySecondary, | ||
borderRadius: spaceStaticXs, | ||
padding: spaceStaticXxxl, | ||
}; | ||
|
||
const DashboardEmptyState: React.FC = () => { | ||
return ( | ||
<div data-testid='empty-state' className='dashboard-empty-state' style={emptyState}> | ||
<div style={{ margin: spaceStaticXxl }}> | ||
<img style={{ margin: spaceStaticS }} src={lineSvg} alt='Line widget light icon' /> | ||
<div>Drag and drop your widget to the canvas.</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DashboardEmptyState; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters