UNPKG

@newrelic/gatsby-theme-newrelic

Version:

[![Community Project header](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Community_Project.png)](https://opensource.newrelic.com/oss-category/#community-project)

31 lines (26 loc) 646 B
import React, { useRef } from 'react'; import PropTypes from 'prop-types'; import { css } from '@emotion/react'; const ScrollContainer = ({ children }) => { const root = useRef(); return ( <div ref={root} css={css` border-right: 1px solid var(--border-color); height: calc(100vh - 6 * var(--site-content-padding)); overflow: auto; @media screen and (max-width: 760px) { border-right: none; height: unset; } `} > {children} </div> ); }; ScrollContainer.propTypes = { children: PropTypes.node.isRequired, }; export default ScrollContainer;