Download wp-calypso/client/layout/sidebar/index.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 585 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/layout/sidebar/index.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/layout/sidebar/index.jsx
-
curl -L -o index.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/layout/sidebar/index.jsx
585 Bytes
| import clsx from 'clsx'; | |
| import { Children } from 'react'; | |
| import SidebarRegion from './region'; | |
| import './style.scss'; | |
| const Sidebar = ( { children, onClick = undefined, className = '', ...props } ) => { | |
| const hasRegions = Children.toArray( children ).some( ( el ) => el.type === SidebarRegion ); | |
| const finalClassName = clsx( 'sidebar', className, { 'has-regions': hasRegions } ); | |
| return ( | |
| <ul | |
| role="presentation" | |
| className={ finalClassName } | |
| onClick={ onClick } | |
| data-tip-target="sidebar" | |
| { ...props } | |
| > | |
| { children } | |
| </ul> | |
| ); | |
| }; | |
| export default Sidebar; | |