-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sergio Clebal
authored
Oct 1, 2021
1 parent
fdd000f
commit af244af
Showing
12 changed files
with
149 additions
and
73 deletions.
There are no files selected for viewing
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
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
42 changes: 42 additions & 0 deletions
42
packages/react-ui/storybook/stories/widgets/NoDataAlert.stories.js
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,42 @@ | ||
import React from 'react'; | ||
import NoDataAlert from '../../../../react-widgets/src/widgets/NoDataAlert'; | ||
import { buildReactPropsAsString } from '../../utils'; | ||
|
||
const options = { | ||
title: 'Widgets/NoDataAlert', | ||
component: NoDataAlert, | ||
argTypes: { | ||
title: { | ||
table: { | ||
type: { | ||
summary: 'string' | ||
} | ||
}, | ||
control: { type: 'text' } | ||
}, | ||
body: { | ||
table: { | ||
type: { | ||
summary: 'string' | ||
} | ||
}, | ||
control: { type: 'text' } | ||
} | ||
} | ||
}; | ||
|
||
export default options; | ||
|
||
const Template = (args) => <NoDataAlert {...args} />; | ||
|
||
export const Empty = Template.bind({}); | ||
Empty.args = {}; | ||
Empty.parameters = buildReactPropsAsString({}, 'NoDataAlert'); | ||
|
||
export const CustomTexts = Template.bind({}); | ||
const CustomTextsProps = { | ||
titlee: 'Example', | ||
body: "Hey, I've modified the NoDataAlert component" | ||
}; | ||
CustomTexts.args = CustomTextsProps; | ||
CustomTexts.parameters = buildReactPropsAsString(CustomTextsProps, 'NoDataAlert'); |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import { Alert, AlertTitle } from '@material-ui/lab'; | ||
import { Box } from '@material-ui/core'; | ||
|
||
function NoDataAlert({ | ||
title = 'No data available', | ||
body = 'There are no results for the combination of filters applied to your data. Try tweaking your filters, or zoom and pan the map to adjust the Map View.' | ||
}) { | ||
return ( | ||
<Alert severity='warning'> | ||
{title && <AlertTitle>{title}</AlertTitle>} | ||
{body || <Box mt={-1} />} | ||
</Alert> | ||
); | ||
} | ||
|
||
export default NoDataAlert; |
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
Oops, something went wrong.