Skip to content

Commit

Permalink
fix(ui): forward JaenToggleButton ref
Browse files Browse the repository at this point in the history
  • Loading branch information
schettn authored Nov 26, 2021
1 parent 6926cc1 commit 443ab53
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import {Tooltip, IconButton, Text} from '@chakra-ui/react'
import {SnekIcon} from '@components/atoms/icons'
import {useLanguageModeValue} from '@src/language-mode'
import React from 'react'

import translations from './translations.json'

export type JaenToggleButtonProps = {
ref: React.Ref<HTMLButtonElement>
onClick: () => void
}

const JaenToggleButton: React.FC<JaenToggleButtonProps> = props => {
const JaenToggleButton = React.forwardRef<
HTMLButtonElement,
JaenToggleButtonProps
>((props, ref) => {
const CONTENT = useLanguageModeValue(translations)

return (
Expand All @@ -23,10 +26,10 @@ const JaenToggleButton: React.FC<JaenToggleButtonProps> = props => {
boxSize="20"
icon={<SnekIcon boxSize="14" />}
onClick={props.onClick}
ref={props.ref}
ref={ref}
/>
</Tooltip>
)
}
})

export default JaenToggleButton

0 comments on commit 443ab53

Please sign in to comment.