-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docs EuiEmptyPrompt] Add new page not found illustration #6061
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -13,8 +13,11 @@ import { | |
IconType, | ||
} from '../../../../src/components'; | ||
|
||
import pageNotFoundLight from '../../images/empty-prompt/404_rainy_cloud_light.png'; | ||
import pageNotFoundDark from '../../images/empty-prompt/404_rainy_cloud_dark.png'; | ||
import pageNotFoundDark from '../../images/empty-prompt/pageNotFound--dark.png'; | ||
import pageNotFoundLight from '../../images/empty-prompt/pageNotFound--light.png'; | ||
import pageNotFoundDark2x from '../../images/empty-prompt/[email protected]'; | ||
import pageNotFoundLight2x from '../../images/empty-prompt/[email protected]'; | ||
|
||
import noResultsLight from '../../images/empty-prompt/no-results--light.svg'; | ||
import noResultsDark from '../../images/empty-prompt/no-results--dark.svg'; | ||
|
||
|
@@ -31,6 +34,8 @@ export const typesOfUseCases: { | |
iconLoading?: ReactNode; | ||
iconLight?: string; | ||
iconDark?: string; | ||
iconLight2x?: string; | ||
iconDark2x?: string; | ||
iconType?: IconType; | ||
title: ReactNode; | ||
body?: ReactNode; | ||
|
@@ -218,6 +223,8 @@ export const typesOfUseCases: { | |
example: { | ||
iconLight: pageNotFoundLight, | ||
iconDark: pageNotFoundDark, | ||
iconLight2x: pageNotFoundLight2x, | ||
iconDark2x: pageNotFoundDark2x, | ||
title: <h2>Page not found</h2>, | ||
body: ( | ||
<p> | ||
|
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 |
---|---|---|
|
@@ -6,19 +6,30 @@ import { | |
EuiButtonEmpty, | ||
} from '../../../../../src/components'; | ||
import { ThemeContext } from '../../../components/with_theme'; | ||
import pageNotFoundLight from '../../../images/empty-prompt/404_rainy_cloud_light.png'; | ||
import pageNotFoundDark from '../../../images/empty-prompt/404_rainy_cloud_dark.png'; | ||
|
||
import pageNotFoundDark from '../../../images/empty-prompt/pageNotFound--dark.png'; | ||
import pageNotFoundLight from '../../../images/empty-prompt/pageNotFound--light.png'; | ||
import pageNotFoundDark2x from '../../../images/empty-prompt/[email protected]'; | ||
import pageNotFoundLight2x from '../../../images/empty-prompt/[email protected]'; | ||
|
||
export default () => { | ||
const themeContext = useContext(ThemeContext); | ||
const isDarkTheme = themeContext.theme.includes('dark'); | ||
|
||
const iconImg: string = isDarkTheme ? pageNotFoundDark : pageNotFoundLight; | ||
const pageNotFound = isDarkTheme ? pageNotFoundDark : pageNotFoundLight; | ||
const pageNotFound2x = isDarkTheme ? pageNotFoundDark2x : pageNotFoundLight2x; | ||
|
||
return ( | ||
<EuiEmptyPrompt | ||
color="subdued" | ||
icon={<EuiImage size="fullWidth" src={iconImg} alt="" />} | ||
icon={ | ||
<EuiImage | ||
size="fullWidth" | ||
srcSet={`${pageNotFound} 1x, ${pageNotFound2x} 2x`} | ||
src={pageNotFound} | ||
alt="" | ||
/> | ||
} | ||
title={<h2>Page not found</h2>} | ||
layout="vertical" | ||
body={ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thompsongl this is a pattern that I would like to get solved for our EuiIllustration project.
We're going to use
.png
as agreed with the Design team. Should we enforce retina images and a fallback for non-retina displays?Let me know what do you think?
Once the EuiIllustration is ready we should replace all the
<EuiEmptyPrompt icon={<EuiImage />} />
with<EuiEmptyPrompt icon={<EuiIllustration />} />
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
srcSet
!We should definitely have strong recommendations in documentation for supporting multiple screen resolutions, but the only way I see to enforce it with code would be to throw an error if the 1x or 2x file isn't found.
If I understand
EuiIllustration
correctly, consumers cannot simply provide custom illustrations. So we will have codeowner/review control over what illustrations are added and can ensure that any new images support multiple resolutions.