Download wp-calypso/apps/odyssey-stats/src/components/odyssey-formatted-header.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 752 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/odyssey-stats/src/components/odyssey-formatted-header.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/apps/odyssey-stats/src/components/odyssey-formatted-header.tsx
-
curl -L -o odyssey-formatted-header.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/odyssey-stats/src/components/odyssey-formatted-header.tsx
752 Bytes
| import config from '@automattic/calypso-config'; | |
| import CalypsoFormattedHeader, { | |
| Props as FormattedHeaderProps, | |
| } from 'calypso/components/formatted-header'; | |
| import JetpackHeader from 'calypso/components/jetpack/jetpack-header'; | |
| import { useSelector } from 'calypso/state'; | |
| import { isSimpleSite } from 'calypso/state/sites/selectors'; | |
| export default function FormattedHeader( { ...props }: FormattedHeaderProps ) { | |
| const isSiteSimple = useSelector( ( state ) => isSimpleSite( state ) ); | |
| const isWPAdmin = config.isEnabled( 'is_odyssey' ); | |
| // Calypso deals with admin colors already, so skip if not in WP Admin. | |
| if ( ! isWPAdmin || isSiteSimple ) { | |
| return <CalypsoFormattedHeader { ...props } />; | |
| } | |
| return <JetpackHeader { ...props } />; | |
| } | |