Fixes and improvements to the Profile Preview modal (#992)
* Fix: use more reliable navigation method * Fix: show lightbox over the active modal * Fix: close the profile preview on navigation * Factor out UserPreviewLink and add preview behavior to notifications * Fix postmeta overflow on web * Fix lint
This commit is contained in:
		
							parent
							
								
									d8aded7b15
								
							
						
					
					
						commit
						237e957d16
					
				
					 8 changed files with 101 additions and 59 deletions
				
			
		| 
						 | 
				
			
			@ -33,6 +33,7 @@ import {isDesktopWeb, isNative} from 'platform/detection'
 | 
			
		|||
import {FollowState} from 'state/models/cache/my-follows'
 | 
			
		||||
import {shareUrl} from 'lib/sharing'
 | 
			
		||||
import {formatCount} from '../util/numeric/format'
 | 
			
		||||
import {navigate} from '../../../Navigation'
 | 
			
		||||
 | 
			
		||||
const BACK_HITSLOP = {left: 30, top: 30, right: 30, bottom: 30}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -143,13 +144,15 @@ const ProfileHeaderLoaded = observer(
 | 
			
		|||
 | 
			
		||||
    const onPressFollowers = React.useCallback(() => {
 | 
			
		||||
      track('ProfileHeader:FollowersButtonClicked')
 | 
			
		||||
      navigation.push('ProfileFollowers', {name: view.handle})
 | 
			
		||||
    }, [track, navigation, view])
 | 
			
		||||
      navigate('ProfileFollowers', {name: view.handle})
 | 
			
		||||
      store.shell.closeAllActiveElements() // for when used in the profile preview modal
 | 
			
		||||
    }, [track, view, store.shell])
 | 
			
		||||
 | 
			
		||||
    const onPressFollows = React.useCallback(() => {
 | 
			
		||||
      track('ProfileHeader:FollowsButtonClicked')
 | 
			
		||||
      navigation.push('ProfileFollows', {name: view.handle})
 | 
			
		||||
    }, [track, navigation, view])
 | 
			
		||||
      navigate('ProfileFollows', {name: view.handle})
 | 
			
		||||
      store.shell.closeAllActiveElements() // for when used in the profile preview modal
 | 
			
		||||
    }, [track, view, store.shell])
 | 
			
		||||
 | 
			
		||||
    const onPressShare = React.useCallback(() => {
 | 
			
		||||
      track('ProfileHeader:ShareButtonClicked')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue