Closed abhinavkrin closed 1 year ago
Added solved tab
Topics that are solved will have checkbox in their title
Hey @Sing-Li Thanks for pointing that out. I added revalidate keeping in mind that the discourse data may get outdated. If we are handling the regeneration of static files on our own, we then don't need to add revalidate. Therefore, I have removed it.
This PR adds Discourse components to RC4Community along with some minor changes.
Discourse Components
Client side set up
The discourse components should be wrapped with
DiscourseProvider
.Inside of
DiscourseProvider
we can useuseDiscourseClient
to get access to the discourse client. The client exposes functions to fetch discourse data.DiscourseClient
could also be intialised directly.DiscourseTopicList
supports three variantslatest
,top
,solved
andunsolved
.DiscourseTopicListTabs
could be used when user wants to show multiple variants.Server side set up
Coming soon. Contributors are welcomed to create server side components for discourse.
ENVIRONMENT VARIABLES
Though you can pass host directly to DiscourseProvider, to run the index.js page of RC4Community. Set:
DiscourseClient
The lib folder contains DiscourseClient developed to communicate with the discourse server easily. All future methods related to discourse should be added to this client.
Directory Structuring
Unlike the previous way of defining styles in the styles directory. I have put all the assets, classes, and js files for a component in the component directory itself. This is developer friendly as the no. of components grows in RC4Community. It will also make work easy when we will be componentizing the features.
https://user-images.githubusercontent.com/15830206/226142393-2c5237ce-b8c0-4106-8663-c90715dde886.mp4
ENVIRONMENT VARIABLES example.