overleaf/services/web/frontend/js/features/outline/components/outline-root.js
Timothée Alby 5465aef099 Merge pull request #3126 from overleaf/msm-outline-react-style
Update file outline to follow React code style guidelines

GitOrigin-RevId: 8b32e27d20378cbf573d24feb799eb6f99746402
2020-09-02 02:04:47 +00:00

38 lines
981 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react'
import PropTypes from 'prop-types'
import OutlineList from './outline-list'
function OutlineRoot({ outline, jumpToLine, highlightedLine }) {
return (
<div>
{outline.length ? (
<OutlineList
outline={outline}
jumpToLine={jumpToLine}
isRoot
highlightedLine={highlightedLine}
/>
) : (
<div className="outline-body-no-elements">
We cant find any sections or subsections in this file.{' '}
<a
href="/learn/how-to/Using_the_File_Outline_feature"
className="outline-body-link"
target="_blank"
rel="noopener noreferrer"
>
Find out more about the file outline
</a>
</div>
)}
</div>
)
}
OutlineRoot.propTypes = {
outline: PropTypes.array.isRequired,
jumpToLine: PropTypes.func.isRequired,
highlightedLine: PropTypes.number
}
export default OutlineRoot