-
Notifications
You must be signed in to change notification settings - Fork 17
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
base: master
Are you sure you want to change the base?
feat: add members space page #971
Conversation
… into feat-960-add-members-space-page
Co-authored-by: Less <[email protected]>
@Sekhmet can you review this PR? |
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 | ||
); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
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!]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
query ($where: StatementsWhere, $userIds: [String!]) { | |
query ($statementsWhere: StatementsWhere, $userIds: [String!]) { |
This way it's clearer when we execute query as to what where
refers.
Summary
Add a new space page and item in the space menu called "Members".
Closes: #960
How to test
Members
navigation item is visibleMembers