-
Notifications
You must be signed in to change notification settings - Fork 44
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 #331 from jordanlesich/auctionGraph
Auction graph
- Loading branch information
Showing
20 changed files
with
940 additions
and
96 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
query auctionHistory( | ||
$startTime: BigInt! | ||
$daoId: ID! | ||
$orderBy: Auction_orderBy | ||
$orderDirection: OrderDirection | ||
$first: Int | ||
) { | ||
dao(id: $daoId) { | ||
auctions( | ||
where: { endTime_gt: $startTime, settled: true } | ||
orderBy: $orderBy | ||
orderDirection: $orderDirection | ||
first: $first | ||
) { | ||
id | ||
endTime | ||
winningBid { | ||
amount | ||
} | ||
settled | ||
} | ||
} | ||
} |
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,28 @@ | ||
import * as Sentry from '@sentry/nextjs' | ||
|
||
import { SDK } from 'src/data/subgraph/client' | ||
import { CHAIN_ID } from 'src/typings' | ||
|
||
import { Auction_OrderBy, OrderDirection } from '../sdk.generated' | ||
|
||
export const auctionHistoryRequest = async ( | ||
chainId: CHAIN_ID, | ||
collectionAddress: string, | ||
startTime: number | ||
) => { | ||
try { | ||
const data = await SDK.connect(chainId).auctionHistory({ | ||
startTime, | ||
daoId: collectionAddress, | ||
orderDirection: OrderDirection.Asc, | ||
orderBy: Auction_OrderBy.EndTime, | ||
first: 1000, | ||
}) | ||
|
||
return data | ||
} catch (error) { | ||
console.error(error) | ||
Sentry.captureException(error) | ||
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
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,54 @@ | ||
import { Button, Flex, Text } from '@zoralabs/zord' | ||
import React, { ReactNode } from 'react' | ||
|
||
import { | ||
buttonTab, | ||
newTag, | ||
} from 'src/modules/dao/components/AuctionChart/AuctionChart.css' | ||
import { TopSectionView } from 'src/modules/dao/components/DaoTopSection' | ||
|
||
import { auctionWrapVariants, switcherBox } from './Auction.css' | ||
|
||
export const ViewSwitcher = ({ | ||
topSectionView, | ||
setTopSectionView, | ||
children, | ||
}: { | ||
topSectionView: TopSectionView | ||
setTopSectionView: (view: TopSectionView) => void | ||
children: ReactNode | ||
}) => ( | ||
<Flex className={auctionWrapVariants['post']}> | ||
<Flex w={'100%'} justify={'center'} mb={'x3'}> | ||
<Flex className={switcherBox}> | ||
{Object.values(TopSectionView).map((view) => ( | ||
<Button | ||
key={view} | ||
variant={'ghost'} | ||
size="md" | ||
pos={'relative'} | ||
px={'x0'} | ||
mr={'x3'} | ||
onClick={() => setTopSectionView(view)} | ||
className={ | ||
view === topSectionView ? buttonTab['selected'] : buttonTab['unselected'] | ||
} | ||
> | ||
{view} | ||
{view === 'chart' && ( | ||
<Text | ||
backgroundColor="positive" | ||
className={newTag} | ||
borderRadius={'phat'} | ||
fontSize={12} | ||
> | ||
New | ||
</Text> | ||
)} | ||
</Button> | ||
))} | ||
</Flex> | ||
</Flex> | ||
<Flex justify={'center'}>{children}</Flex> | ||
</Flex> | ||
) |
Oops, something went wrong.
f3dcfaf
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-git-main-nouns-builder.vercel.app
testnet-nouns-builder-nouns-builder.vercel.app
testnet.nouns.build
f3dcfaf
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:
nouns-builder – ./apps/web
nouns-builder-nouns-builder.vercel.app
nouns-builder-git-main-nouns-builder.vercel.app
nouns.build
zouns-builder.vercel.app
www.nouns.build