Skip to content

Commit

Permalink
Fix TS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
parkerdavis1 committed Mar 4, 2024
1 parent f97d5d6 commit 501c5f0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
31 changes: 30 additions & 1 deletion app/components/confetti.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Index as ConfettiShower } from 'confetti-react'
import { ClientOnly } from 'remix-utils'
import { useWindowSize } from '@uidotdev/usehooks'
import { useState, useEffect } from 'react'

/**
* confetti is a unique random identifier which re-renders the component
Expand All @@ -22,3 +22,32 @@ export function Confetti({ confetti }: { confetti?: string }) {
</ClientOnly>
)
}

function useWindowSize() {
interface Size {
width: number | undefined
height: number | undefined
}
const [size, setSize] = useState<Size>({
width: undefined,
height: undefined,
})

useEffect(() => {
const handleResize = () => {
setSize({
width: window.innerWidth,
height: window.innerHeight,
})
}

handleResize()
window.addEventListener('resize', handleResize)

return () => {
window.removeEventListener('resize', handleResize)
}
}, [])

return size
}
18 changes: 0 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"@sentry/remix": "^7.54.0",
"@tailwindcss/typography": "^0.5.10",
"@tanstack/react-table": "^8.9.2",
"@uidotdev/usehooks": "^2.4.1",
"address": "^1.2.2",
"autoprefixer": "^10.4.14",
"bcryptjs": "^2.4.3",
Expand Down

0 comments on commit 501c5f0

Please sign in to comment.