Download wp-calypso/client/my-sites/posts/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 784 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/posts/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/my-sites/posts/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/posts/index.js
784 Bytes
| import page from '@automattic/calypso-router'; | |
| import { makeLayout, render as clientRender, redirectIfDuplicatedView } from 'calypso/controller'; | |
| import { getSiteFragment } from 'calypso/lib/route'; | |
| import { navigation, siteSelection } from 'calypso/my-sites/controller'; | |
| import postsController from './controller'; | |
| export default function () { | |
| page( | |
| '/posts/:author(my)?/:status(published|drafts|scheduled|trashed)?/:domain?', | |
| siteSelection, | |
| redirectIfDuplicatedView( 'edit.php' ), | |
| navigation, | |
| postsController.posts, | |
| makeLayout, | |
| clientRender | |
| ); | |
| page( '/posts/*', ( { path } ) => { | |
| const siteFragment = getSiteFragment( path ); | |
| if ( siteFragment ) { | |
| return page.redirect( `/posts/my/${ siteFragment }` ); | |
| } | |
| return page.redirect( '/posts/my' ); | |
| } ); | |
| } | |