You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			36 lines
		
	
	
		
			972 B
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			36 lines
		
	
	
		
			972 B
		
	
	
	
		
			TypeScript
		
	
import React, { useContext } from 'react';
 | 
						|
import { useSelector } from 'react-redux';
 | 
						|
import styled, { ThemeContext } from 'styled-components';
 | 
						|
import { getShowScrollButton } from '../../state/selectors/conversations';
 | 
						|
 | 
						|
import { SessionIconButton, SessionIconSize, SessionIconType } from './icon';
 | 
						|
 | 
						|
type Props = {
 | 
						|
  onClick?: () => any;
 | 
						|
};
 | 
						|
 | 
						|
const SessionScrollButtonDiv = styled.div`
 | 
						|
  position: fixed;
 | 
						|
  z-index: 2;
 | 
						|
  right: 60px;
 | 
						|
  animation: fadein ${props => props.theme.common.animations.defaultDuration};
 | 
						|
`;
 | 
						|
 | 
						|
export const SessionScrollButton = (props: Props) => {
 | 
						|
  const themeContext = useContext(ThemeContext);
 | 
						|
 | 
						|
  const show = useSelector(getShowScrollButton);
 | 
						|
 | 
						|
  return (
 | 
						|
    <SessionScrollButtonDiv theme={themeContext}>
 | 
						|
      <SessionIconButton
 | 
						|
        iconType={SessionIconType.Chevron}
 | 
						|
        iconSize={SessionIconSize.Huge}
 | 
						|
        isHidden={!show}
 | 
						|
        onClick={props.onClick}
 | 
						|
        theme={themeContext}
 | 
						|
      />
 | 
						|
    </SessionScrollButtonDiv>
 | 
						|
  );
 | 
						|
};
 |