Download wp-calypso/client/my-sites/customize/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/customize/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/my-sites/customize/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/customize/index.js
1 kB
| import page from '@automattic/calypso-router'; | |
| import { makeLayout, render as clientRender } from 'calypso/controller'; | |
| import { siteSelection, sites, navigation } from 'calypso/my-sites/controller'; | |
| import { getCustomizerUrl, getSiteAdminUrl } from 'calypso/state/sites/selectors'; | |
| import { getSelectedSiteId } from 'calypso/state/ui/selectors'; | |
| export default function () { | |
| page( '/customize/:panel([^.]+)?', siteSelection, sites, makeLayout, clientRender ); | |
| page( | |
| '/customize/:panel?/:domain', | |
| siteSelection, | |
| navigation, | |
| ( context ) => { | |
| const { getState } = context.store; | |
| const { panel } = context.params; | |
| const state = getState(); | |
| const siteId = getSelectedSiteId( state ); | |
| if ( siteId ) { | |
| const adminUrl = getSiteAdminUrl( state, siteId, '' ); | |
| const customizerUrl = getCustomizerUrl( state, siteId, panel || null, adminUrl ); | |
| if ( customizerUrl ) { | |
| window.location.href = customizerUrl; | |
| return; | |
| } | |
| } | |
| }, | |
| makeLayout, | |
| clientRender | |
| ); | |
| } | |