We will be sunsetting Advisor during Jan, 2026 and will instead be providing information in Snyk Security DB.

You can begin to take advantage of Snyk Security DB today for a unified, package-centric experience.

How to use the @automattic/data-stores.VerticalsTemplates.register function in @automattic/data-stores

To help you get started, we’ve selected a few @automattic/data-stores examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Automattic / wp-calypso / client / landing / gutenboarding / onboarding-block / design-selector / index.tsx View on Github external
import { CSSTransition } from 'react-transition-group';
import PageLayoutSelector from './page-layout-selector';
import { partition } from 'lodash';

/**
 * Internal dependencies
 */
import { SiteVertical } from '../../stores/onboard/types';
import DesignCard from './design-card';

import './style.scss';
import { VerticalsTemplates } from '@automattic/data-stores';

type Template = VerticalsTemplates.Template;

const VERTICALS_TEMPLATES_STORE = VerticalsTemplates.register();

const DesignSelector: FunctionComponent = () => {
	const siteVertical = useSelect(
		select => select( 'automattic/onboard' ).getState().siteVertical as SiteVertical
	);

	const templates =
		useSelect( select => select( VERTICALS_TEMPLATES_STORE ).getTemplates( siteVertical.id ) ) ??
		[];

	const [ designs, otherTemplates ] = partition(
		templates,
		( { category } ) => category === 'home'
	);

	const [ selectedDesign, setSelectedDesign ] = useState< Template | undefined >();

@automattic/data-stores

Calypso Data Stores.

GPL-2.0
Latest version published 2 months ago

Package Health Score

87 / 100
Full package analysis

Similar packages