-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
219 additions
and
161 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
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,13 +1,18 @@ | ||
import { useModal } from 'connectkit'; | ||
|
||
export const ConnectWallet = () => { | ||
const {setOpen} = useModal(); | ||
const { setOpen } = useModal(); | ||
|
||
return ( | ||
<div> | ||
<button className="btn w-full" onClick={() => { setOpen(true) }}> | ||
<button | ||
className="btn w-full" | ||
onClick={() => { | ||
setOpen(true); | ||
}} | ||
> | ||
Connect Wallet | ||
</button> | ||
</div> | ||
) | ||
); | ||
}; |
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,30 +1,32 @@ | ||
import { FC, useEffect, useState } from "react"; | ||
import { FC, useEffect, useState } from 'react'; | ||
|
||
export const Countdown: FC<{ to: Date }> = ({ to }) => { | ||
const [now, setNow] = useState(Date.now()); | ||
|
||
const hoursLeft = Math.floor((to.getTime() - now) / 1000 / 60 / 60); | ||
const minutesLeft = Math.floor((to.getTime() - now) / 1000 / 60 % 60); | ||
const secondsLeft = Math.floor((to.getTime() - now) / 1000 % 60); | ||
const minutesLeft = Math.floor(((to.getTime() - now) / 1000 / 60) % 60); | ||
const secondsLeft = Math.floor(((to.getTime() - now) / 1000) % 60); | ||
|
||
useEffect(() => { | ||
const interval = setInterval(() => { | ||
setNow(Date.now()); | ||
}, 1000); | ||
|
||
return () => clearInterval(interval); | ||
} | ||
, []); | ||
}, []); | ||
|
||
return ( | ||
<div> | ||
<div className="text-timer" title={`Time left till ${to.getTime()}`}> | ||
<div | ||
className="text-timer" | ||
title={`Time left till ${to.getTime()}`} | ||
> | ||
<span>{hoursLeft.toString().padStart(2, '0')}</span> | ||
<span>:</span> | ||
<span>{minutesLeft.toString().padStart(2, '0')}</span> | ||
<span>:</span> | ||
<span>{secondsLeft.toString().padStart(2, '0')}</span> | ||
</div> | ||
</div> | ||
) | ||
); | ||
}; |
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
Oops, something went wrong.