Download wp-calypso/client/my-sites/customize/panels.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 586 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/customize/panels.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/my-sites/customize/panels.ts
-
curl -L -o panels.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/customize/panels.ts
586 Bytes
| import { PANEL_MAPPINGS } from '@automattic/help-center/src/constants'; | |
| /** | |
| * Given the name of a Calypso customizer panel, returns an object containing | |
| * the section or panel to be used in autofocus. Returns null if the panel is | |
| * not recognized. | |
| * @param {string} panel Calypso panel slug | |
| * @returns {?Object} WordPress autofocus argument object | |
| */ | |
| export function getCustomizerFocus( panel: string ) { | |
| if ( PANEL_MAPPINGS.hasOwnProperty( panel ) ) { | |
| const [ key, value ] = PANEL_MAPPINGS[ panel ]; | |
| return { [ `autofocus[${ key }]` ]: value }; | |
| } | |
| return null; | |
| } | |