Styling document actions more inline with medium
This commit is contained in:
@ -65,6 +65,7 @@ const Label = styled(Flex).attrs({
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
})`
|
})`
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
|
cursor: pointer;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const MenuContainer = styled.div`
|
const MenuContainer = styled.div`
|
||||||
|
@ -18,8 +18,8 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const activeStyle = {
|
const activeStyle = {
|
||||||
color: '#000',
|
color: color.black,
|
||||||
background: '#E1E1E1',
|
background: color.slateDark,
|
||||||
};
|
};
|
||||||
|
|
||||||
@observer class SidebarCollection extends React.Component {
|
@observer class SidebarCollection extends React.Component {
|
||||||
|
@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import { observer, inject } from 'mobx-react';
|
import { observer, inject } from 'mobx-react';
|
||||||
import Flex from 'components/Flex';
|
import Flex from 'components/Flex';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { color, layout } from 'styles/constants';
|
import { color, layout, fontWeight } from 'styles/constants';
|
||||||
|
|
||||||
import SidebarLink from '../SidebarLink';
|
import SidebarLink from '../SidebarLink';
|
||||||
import DropToImport from 'components/DropToImport';
|
import DropToImport from 'components/DropToImport';
|
||||||
@ -16,8 +16,8 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const activeStyle = {
|
const activeStyle = {
|
||||||
color: '#000',
|
color: color.black,
|
||||||
background: '#E1E1E1',
|
background: color.slateDark,
|
||||||
};
|
};
|
||||||
|
|
||||||
const SidebarCollectionList = observer(({ history, collections }: Props) => {
|
const SidebarCollectionList = observer(({ history, collections }: Props) => {
|
||||||
@ -42,7 +42,7 @@ const SidebarCollectionList = observer(({ history, collections }: Props) => {
|
|||||||
|
|
||||||
const Header = styled(Flex)`
|
const Header = styled(Flex)`
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
font-weight: 500;
|
font-weight: ${fontWeight.semiBold};
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
color: ${color.slate};
|
color: ${color.slate};
|
||||||
letter-spacing: 0.04em;
|
letter-spacing: 0.04em;
|
||||||
|
@ -1,26 +1,28 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { NavLink } from 'react-router-dom';
|
import { NavLink } from 'react-router-dom';
|
||||||
import { layout, color } from 'styles/constants';
|
import { layout, color, fontWeight } from 'styles/constants';
|
||||||
import { darken } from 'polished';
|
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
const activeStyle = {
|
const activeStyle = {
|
||||||
color: '#000000',
|
color: color.black,
|
||||||
|
fontWeight: fontWeight.semiBold,
|
||||||
};
|
};
|
||||||
|
|
||||||
function SidebarLink(props: Object) {
|
function SidebarLink(props: Object) {
|
||||||
return <StyledNavLink exact {...props} activeStyle={activeStyle} />;
|
return <StyledNavLink exact activeStyle={activeStyle} {...props} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const StyledNavLink = styled(NavLink)`
|
const StyledNavLink = styled(NavLink)`
|
||||||
display: block;
|
display: block;
|
||||||
padding: 5px ${layout.hpadding};
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
margin: 5px ${layout.hpadding};
|
||||||
color: ${color.slateDark};
|
color: ${color.slateDark};
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: ${darken(0.1, color.slateDark)};
|
color: ${color.text};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -13,9 +13,7 @@ import DocumentsStore from 'stores/DocumentsStore';
|
|||||||
import Menu from './components/Menu';
|
import Menu from './components/Menu';
|
||||||
import SaveAction from './components/SaveAction';
|
import SaveAction from './components/SaveAction';
|
||||||
import LoadingPlaceholder from 'components/LoadingPlaceholder';
|
import LoadingPlaceholder from 'components/LoadingPlaceholder';
|
||||||
import Button from 'components/Button';
|
|
||||||
import Editor from 'components/Editor';
|
import Editor from 'components/Editor';
|
||||||
import Icon from 'components/Icon';
|
|
||||||
import DropToImport from 'components/DropToImport';
|
import DropToImport from 'components/DropToImport';
|
||||||
import LoadingIndicator from 'components/LoadingIndicator';
|
import LoadingIndicator from 'components/LoadingIndicator';
|
||||||
import Collaborators from 'components/Collaborators';
|
import Collaborators from 'components/Collaborators';
|
||||||
@ -105,6 +103,11 @@ type Props = {
|
|||||||
this.props.history.push(url);
|
this.props.history.push(url);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onClickNew = () => {
|
||||||
|
if (!this.document) return;
|
||||||
|
this.props.history.push(`${this.document.collection.url}/new`);
|
||||||
|
};
|
||||||
|
|
||||||
onSave = async (redirect: boolean = false) => {
|
onSave = async (redirect: boolean = false) => {
|
||||||
if (this.document && !this.document.allowSave) return;
|
if (this.document && !this.document.allowSave) return;
|
||||||
let document = this.document;
|
let document = this.document;
|
||||||
@ -216,24 +219,21 @@ type Props = {
|
|||||||
}
|
}
|
||||||
isNew={!!isNew}
|
isNew={!!isNew}
|
||||||
/>
|
/>
|
||||||
: <Button onClick={this.onClickEdit} light small>
|
: <a onClick={this.onClickEdit}>
|
||||||
Edit
|
Edit
|
||||||
</Button>}
|
</a>}
|
||||||
</HeaderAction>
|
</HeaderAction>
|
||||||
<HeaderAction>
|
<HeaderAction>
|
||||||
{isEditing
|
{isEditing
|
||||||
? <a onClick={this.onCancel}>Cancel</a>
|
? <a onClick={this.onCancel}>Cancel</a>
|
||||||
: <Button
|
: <Menu document={document} />}
|
||||||
icon={<Menu document={document} />}
|
|
||||||
light
|
|
||||||
small
|
|
||||||
/>}
|
|
||||||
</HeaderAction>
|
</HeaderAction>
|
||||||
|
{!isEditing && <Separator />}
|
||||||
<HeaderAction>
|
<HeaderAction>
|
||||||
{!isEditing &&
|
{!isEditing &&
|
||||||
<Button onClick={this.onClickEdit} light small>
|
<a onClick={this.onClickNew}>
|
||||||
New
|
New
|
||||||
</Button>}
|
</a>}
|
||||||
</HeaderAction>
|
</HeaderAction>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Meta>
|
</Meta>
|
||||||
@ -244,15 +244,29 @@ type Props = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Separator = styled.div`
|
||||||
|
margin-left: 12px;
|
||||||
|
width: 1px;
|
||||||
|
height: 20px;
|
||||||
|
background: ${color.slateLight};
|
||||||
|
`;
|
||||||
|
|
||||||
const HeaderAction = styled(Flex)`
|
const HeaderAction = styled(Flex)`
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
min-height: 43px;
|
min-height: 43px;
|
||||||
color: ${color.text};
|
color: ${color.text};
|
||||||
padding: 0 0 0 10px;
|
padding: 0 0 0 14px;
|
||||||
|
|
||||||
a {
|
a,
|
||||||
|
svg {
|
||||||
color: ${color.text};
|
color: ${color.text};
|
||||||
|
opacity: .8;
|
||||||
|
transition: opacity 100ms ease-in-out;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ export const fontWeight = {
|
|||||||
light: 300,
|
light: 300,
|
||||||
regular: 400,
|
regular: 400,
|
||||||
medium: 500,
|
medium: 500,
|
||||||
demiBold: 600,
|
semiBold: 600,
|
||||||
bold: 700,
|
bold: 700,
|
||||||
heavy: 800,
|
heavy: 800,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user