Skip to content

Commit 716dfba

Browse files
committed
Restrict hover-based address highlighting to desktop
1 parent 9fa8e5e commit 716dfba

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changelog/1961.trivial.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Restrict hover-based address highlighting to desktop

src/app/components/HighlightingContext/WithHighlighting.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ import { FC, ReactNode, useEffect } from 'react'
22
import { useAddressHighlighting } from './index'
33
import { COLORS } from '../../../styles/theme/colors'
44
import Box from '@mui/material/Box'
5+
import { useScreenSize } from '../../hooks/useScreensize'
56

67
export const WithHighlighting: FC<{ children: ReactNode; address: string }> = ({ children, address }) => {
78
const { highlightedAddress, highlightAddress, releaseAddress } = useAddressHighlighting()
89
useEffect(() => () => releaseAddress(address)) // Release address on umount
9-
const isHighlighted = !!highlightedAddress && highlightedAddress.toLowerCase() === address.toLowerCase()
10+
const { isTablet } = useScreenSize()
11+
// We have decided that we only want this feature on desktop,
12+
// so we are on tablet (or mobile), just return the wrapped contnt directly.
13+
const isHighlighted =
14+
!isTablet && !!highlightedAddress && highlightedAddress.toLowerCase() === address.toLowerCase()
1015
return (
1116
<Box
1217
onMouseEnter={() => highlightAddress(address)}

0 commit comments

Comments
 (0)