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

feat: add members space page #971

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

bartosz-io
Copy link

Summary

Add a new space page and item in the space menu called "Members".

Closes: #960

How to test

  1. Open a space with members
  2. Verify Members navigation item is visible
  3. Open Members
  4. If there are no members (admin, moderator, author) the navigation item is not rendered

@bonustrack
Copy link
Member

@Sekhmet can you review this PR?

Comment on lines +72 to +80
const canSeeMembers = computed(() => {
const data = space.value?.additionalRawData;

return (
controller.value ||
(data?.admins?.length ?? 0) > 0 ||
(data?.moderators?.length ?? 0) > 0 ||
(data?.members?.length ?? 0) > 0
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes this section visible on Snapshot onchain spaces, original issue includes this:

The page should only appear if there are members set on the space (only appear on Snapshot spaces and not SX).

Might be confusing though (Snapshot spaces = Snapshot offchain spaces, SX = Snapshot onchain spaces).


const network = getNetwork(networkId.value);
const controller = await network.helpers.getSpaceController(space.value);
return await network.helpers.getSpaceController(space.value);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return await network.helpers.getSpaceController(space.value);
return network.helpers.getSpaceController(space.value);

await there does nothing.

const isController = computed(() => {
const { account } = web3.value;

return compareAddresses(controller.value ?? '', account);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. I'd just check if it's undefined as separate case to avoid calling compareAddresses with fallback value.

@@ -360,3 +360,18 @@ export const STRATEGY_QUERY = gql`
}
${STRATEGY_FRAGMENT}
`;

export const STATEMENTS_AND_USERS_QUERY = gql`
query ($where: StatementsWhere, $userIds: [String!]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
query ($where: StatementsWhere, $userIds: [String!]) {
query ($statementsWhere: StatementsWhere, $userIds: [String!]) {

This way it's clearer when we execute query as to what where refers.

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.

feat: add members space page
3 participants