Download wp-calypso/apps/notifications/src/panel/templates/list-header.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/notifications/src/panel/templates/list-header.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/apps/notifications/src/panel/templates/list-header.jsx
-
curl -L -o list-header.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/notifications/src/panel/templates/list-header.jsx
1.12 kB
| import { useTranslate } from 'i18n-calypso'; | |
| import { connect } from 'react-redux'; | |
| import actions from '../state/actions'; | |
| import Gridicon from './gridicons'; | |
| import ShortcutsPopover from './shortcuts-popover'; | |
| export const ListHeader = ( { isFirst, title, viewSettings } ) => { | |
| const translate = useTranslate(); | |
| return ( | |
| <li className="wpnc__time-group-wrap"> | |
| <div className="wpnc__time-group-title"> | |
| <span className="wpnc__time-title"> | |
| <Gridicon icon="time" size={ 18 } /> | |
| { title } | |
| </span> | |
| { isFirst && ( | |
| <> | |
| <span | |
| className="wpnc__settings" | |
| onClick={ viewSettings } | |
| onKeyDown={ ( e ) => { | |
| if ( e.key === 'Enter' ) { | |
| viewSettings(); | |
| } | |
| } } | |
| aria-label={ translate( 'Open notification settings' ) } | |
| role="button" | |
| tabIndex="0" | |
| > | |
| <Gridicon icon="cog" size={ 18 } /> | |
| </span> | |
| <ShortcutsPopover /> | |
| </> | |
| ) } | |
| </div> | |
| </li> | |
| ); | |
| }; | |
| const mapDispatchToProps = { | |
| viewSettings: actions.ui.viewSettings, | |
| }; | |
| export default connect( null, mapDispatchToProps )( ListHeader ); | |