Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
[C-711] Change useSize to useMeasure in ProfileBio (#1903)
Browse files Browse the repository at this point in the history
  • Loading branch information
dharit-tan committed Sep 12, 2022
1 parent 66995fa commit 600f673
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 53 deletions.
49 changes: 0 additions & 49 deletions packages/web/src/hooks/useSize.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { useCallback, useEffect, useRef, useState } from 'react'
import { useCallback, useEffect, useState } from 'react'

import { Name, squashNewLines } from '@audius/common'
import { ResizeObserver } from '@juggle/resize-observer'
import cn from 'classnames'
import { Options } from 'linkifyjs'
import Linkify from 'linkifyjs/react'
import { animated } from 'react-spring'
import useMeasure from 'react-use-measure'

import { ReactComponent as IconCaretDownLine } from 'assets/img/iconCaretDownLine.svg'
import { ReactComponent as IconCaretUpLine } from 'assets/img/iconCaretUpLine.svg'
import { make, useRecord } from 'common/store/analytics/actions'
import { OpacityTransition } from 'components/transition-container/OpacityTransition'
import { useSize } from 'hooks/useSize'

import SocialLink, { Type } from '../SocialLink'

Expand Down Expand Up @@ -47,10 +48,11 @@ export const ProfileBio = ({
instagramHandle,
tikTokHandle
}: ProfileBioProps) => {
const bioRef = useRef<HTMLDivElement>(null)
const [isCollapsed, setIsCollapsed] = useState(false)
const [isCollapsible, setIsCollapsible] = useState(false)
const bioSize = useSize({ ref: bioRef })
const [bioRef, { height: bioSize }] = useMeasure({
polyfill: ResizeObserver
})

const linkCount = [
website,
Expand Down

0 comments on commit 600f673

Please sign in to comment.