-
Notifications
You must be signed in to change notification settings - Fork 4
Add UI samples to storybook #61
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
Conversation
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.
Glorious!! I add a few comments, but this is so awesome, thank you!
, C.ExternalHref "link 3" |> N.navItem "item 3" | ||
, C.ExternalHref "link 4" |> N.navItem "item 4" | ||
] | ||
|> Array.fromList |
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.
What do we get from Array over List here?
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.
It was to access one element by its index, but I change it to simply use List.
import Card from "./Card.elm"; | ||
import ErrorCard from "./ErrorCard.elm"; | ||
import Banner from "./Banner.elm"; | ||
import CopyField from "./CopyField.elm"; |
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.
I think this one also has a webcomponent associated with it that we'd want to import in the js world.
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.
Ok. So are there different ways to use Elm components, other than writing like this?
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.
Yeah there's a few Elm modules that have a WebComponent pair to do native JavaScript stuff. In this case its src/UI/CopyOnClick.js
, which need to be included in the bundle for copy to work (the other examples are OnClickOutside.js
, EmbedSvg.js
, EmbedMermaid.js
, and EmbedKatex.js
FWIW).
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.
I see. I changed the code to import CopyOnClick.js
🎉 |
I've added these UI elements to storybook: