Updating docs for BaseImage and BaseImagePlaceholder #15
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.
To Test
npm i
if you haven't alreadynpm run storybook
Caveats
When testing, you will notice that the documentation is not an exact copy of that from www-frontend. This is due to
<ArgsTable />
not working as expected inmdx
files in this repo. When usingArgsTable
, an error of "Args not valid" would appear. Oddly, the automatically generated ArgsTable works just fine when not creating a custom docs page via MDX. I figured a working ArgsTable would be preferred, so I stuck with using automatically generated docs pages (we used custom docs pages in www-frontend, which is why I went down this path).To make up the differences, I added field descriptions to the argsTable and also marked required fields. I also decided some documentation from the original www-frontend wasn't necessary, as it was evident in the dropdown menus (i.e. the list of object fit classes and aspect ratio classes)
Documented below is how we would implement mdx files if ArgsTable was working (for future reference!):
Expand MDX method example
BaseImage.stories.js
BaseImage.stories.mdx
to the same folder: