DXgovernance / davi-monorepo

https://davi-monorepo-davi.vercel.app
8 stars 12 forks source link

Feat/proposal page 1 5 subgraph #230

Closed dcrescimbeni closed 1 year ago

dcrescimbeni commented 1 year ago

Description

The goal of this PR is to render "Governance" and "All Proposals" pages without crashing. It doesn't attempt to fully implement the logic of Gov 1.5.

To visit the DAO, get the DAO ID from a subgraph query, and navigate to it. Example: http://localhost:3000/#/localhost/0x77f7df7de7ab705eb54982a12d8e1ac65bfa05d3

Looking sexy: image

Closes #193

Other changes:

  1. Refactored Proposal page to remove dependency of useGuildImplementationTypeConfig and useGuildProposalIds
  2. Moved useProposalState and useTimeDetail to hook store
  3. Added exports for subgraph fetchers in index file
  4. Extracted encodeActions function to utils

Pending:

  1. useTimeDetail: it returns "some time" as the logic to return the actual end time of the proposal isn't implemented yet
  2. proposal.endTime: it returns the startTime. See useTimeDetail note
  3. useProposalState: it maps the Scheme state (None, Submitted, Rejected, Passed), but Gov 1.5 uses more complex logic to determine the actual state of the proposal

Type of change

How Has This Been Tested?

The page doesn't crash, which is nice.

Checklist:

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
davi ❌ Failed (Inspect) Mar 2, 2023 at 3:04PM (UTC)
vercel[bot] commented 1 year ago

@dcrescimbeni is attempting to deploy a commit to the dxgov Team on Vercel.

A member of the Team first needs to authorize it.