fiatjaf / coisas

a client-side CMS for editing GitHub Markdown (and other) files
https://coisas.fiatjaf.com/
MIT License
328 stars 29 forks source link

Keep track of last repositories browsed and suggest them on Index. #5

Closed fiatjaf closed 7 years ago

fiatjaf commented 7 years ago

Nowadays Index is just a component that asks the user to type the name of a repository, so it is taken to #!/owner/repo/ (all the action happens at the Repo component).

We could keep track, on localStorage, of repositories visited by the user (in a certain browser, anyway), updating the value every time the user opens a repository, and then show the list of last visited repositories on Index.

Besides the owner/repo slug of the repository, the time of the last access should be stored too, so repositories are shown in order, the most recently viewed first.

zktnguyen commented 7 years ago

Hi, I recently learned React and would love to contribute to an open source React project. Any tips on how to get started would be appreciated, but I will try to navigate myself through the problem nonetheless.

fiatjaf commented 7 years ago

Hey, @zktnguyen. I don't know exactly what kind of tip you could need, but have you manage to run coisas locally on your computer?

zktnguyen commented 7 years ago

Hi, I tried to run it locally. After npm install and npm run build and using Caddy to host on a localhost server, I get these errors: http://puu.sh/xdB1e/60cf622c02.png
and unfortunately, the website does not render properly, showing just the background color with no content.

fiatjaf commented 7 years ago

I don't understand it, I've just git cloned it to a new directory, run npm install and npm run build and everything has worked. Does the build run without errors? Have you built from master, without changing the code?

zktnguyen commented 7 years ago

Yes, built from master without changing code. There are no errors during the build, there are errors that occur on the Chrome console, though.
I will attempt again and let you know the results on this comment ASAP.
I figured out the error. You have two files in components folder that are named Index.js and index.js. Whenever I git clone the master branch, I only receive one or the other file. I fixed it by renaming Index.js and anywhere it is "required" (I only found index.js). Now it runs but without style since I think you use the #Index identifier (by guess) in your CSS.

fiatjaf commented 7 years ago

Oh, that was very unexpected and weird. Windows, right? I'm sorry.

zktnguyen commented 7 years ago

Yeah, I also tried on my Mac to see if it was an environment thing, but it happened on the Mac too. It's ok!

fiatjaf commented 7 years ago

It would be great if you renamed that Index.js component and whoever requires it to something else, maybe Landing, IndexComponent? and submitted those changes in a separate pull request.

zktnguyen commented 7 years ago

Thank you for the suggestions, I will try to get that pull request in soon.

zktnguyen commented 7 years ago

This can also be closed now, right?

fiatjaf commented 7 years ago

Yes.

When you write "closes/fixes/solves " in the description of your PR it closes the referenced issues automatically when merged.

This one was closed by https://github.com/fiatjaf/coisas/pull/10