Skip to content

Commit

Permalink
fix: build error
Browse files Browse the repository at this point in the history
  • Loading branch information
HoberMin committed May 23, 2024
1 parent 9054507 commit 16e582d
Show file tree
Hide file tree
Showing 6 changed files with 483 additions and 498 deletions.
10 changes: 3 additions & 7 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import ReactDOM from 'react-dom/client';
import { RouterProvider } from 'react-router-dom';

Expand All @@ -10,9 +8,7 @@ import { router } from './router.tsx';
const root = document.getElementById('root')!;

ReactDOM.createRoot(root).render(
<React.StrictMode>
<Layout>
<RouterProvider router={router} />
</Layout>
</React.StrictMode>,
<Layout>
<RouterProvider router={router} />
</Layout>,
);
48 changes: 24 additions & 24 deletions src/pages/Countdown.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { useEffect, useState } from "react"
import { useNavigate } from "react-router-dom"
// import { useEffect, useState } from "react"
// import { useNavigate } from "react-router-dom"

export function CountdownPage() {
const navigate = useNavigate()
const [count, setCount] = useState(3)
const [startTime, setStartTime] = useState(new Date())
// export function CountdownPage() {
// const navigate = useNavigate()
// const [count, setCount] = useState(3)
// const [startTime, setStartTime] = useState(new Date())

useEffect(() => {
if (count <= 0) {
navigate('/')
}
}, [count])
// useEffect(() => {
// if (count <= 0) {
// navigate('/')
// }
// }, [count])

useEffect(() => {
setInterval(() => {
const mls = startTime.getTime() - new Date().getTime()
console.log(mls)
setCount((cnt) => 3 - Math.round(Math.abs(mls / 1000)))
}, 980)
}, [])
// useEffect(() => {
// setInterval(() => {
// const mls = startTime.getTime() - new Date().getTime()
// console.log(mls)
// setCount((cnt) => 3 - Math.round(Math.abs(mls / 1000)))
// }, 980)
// }, [])

return (
<div className="flex w-full h-full justify-center items-center align-middle font-bold text-6xl animate-ping duration-1000 ">
{count}
</div>
)
}
// return (
// <div className="flex w-full h-full justify-center items-center align-middle font-bold text-6xl animate-ping duration-1000 ">
// {count}
// </div>
// )
// }
Loading

0 comments on commit 16e582d

Please sign in to comment.