CivicTechTO / polis-storybook

https://civictechto.github.io/polis-storybook/
GNU Affero General Public License v3.0
1 stars 0 forks source link

Add alternative conversation sources of story data #19

Open patcon opened 2 weeks ago

patcon commented 2 weeks ago

Can adapt the import utils to allow selecting between different datasets. For starters, it'd be great to just manually change a hardcoded import to point to other files.

https://github.com/CivicTechTO/polis-storybook/blob/main/.storybook/utils.js

For starters, it feels safe to just make it easy to edit .storybook/utils.js to import from diff files when needed. Then it's easy to check locally how things look, but not publicly explorable. That way, we don't have to fix up all the stories that likely have assumptions of using the first dataset.


Stretch goal (maybe for a second PR) might be to allow dynamic imports: https://stackoverflow.com/questions/47954655/dynamic-imports-in-es6-with-runtime-variables

Or alternatively, using filesystem core pkgs to read files from a publicly hosted directory (something that can be available at and hosted path in the hosted storybook, rather than compiled in at build time).