-
Notifications
You must be signed in to change notification settings - Fork 36
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
Autogenerated filename #127
Conversation
@AsynchronousAI is attempting to deploy a commit to the CP Initiative Team on Vercel. A member of the Team first needs to authorize it. |
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.
nice! a couple minor things:
- placeholder should be applied to the input, not to the label
- right now, every rerender will change the placeholder. maybe make
defaultFileName
a state, and add auseEffect
to set the default file name once when the component is mounted. - you'll need to modify the handleSubmit function to use the defaultFileName if fileName is an empty string.
That's my bad, sorry.
I switched everything to set the |
Also I was having trouble with |
Instructions are here, though they're not that thorough: https://github.com/cpinitiative/ide?tab=readme-ov-file#running-locally What issue were you having? |
My server was incorrectly setup. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 it may make more sense to move src/fileName.ts
to src/scripts/generateRandomFileNamets
, keep it as export default generateRandomFileName
, and change the import to not have the curly braces (ie. import generateRandomFileName from ...
. Open to other ideas though!
To get the current code working, you have to remove "default" from the "export default ...". Or, remove the curly braces from import { generateRandomFileName }.
Thanks for making this PR!
I made it so that the file name generator is in the new.tsx file itself just to avoid file abundance, I also only added like 15 adjetives and 15 nouns so the file doesn't get too large. |
Hmm, I think after the auto-formatter makes every word its own line, it can get kind of big (and potentially we may want to add more words later). It might still be better to move it to a separate file outside of (Sorry for making so many requested changes 😅) |
Fixed, I used src/scripts/generateFileName.ts.
No problem! |
Co-authored-by: Nathan Wang <nathan.r.wang@gmail.com>
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.
Sorry for the delay, completely missed this 😰 . lgtm other than one minor fix. Thanks!
Co-authored-by: Nathan Wang <nathan.r.wang@gmail.com>
lgtm if ci checks pass! |
Tested it out also here, it works. |
Awesome, thanks!! |
#97