/
githubmirror
/
docusaurus
Обзор
Документация
Войти
/
githubmirror
/
docusaurus
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
website/src/theme/DocSidebar/Desktop/Content/index.js
31 строка
842 B
Joshua Chen
chore: enable import/order rule (#7418)
14 май 2022, 18:39
Не верифицирован
14 май 2022, 18:39
0838884
Код
Авторство
О чём код?
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import React from 'react'; import {useLocation} from '@docusaurus/router'; import Content from '@theme-original/DocSidebar/Desktop/Content'; function SidebarAd() { return ( // eslint-disable-next-line @docusaurus/no-untranslated-text <div style={{border: 'solid thin red', padding: 10, textAlign: 'center'}}> Sidebar Ad </div> ); } export default function ContentWrapper(props) { const {pathname} = useLocation(); const shouldShowSidebarAd = pathname.includes('/tests/'); return ( <> {shouldShowSidebarAd && <SidebarAd />} <Content {...props} /> {shouldShowSidebarAd && <SidebarAd />} </> ); }