MemePlace / Frontend

Frontend Repo
3 stars 0 forks source link

Navigation Sidebar #9

Closed Step7750 closed 6 years ago

Step7750 commented 6 years ago

Allows the user to easily click communities that they have favourited with a possible interface for allowing them to see the Top X communities or maybe ones that may be relevant to them.

Step7750 commented 6 years ago

This should probably also provide a button to create new communities

ClaytonVis commented 6 years ago

Perhaps toggle the sidebar when a button is clicked. It's pretty clunky on mobile otherwise.

Dave0921 commented 6 years ago

Yup. Thankfully, Angular Material already provides the toggle sidebar functionality for mobile/ when the screen gets resized to a smaller width.

Dave0921 commented 6 years ago

If a user creates a community, do they become the "moderator" of the community (ex. they can change the name of the community, delete community, etc.)?

Step7750 commented 6 years ago

They'd be the "owner" which would have privileges above moderators if we implemented that. We currently don't have an interface planned for managing your created communities.

Dave0921 commented 6 years ago

Oh okay. I've setup the sidebar to allow users to favourite communities, and display favourited communities before the top communities. How would we determine which communities are considered the "top" communities?

Step7750 commented 6 years ago

Sort by most favourited? I'll make an issue for a server call to do that, it is documented in the API layout.

Dave0921 commented 6 years ago

I created a list of favourited communities, above the list of top communities. There is a strange bug where if I want to unfavourite one of the favourited communities from the favourited communities list, it removes the favourited community from list of favourites (which is good), but also refreshes the page... not sure why the refreshing happens.

Step7750 commented 6 years ago

I replied to your PR with a fix that should resolve the issue. Let me know if it doesn't.

Dave0921 commented 6 years ago

Yup, I made the changes and it works now; thanks!

Dave0921 commented 6 years ago

Also, I wanted to give users a convenient way of managing their favourited communities from the navigation sidebar, so that they can easily favourite/unfavourite communities. We can remove this option if it doesn't have much use, since I know we are also implementing a favourite button on each individual community page.

Dave0921 commented 6 years ago

In order to sort the communities on the side navigation bar, should we add a "favouriteCount" property on the community object?

export interface Community {
  name: string;
  title: string;
  description?: string;
  sidebar?: string;
  nsfw?: boolean;
  creatorId: number;
  favouriteCount: number;
}  
Step7750 commented 6 years ago

When you retrieve the communities from the community service, it is sorted before it is sent to you (https://github.com/MemePlace/Frontend/blob/master/src/app/api/community.service.ts#L38). The server handles that so all you need to do is just call that method with sort method top and X count.

Step7750 commented 6 years ago

Closed in https://github.com/MemePlace/Frontend/pull/26