Skip to content

Commit

Permalink
Merge branch 'master' into bartek/awaiting-results
Browse files Browse the repository at this point in the history
  • Loading branch information
p-sad authored Apr 24, 2024
2 parents a41462b + 1a1aef6 commit 6d18837
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 19 deletions.
8 changes: 1 addition & 7 deletions packages/frontend/src/blockchain/auctionAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import { arbitrum, arbitrumSepolia, hardhat } from 'wagmi/chains'

export const AUCTION_ADDRESSES: Record<SupportedChainId, Hex> = {
[arbitrum.id]: '0xF53d383525117d1f51BF234966E39bD1508a5948',
[arbitrumSepolia.id]: '0xF53d383525117d1f51BF234966E39bD1508a5948',
[arbitrumSepolia.id]: '0x426Ee70332Ae67a5FdFb7B4B4A2C91F1f51712b0',
[hardhat.id]: '0xa513e6e4b8f2a923d98304ec87f64353c4d5c853',
}

export const DEPLOYMENT_BLOCK: Record<SupportedChainId, bigint> = {
[arbitrum.id]: BigInt(16977962),
[arbitrumSepolia.id]: BigInt(33877486),
[hardhat.id]: BigInt(0),
}
8 changes: 4 additions & 4 deletions packages/frontend/src/components/info/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from 'styled-components'
import { ArrowDownIcon } from '../icons'
import { Colors } from '@/styles/colors'
import { Rule, RuleText } from '@/components/info/Rules'
import { formatEndDate } from '@/utils/formatters/formatEndDate'
import { formatDate } from '@/utils/formatters/formatDate'
import { useVoucherRedeemDeadline } from '@/blockchain/hooks/useVoucherRedeemDeadline'
import { useReadAuctionParams } from '@/blockchain/hooks/useReadAuctionParams'

Expand Down Expand Up @@ -149,7 +149,7 @@ export const InfoAccordion = () => {
<AccordionStyledTrigger heading="In what form will I get the ticket?" />
</StyledHeader>
<StyledContent>
After the raffle is settled, you will have 48 hours (<Bold>until {formatEndDate(redeemTimestamp)}</Bold>) to
After the raffle is settled, you will have 48 hours (<Bold>until {formatDate(redeemTimestamp)}</Bold>) to
claim your voucher code for the ticket. In order to do so, you will be asked to sign a message using your
wallet to authenticate as the owner of the winning account. The voucher code will be presented to you on
this page.
Expand All @@ -163,8 +163,8 @@ export const InfoAccordion = () => {
<StyledContent>
<span>
Your Voucher Code will be available to you for 48 hours after the closing of the Auction & Raffle (
<Bold>until {formatEndDate(redeemTimestamp)}</Bold>). Once you have input your voucher code into our
ticket portal, you will go through the standard ticket checkout flow. You can go to{' '}
<Bold>until {formatDate(redeemTimestamp)}</Bold>). Once you have input your voucher code into our ticket
portal, you will go through the standard ticket checkout flow. You can go to{' '}
<Link href="https://tickets.devcon.org/">our ticket shop here</Link> to redeem your voucher code for a
Devcon 6 ticket. See you at the conference!
</span>
Expand Down
5 changes: 2 additions & 3 deletions packages/frontend/src/components/info/TimeLeft.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from 'react'
import styled from 'styled-components'
import { formatTimeLeft } from '@/utils/formatters/formatTimeLeft'
import { formatEndDate } from '@/utils/formatters/formatEndDate'
import { formatDate } from '@/utils/formatters/formatDate'
import { setIntervalImmediately } from '@/utils/setIntervalImmediately'
import { useAuctionState } from '@/blockchain/hooks/useAuctionState'
import { useAuctionTime } from '@/blockchain/hooks/useAuctionTime'
Expand All @@ -24,8 +24,7 @@ export const TimeLeft = () => {
<RemainingTime>{timeLeft}</RemainingTime>
</TimeRow>
<TimeRow>
{state === 'AwaitingBidding' ? 'Starts on' : ' Ends on'}{' '}
<RemainingTime>{formatEndDate(timestamp)}</RemainingTime>
{state === 'AwaitingBidding' ? 'Starts on' : ' Ends on'} <RemainingTime>{formatDate(timestamp)}</RemainingTime>
</TimeRow>
</TimeBox>
)
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/src/components/info/VoucherTimeLeft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Colors } from '@/styles/colors'
import styled from 'styled-components'

import { RemainingTime } from './TimeLeft'
import { formatEndDate } from '@/utils/formatters/formatEndDate'
import { formatDate } from '@/utils/formatters/formatDate'
import { useVoucherRedeemDeadline } from '@/blockchain/hooks/useVoucherRedeemDeadline'
import { useReadAuctionParams } from '@/blockchain/hooks/useReadAuctionParams'

Expand All @@ -15,8 +15,8 @@ export const VoucherTimeLeft = () => {
<VoucherTimeBox isPeriodExpired={isPeriodExpired}>
<TimeRow isPeriodExpired={isPeriodExpired}>
<span>{isPeriodExpired ? 'Voucher redeem period expired on ' : 'Voucher redeem period: '}</span>
{!isPeriodExpired && <RemainingTime>{formatEndDate(biddingEndTime)} - </RemainingTime>}
<RemainingTime>{formatEndDate(redeemTimestamp)}</RemainingTime>
{!isPeriodExpired && <RemainingTime>{formatDate(biddingEndTime)} - </RemainingTime>}
<RemainingTime>{formatDate(redeemTimestamp)}</RemainingTime>
</TimeRow>
</VoucherTimeBox>
)
Expand Down
17 changes: 17 additions & 0 deletions packages/frontend/src/components/userActious/BidAwaiting.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import styled from 'styled-components'
import { FormWideWrapper } from '@/components/form'
import { useReadAuctionParams } from '@/blockchain/hooks/useReadAuctionParams'
import { formatDate } from '@/utils/formatters/formatDate'

export const BidAwaiting = () => {
const { biddingStartTime } = useReadAuctionParams()
return (
<BidAwaitingWrapper>
<h2>Bidding starts on {formatDate(biddingStartTime)}</h2>
</BidAwaitingWrapper>
)
}

const BidAwaitingWrapper = styled(FormWideWrapper)`
padding: 0 54px;
`
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import { GitcoinFlow } from './gitcoin/GitcointFlow'
import { BidFlow } from './bid/BidFlow'
import { AwaitingResults } from '@/components/userActious/claim/AwaitingResults'
import { ClaimingClosed } from '@/components/userActious/claim/ClaimingClosed'
import { BidAwaiting } from '@/components/userActious/BidAwaiting'

const Placeholder = () => <div />

const UserActions: Record<AuctionState, () => ReactElement> = {
AwaitingBidding: Placeholder,
AwaitingBidding: BidAwaiting,
WalletNotConnected: ConnectWalletWarning,
WrongNetwork: Placeholder,
BiddingFlow: BidFlow,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import moment from 'moment-timezone'

export function formatEndDate(timestamp: bigint | undefined, timeZone: string = moment.tz.guess()) {
export function formatDate(timestamp: bigint | undefined, timeZone: string = moment.tz.guess()) {
if (!timestamp) {
return '-'
}
Expand Down

0 comments on commit 6d18837

Please sign in to comment.