Skip to content
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

Update IconType and its proptype usage #1913

Conversation

chandlerprall
Copy link
Contributor

Summary

Fixes IconType to accept ReactElements, EuiIcon provides a proptype for IconType for usage by other components.

@chandlerprall chandlerprall requested review from snide and thompsongl May 2, 2019 19:26
export type IconType = EuiIconType | string | ReactElement;

export const IconPropType = PropTypes.oneOfType([
PropTypes.string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this bust IDE auto suggest because it no longer knows that the strings that are accepted also include the enums?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WebStorm still autosuggests/completes the available string constants, both when used internally by another EUI component and when used by a consuming application.

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Generated eui.d.ts locally and it also looks good

@chandlerprall chandlerprall merged commit 68151c0 into elastic:feature/dynamic-euiicon May 7, 2019
@chandlerprall chandlerprall deleted the feature/euiicon-icontype branch May 7, 2019 16:26
chandlerprall added a commit that referenced this pull request May 7, 2019
…rnal urls (#1924)

* Feature/icon breakapart (#1856)

* dynamic import

* Make the icon kinda work

* progress

* generate tsx from svg

* Build and commit icons TSX

* Updated Icon snapshots

* Updated EuiIcon build to again work in dependant projects

* Create a single eui.js build, bundling EuiIcon's dynamic import into the build

* Tests are passing

* Add a loading class to EuiIcon

* Added -isLoaded and using animations for fading

* update snapshots

* Remove background color from isLoaded state

* PR feedback

* Docs for EuiIcon new abilities (#1889)

Add docs for the custom svg abilities in EuiIcon

* DOCS ONLY: Allow multiple snippets (#1908)

* Update IconType and its proptype usage (#1913)

* Expand IconType to include string

* Update EuiIcon IconType to include Element, fix some TS issues, widen the EuiIcon IconType proptype

* Swap Vim example logo out for SVG example logo, which contains a viewBox for IE11 compat

* changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants