File size: 535 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import config from '@automattic/calypso-config';
import { useSelector } from 'calypso/state';
import { getCurrentQueryArguments } from 'calypso/state/selectors/get-current-query-arguments';

export interface HomeLayoutQueryParams {
	dev?: true;
	view?: string;
}

export function useHomeLayoutQueryParams(): HomeLayoutQueryParams {
	const { dev, view } = useSelector( getCurrentQueryArguments ) ?? {};

	return {
		dev: dev === 'true' || ( ! dev && config.isEnabled( 'home/layout-dev' ) ) || undefined,
		view: view?.toString(),
	};
}