diff --git a/app/components/Button.js b/app/components/Button.js index c6eafb4c..8d102fd3 100644 --- a/app/components/Button.js +++ b/app/components/Button.js @@ -14,7 +14,7 @@ const RealButton = styled.button` border-radius: 4px; font-size: 12px; font-weight: 500; - height: 36px; + height: ${props => (props.small ? 24 : 36)}px; text-decoration: none; text-transform: uppercase; flex-shrink: 0; @@ -69,9 +69,9 @@ const Label = styled.span` `; const Inner = styled.span` - padding: 0 12px; + padding: 0 ${props => (props.small ? 8 : 12)}px; display: flex; - line-height: 28px; + line-height: ${props => (props.small ? 24 : 28)}px; justify-content: center; align-items: center; @@ -86,6 +86,7 @@ export type Props = { icon?: React.Node, className?: string, children?: React.Node, + small?: boolean, }; export default function Button({ @@ -93,14 +94,15 @@ export default function Button({ icon, children, value, + small, ...rest }: Props) { const hasText = children !== undefined || value !== undefined; const hasIcon = icon !== undefined; return ( - - + + {hasIcon && icon} {hasText && } diff --git a/app/components/Modal.js b/app/components/Modal.js index 4903daac..b3759e92 100644 --- a/app/components/Modal.js +++ b/app/components/Modal.js @@ -46,7 +46,8 @@ const Modal = ({ {title &&

{title}

} - + + esc {children}
@@ -80,6 +81,13 @@ const StyledModal = styled(ReactModal)` outline: none; `; +const Esc = styled.span` + display: block; + text-align: center; + margin-top: -10px; + font-size: 13px; +`; + const Close = styled.a` position: fixed; top: 16px; diff --git a/app/components/Tip.js b/app/components/Tip.js index 0301accf..b5767183 100644 --- a/app/components/Tip.js +++ b/app/components/Tip.js @@ -4,7 +4,6 @@ import { observable } from 'mobx'; import { observer } from 'mobx-react'; import styled from 'styled-components'; import { CloseIcon } from 'outline-icons'; -import Button from './Button'; import Tooltip from './Tooltip'; import Flex from 'shared/components/Flex'; diff --git a/app/scenes/Document/Document.js b/app/scenes/Document/Document.js index d08b29d4..fea7430d 100644 --- a/app/scenes/Document/Document.js +++ b/app/scenes/Document/Document.js @@ -300,7 +300,9 @@ class DocumentScene extends React.Component { if (!document || !Editor) { return ( - + @@ -330,7 +332,7 @@ class DocumentScene extends React.Component { )} /> {(this.isUploading || this.isSaving) && } diff --git a/app/scenes/Document/components/Header.js b/app/scenes/Document/components/Header.js index 517d032a..83229d90 100644 --- a/app/scenes/Document/components/Header.js +++ b/app/scenes/Document/components/Header.js @@ -15,6 +15,7 @@ import Breadcrumb from './Breadcrumb'; import DocumentMenu from 'menus/DocumentMenu'; import NewChildDocumentMenu from 'menus/NewChildDocumentMenu'; import DocumentShare from 'scenes/DocumentShare'; +import Button from 'components/Button'; import Modal from 'components/Modal'; import Collaborators from 'components/Collaborators'; import { Action, Separator } from 'components/Actions'; @@ -126,45 +127,53 @@ class Header extends React.Component { Saving… )} - {isDraft && ( - - - {isPublishing ? 'Publishing…' : 'Publish'} - - - )} {!isDraft && !isEditing && canShareDocuments && ( - + )} {isEditing && ( - - {isDraft ? 'Save Draft' : 'Done'} - + {isDraft ? 'Save Draft' : 'Done Editing'} + )} + {isDraft && ( + + + + )} {!isEditing && ( - Edit + )} {!isEditing && ( @@ -250,15 +259,4 @@ const Title = styled.div` `}; `; -const Link = styled.a` - display: flex; - align-items: center; - font-weight: ${props => (props.highlight ? 500 : 'inherit')}; - color: ${props => - props.highlight ? `${props.theme.primary} !important` : 'inherit'}; - opacity: ${props => (props.disabled ? 0.5 : 1)}; - pointer-events: ${props => (props.disabled ? 'none' : 'auto')}; - cursor: ${props => (props.disabled ? 'default' : 'pointer')}; -`; - export default inject('auth')(Header);