diff --git a/src/components/Contents/index.js b/src/components/Contents/index.js index eab245b06..16069545e 100644 --- a/src/components/Contents/index.js +++ b/src/components/Contents/index.js @@ -1,23 +1,15 @@ import React, { useContext } from 'react'; import PropTypes from 'prop-types'; -import styled from '@emotion/styled'; -import { theme } from '../../theme/docsTheme'; import { formatText } from '../../utils/format-text'; import { ContentsContext } from './contents-context'; import ContentsList from './ContentsList'; import ContentsListItem from './ContentsListItem'; -const StyledContents = styled('div')` - @media ${theme.screenSize.largeAndUp} { - display: ${(props) => (props.displayOnDesktopOnly ? '' : 'none')}; - } -`; - const formatTextOptions = { literalEnableInline: true, }; -const Contents = ({ displayOnDesktopOnly }) => { +const Contents = ({ className }) => { const { activeHeadingId, headingNodes, showContentsComponent } = useContext(ContentsContext); if (headingNodes.length === 0 || !showContentsComponent) { @@ -27,7 +19,7 @@ const Contents = ({ displayOnDesktopOnly }) => { const label = 'On this page'; return ( - +
{headingNodes.map(({ depth, id, title }) => { // Depth of heading nodes refers to their depth in the AST @@ -39,12 +31,12 @@ const Contents = ({ displayOnDesktopOnly }) => { ); })} - +
); }; Contents.propTypes = { - displayOnDesktopOnly: PropTypes.bool, + className: PropTypes.string, }; export default Contents; diff --git a/src/components/DocumentBody.js b/src/components/DocumentBody.js index 7d7c78f8c..aced08aea 100644 --- a/src/components/DocumentBody.js +++ b/src/components/DocumentBody.js @@ -150,7 +150,7 @@ const DocumentBody = (props) => { > - +