From c52fbb944e3ae99c0b7a78b4a77a2eb4fc9b3f0b Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 25 Aug 2020 20:03:52 -0700 Subject: [PATCH] Styling tidy up --- .../DocumentHistory/DocumentHistory.js | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/app/components/DocumentHistory/DocumentHistory.js b/app/components/DocumentHistory/DocumentHistory.js index b94d664ce..e6ce3c262 100644 --- a/app/components/DocumentHistory/DocumentHistory.js +++ b/app/components/DocumentHistory/DocumentHistory.js @@ -12,11 +12,10 @@ import breakpoint from "styled-components-breakpoint"; import { DEFAULT_PAGINATION_LIMIT } from "stores/BaseStore"; import DocumentsStore from "stores/DocumentsStore"; import RevisionsStore from "stores/RevisionsStore"; -import Document from "models/Document"; +import Button from "components/Button"; import Flex from "components/Flex"; import { ListPlaceholder } from "components/LoadingPlaceholder"; -import Button from "../Button"; import Revision from "./components/Revision"; import { documentHistoryUrl, documentUrl } from "utils/routeHelpers"; @@ -91,7 +90,11 @@ class DocumentHistory extends React.Component { return this.props.revisions.getDocumentRevisions(document.id); } - onCloseHistory = (document: Document) => { + onCloseHistory = () => { + const document = this.props.documents.getByUrl( + this.props.match.params.documentSlug + ); + this.redirectTo = documentUrl(document); }; @@ -108,11 +111,11 @@ class DocumentHistory extends React.Component {
History - } - onClick={() => this.onCloseHistory(document)} - neutral + onClick={this.onCloseHistory} borderOnHover + neutral />
{showLoading ? ( @@ -160,13 +163,18 @@ const Wrapper = styled(Flex)` `; const Sidebar = styled(Flex)` + display: none; background: ${(props) => props.theme.background}; min-width: ${(props) => props.theme.sidebarWidth}; border-left: 1px solid ${(props) => props.theme.divider}; z-index: 1; + + ${breakpoint("tablet")` + display: flex; + `}; `; -const Title = styled.div` +const Title = styled(Flex)` font-size: 16px; font-weight: 600; text-align: center; @@ -175,25 +183,16 @@ const Title = styled.div` text-overflow: ellipsis; white-space: nowrap; overflow: hidden; - display: none; width: 0; - - ${breakpoint("tablet")` - display: flex; - flex-grow: 1; - `}; + flex-grow: 1; `; const Header = styled(Flex)` + align-items: center; position: relative; - padding: 15.8px; + padding: 12px; border-bottom: 1px solid ${(props) => props.theme.divider}; -`; - -const CloseButton = styled(Button)` - position: absolute; - top: 10px; - right: 10px; + color: ${(props) => props.theme.text}; `; export default inject("documents", "revisions")(DocumentHistory);