diff --git a/app/components/PathToDocument.js b/app/components/PathToDocument.js index e739808f..8ac9d8c4 100644 --- a/app/components/PathToDocument.js +++ b/app/components/PathToDocument.js @@ -8,37 +8,6 @@ import Flex from 'shared/components/Flex'; import Document from 'models/Document'; import type { DocumentPath } from 'stores/CollectionsStore'; -const StyledGoToIcon = styled(GoToIcon)``; - -const ResultWrapper = styled.div` - display: flex; - margin-bottom: 10px; - - color: ${props => props.theme.text}; - cursor: default; -`; - -const ResultWrapperLink = styled(ResultWrapper.withComponent('a'))` - height: 32px; - padding-top: 3px; - padding-left: 5px; - - &:hover, - &:active, - &:focus { - margin-left: 0px; - border-radius: 2px; - background: ${props => props.theme.black}; - color: ${props => props.theme.smokeLight}; - outline: none; - cursor: pointer; - - ${StyledGoToIcon} { - fill: ${props => props.theme.white}; - } - } -`; - type Props = { result: DocumentPath, document?: Document, @@ -76,12 +45,12 @@ class PathToDocument extends React.Component { return ( {result.path - .map(doc => {doc.title}) + .map(doc => {doc.title}) .reduce((prev, curr) => [prev, , curr])} {document && ( {' '} - {document.title} + {document.title} )} @@ -89,4 +58,41 @@ class PathToDocument extends React.Component { } } +const Title = styled.span` + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +`; + +const StyledGoToIcon = styled(GoToIcon)``; + +const ResultWrapper = styled.div` + display: flex; + margin-bottom: 10px; + + color: ${props => props.theme.text}; + cursor: default; +`; + +const ResultWrapperLink = styled(ResultWrapper.withComponent('a'))` + height: 32px; + padding-top: 3px; + padding-left: 5px; + + &:hover, + &:active, + &:focus { + margin-left: 0px; + border-radius: 2px; + background: ${props => props.theme.black}; + color: ${props => props.theme.smokeLight}; + outline: none; + cursor: pointer; + + ${StyledGoToIcon} { + fill: ${props => props.theme.white}; + } + } +`; + export default PathToDocument;