-
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.
feat(new-landing): implement new landing page
- Loading branch information
Showing
10 changed files
with
725 additions
and
570 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,31 @@ | ||
import { useState, useEffect } from 'react' | ||
|
||
const useCountdown = ( | ||
initialCount: number, | ||
interval: number = 1000 | ||
): [number, () => void] => { | ||
const [count, setCount] = useState<number>(initialCount) | ||
|
||
useEffect(() => { | ||
const countdownInterval = setInterval(() => { | ||
setCount((prevCount) => prevCount - 1) | ||
}, interval) | ||
|
||
// Clear the interval when the component is unmounted or when the countdown reaches 0 | ||
if (count <= 0) { | ||
clearInterval(countdownInterval) | ||
} | ||
|
||
return () => clearInterval(countdownInterval) | ||
}, [count, interval]) | ||
|
||
// Reset the countdown to the initial value | ||
const reset = () => { | ||
setCount(initialCount) | ||
} | ||
|
||
// Return the current count and the reset function | ||
return [count, reset] | ||
} | ||
|
||
export default useCountdown |
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 const SHOW_HELP_STORAGE_KEY = 'pairwise-help-is-shown' | ||
export const PAIRWISE_RELEASE_DATE = new Date(2023, 10, 6) // November 6 2023 |
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