-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #373 from jordanlesich/dashboard
Dashboard
- Loading branch information
Showing
32 changed files
with
1,426 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './Icon' | ||
export * from './icons' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
apps/web/src/data/subgraph/fragments/CurrentAuction.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
fragment CurrentAuction on Auction { | ||
endTime | ||
highestBid { | ||
amount | ||
bidder | ||
} | ||
token { | ||
name | ||
image | ||
tokenId | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
query dashboard($where: DAOTokenOwner_filter, $first: Int, $skip: Int) { | ||
daotokenOwners(where: $where, first: $first, skip: $skip) { | ||
dao { | ||
...DAO | ||
contractImage | ||
auctionConfig { | ||
minimumBidIncrement | ||
reservePrice | ||
} | ||
proposals( | ||
where: { executed_not: true, canceled_not: true, vetoed_not: true } | ||
first: 10 | ||
skip: 0 | ||
orderBy: proposalNumber | ||
orderDirection: desc | ||
) { | ||
...Proposal | ||
voteEnd | ||
voteStart | ||
expiresAt | ||
} | ||
currentAuction { | ||
...CurrentAuction | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import * as Sentry from '@sentry/nextjs' | ||
|
||
import { PUBLIC_DEFAULT_CHAINS } from 'src/constants/defaultChains' | ||
import { SDK } from 'src/data/subgraph/client' | ||
|
||
export const dashboardRequest = async (memberAddress: string) => { | ||
try { | ||
if (!memberAddress) throw new Error('No user address provided') | ||
const data = await Promise.all( | ||
PUBLIC_DEFAULT_CHAINS.map((chain) => | ||
SDK.connect(chain.id) | ||
.dashboard({ | ||
where: { | ||
owner: memberAddress.toLowerCase(), | ||
}, | ||
first: 30, | ||
}) | ||
.then((x) => ({ ...x, chainId: chain.id })) | ||
) | ||
) | ||
|
||
return data | ||
.map((queries) => | ||
queries.daotokenOwners.map(({ dao }) => ({ | ||
...dao, | ||
name: dao.name || '', | ||
tokenAddress: dao.tokenAddress, | ||
auctionAddress: dao?.auctionAddress || '', | ||
proposals: dao.proposals, | ||
currentAuction: dao.currentAuction, | ||
chainId: queries.chainId, | ||
daoImage: dao.contractImage, | ||
})) | ||
) | ||
.flat() | ||
.sort((a, b) => a.name.localeCompare(b.name)) | ||
} catch (e: any) { | ||
console.error(e) | ||
Sentry.captureException(e) | ||
await Sentry.flush(2000) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
b2cc4bf
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.
Successfully deployed to the following URLs:
testnet-nouns-builder – ./apps/web
testnet-nouns-builder-nouns-builder.vercel.app
testnet-nouns-builder-git-main-nouns-builder.vercel.app
testnet.nouns.build