Merge pull request #2980 from overleaf/ta-outline-no-reopen

Don't Always Expand File Outline After Switching Files

GitOrigin-RevId: 639887686082e2868561c3e7300d42a73dd34f5a
This commit is contained in:
Miguel Serrano 2020-07-09 15:56:42 +02:00 committed by Copybot
parent b573374d0e
commit ce3ca981a8

View file

@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react'
import React, { useState } from 'react'
import PropTypes from 'prop-types'
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
import classNames from 'classnames'
@ -7,8 +7,6 @@ import OutlineRoot from './OutlineRoot'
function OutlinePane({ isTexFile, outline, jumpToLine }) {
const [expanded, setExpanded] = useState(true)
useEffect(() => setExpanded(isTexFile), [isTexFile])
const expandCollapseIconClasses = classNames('fa', 'outline-caret-icon', {
'fa-angle-down': expanded,
'fa-angle-right': !expanded