Download wp-calypso/client/components/date-picker/event.jsx 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/components/date-picker/event.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/components/date-picker/event.jsx
-
curl -L -o event.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/date-picker/event.jsx
1 kB
| import { Gridicon } from '@automattic/components'; | |
| import clsx from 'clsx'; | |
| import SocialLogo from 'calypso/components/social-logo'; | |
| const renderIcon = ( icon ) => | |
| icon && ( | |
| <span className={ `date-picker__icon-wrapper date-picker__icon-wrapper-${ icon }` }> | |
| <Gridicon icon={ icon } size={ 18 } /> | |
| </span> | |
| ); | |
| const renderSocialIcon = ( icon, color ) => { | |
| if ( ! icon ) { | |
| return null; | |
| } | |
| const socialIconClasses = clsx( | |
| 'date-picker__social-icon-wrapper', | |
| `date-picker__social-icon-wrapper-${ icon }`, | |
| { 'date-picker__social-icon-wrapper-color': color } | |
| ); | |
| return ( | |
| <span className={ socialIconClasses }> | |
| <SocialLogo icon={ icon } size={ 18 } /> | |
| </span> | |
| ); | |
| }; | |
| export const CalendarEvent = ( { icon, socialIcon, socialIconColor = true, title } ) => { | |
| return ( | |
| <div className="date-picker__calendar-event"> | |
| { renderIcon( icon ) } | |
| { renderSocialIcon( socialIcon, socialIconColor ) } | |
| <span className="date-picker__event-title">{ title }</span> | |
| </div> | |
| ); | |
| }; | |