Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump usehooks-ts from 2.9.5 to 2.15.0 #1971

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions app/routes/_gcn.user.endorsements/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
useRef,
useState,
} from 'react'
import { useElementSize } from 'usehooks-ts'
import { useResizeObserver } from 'usehooks-ts'

import { formatAuthor } from '../_gcn.circulars/circulars.lib'
import type {
Expand Down Expand Up @@ -232,8 +232,11 @@ export function EndorsementRequestCard({
const disabled = fetcher.state !== 'idle'
const [showMore, setShowMore] = useState(false)

const [noteRef, { width }] = useElementSize()
const [noteContainerRef, { width: containerWidth }] = useElementSize()
const noteRef = useRef<HTMLSpanElement>(null)
const noteContainerRef = useRef<HTMLDivElement>(null)

const { width } = useResizeObserver({ ref: noteRef })
const { width: containerWidth } = useResizeObserver({ ref: noteContainerRef })

return (
<fetcher.Form method="POST">
Expand All @@ -246,7 +249,10 @@ export function EndorsementRequestCard({
{endorsementRequest.note && (
<div className="margin-top-0 margin-bottom-1">
Comments from the user:
{(width > containerWidth || showMore) && (
{((width !== undefined &&
containerWidth !== undefined &&
width > containerWidth) ||
showMore) && (
<Button
type="button"
unstyled
Expand Down
17 changes: 9 additions & 8 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"ts-dedent": "^2.2.0",
"unified": "^10.0.0",
"unist-builder": "^4.0.0",
"usehooks-ts": "^2.9.5"
"usehooks-ts": "^2.15.0"
},
"devDependencies": {
"@architect/architect": "^10.16.3",
Expand Down
Loading