File size: 847 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { Button, Tooltip } from '@wordpress/components';
import { pullquote, drawerLeft } from '@wordpress/icons';
import { translate } from 'i18n-calypso';
import { useFollowingView } from './view-preference';

export default function ViewToggle() {
	const { currentView, setView } = useFollowingView();

	return (
		<div className="following__view-toggle">
			<Tooltip text={ translate( 'Full post' ) }>
				<Button
					icon={ drawerLeft }
					isPressed={ currentView === 'recent' }
					onClick={ () => setView( 'recent' ) }
					label={ translate( 'Full post' ) }
				/>
			</Tooltip>
			<Tooltip text={ translate( 'Scrolling feed' ) }>
				<Button
					icon={ pullquote }
					isPressed={ currentView === 'stream' }
					onClick={ () => setView( 'stream' ) }
					label={ translate( 'Scrolling feed' ) }
				/>
			</Tooltip>
		</div>
	);
}