Download wp-calypso/client/my-sites/patterns/wrapper.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 990 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/patterns/wrapper.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/my-sites/patterns/wrapper.tsx
-
curl -L -o wrapper.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/patterns/wrapper.tsx
990 Bytes
| import { useLocale } from '@automattic/i18n-utils'; | |
| import { UniversalNavbarFooter, UniversalNavbarHeader } from '@automattic/wpcom-template-parts'; | |
| import Main from 'calypso/components/main'; | |
| import { getOnboardingUrl } from 'calypso/my-sites/patterns/paths'; | |
| import { useSelector } from 'calypso/state'; | |
| import { isUserLoggedIn } from 'calypso/state/current-user/selectors'; | |
| import './style.scss'; | |
| type PatternsWrapperProps = React.PropsWithChildren< { hideGetStartedCta?: boolean } >; | |
| export const PatternsWrapper = ( { | |
| hideGetStartedCta = false, | |
| children, | |
| }: PatternsWrapperProps ) => { | |
| const isLoggedIn = useSelector( isUserLoggedIn ); | |
| const locale = useLocale(); | |
| return ( | |
| <> | |
| { isLoggedIn && ( | |
| <UniversalNavbarHeader | |
| hideGetStartedCta={ hideGetStartedCta } | |
| isLoggedIn | |
| startUrl={ getOnboardingUrl( locale, isLoggedIn ) } | |
| /> | |
| ) } | |
| <Main fullWidthLayout>{ children }</Main> | |
| { isLoggedIn && <UniversalNavbarFooter isLoggedIn /> } | |
| </> | |
| ); | |
| }; | |