-
Notifications
You must be signed in to change notification settings - Fork 151
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
Setup nextjs demo page #183
Conversation
|
Yeah, I think you're right to be uncertain there. imo the example should become a real-world app, something that gives us a way to demonstrate realistic use cases for each piece of |
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.
Can you remove example/package-lock.json
and make sure it's working as a workspace with yarn
?
That's precisely what I was thinking. The Storybook is great at showcasing the components and hooks in isolation, but something that people can play around with directly (we will deploy this example to Vercel or sth) and maybe clone the code and try it out for themselves would be nice too. Maybe this can even turn into a starter template with our package all setup and ready-to-go, |
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.
Just one tiny change. I'll do this myself, push and merge :) Thanks @etr2460!
example/pages/_app.tsx
Outdated
@@ -3,7 +3,7 @@ import { Provider } from '@web3-ui/core'; | |||
|
|||
function MyApp({ Component, pageProps }) { | |||
return ( | |||
<Provider network={4}> | |||
<Provider network={1}> |
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.
<Provider network={1}> | |
<Provider network={NETWORKS.mainnet}> |
More readable. NETWORKS
is exported from core
and hooks
!
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.
fixed
Oh I missed @with-heart's review. Will also try to have a look at that. |
Cross posting from discord, the examples directory was initially setup with npm, not yarn. i'm not sure if that was intentional. Maybe there's some questions here to be answered first:
Once we answer both of these, we can decide if this PR should be updated, or if we should simply delete the examples directory for now |
I think we do need an example because of the reasons I mentioned here. Tldr; storybook is good for showcasing stuff in isolation but we need an real-world 'app' example where people can see how all of that stuff actually works together.
It should use yarn because that's what we are using everywhere else in the project. The package-lock.json was unintentional. Sorry for that. |
f009233
to
320ebc4
Compare
320ebc4
to
7d694d4
Compare
@Dhaiwat10, @with-heart this should be g2g now |
@@ -24,7 +24,7 @@ | |||
"test:coverage": "jest --coverage --colors", | |||
"storybook": "start-storybook -p 9001 -s ./packages/components/src/assets -c .storybook", | |||
"postinstall": "preconstruct dev", | |||
"example": "yarn workspace example dev", | |||
"example": "yarn build && yarn workspace example dev", |
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.
for nextjs to load the packages, we need to yarn build
them first. This isn't technically correct as the examples should depend on a version of the packages and not the main
branch of them, but I couldn't for the life of me figure out how to get yarn to pull in the packages from npm instead of symlinks. Maybe there was a caching issue, but this seems good enough for me
Way to go @etr2460 ❤️ |
Closes #182
Description
Fixes a few issues with the next js demo setup and adds a very basic demo page that verifies components work. Also converts everything to using TS
📝 Additional Information
There's probably still more work to be done to make a good demo page. I'm also a bit uncertain if a demo page is necessary in addition to the storybook. Food for thought
Screenshot