Skip to content
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

Establish new root and refactor communities #306

Merged
merged 30 commits into from
Oct 18, 2023

Conversation

elliotBraem
Copy link
Contributor

Pull request regarding #294

Unblocks:
#253 - new community addon framework
#175 - telegram plugin
#268 - blog plugin
#267 - wiki plugin
#265 - github plugin
#266 - kanban plugin

Sets the stage for:
#303 - New DevHub homepage
#295 - Updates to layout and header

See a preview here and navigate to and around the Communities. (A full migration for Feed has not yet been complete, will wait for approval first)

How does it work?

It starts with a new namespace (DevHub) and a new root (DevHub.App)

Within this new root, we simulate a sort-of React Router (for BOS) that checks for a "page" prop and determines the page from this:

function Page() {
  const routes = page.split(".");
  switch (routes[0]) {
    // ?page=home
    case "home": {
      return <Homepage />;
    }
    case "communities": {
      // ?page=communities
      return (<Communities />
      );
    }
    case "community": {
      switch (routes[1]) {
          case "configuration":{
              // ?page=community.configuration
              return <CommunityConfiguration />
          }
          default: {
              return <Community />
          }
      }
  }
}

And we define our Theme and Layout:

  <Theme>
    <AppLayout
      page={page}
    >
      <Page />
    </AppLayout>
  </Theme>

Rather than merge this to mainnet, I'd like if #305 could be approved and this could be merged to testnet first.
Merging 305 will also unblock #301 so there can be more clean code in this refactor.

elliotBraem and others added 2 commits October 16, 2023 21:33
* Implement server side search

* case insensitive search on content

* add search test
@elliotBraem elliotBraem changed the base branch from main to develop October 18, 2023 00:44
@elliotBraem elliotBraem force-pushed the refactor/root branch 2 times, most recently from 4a6da93 to d29232f Compare October 18, 2023 00:49
@elliotBraem elliotBraem merged commit 04438db into NEAR-DevHub:develop Oct 18, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants