chore: Lint shared directory

This commit is contained in:
Tom Moor
2020-06-22 21:29:21 -07:00
parent 26f6961c82
commit 9be5597f4b
27 changed files with 342 additions and 341 deletions

View File

@@ -1,7 +1,7 @@
// @flow
import * as React from 'react';
import styled from 'styled-components';
import OutlineLogo from './OutlineLogo';
import * as React from "react";
import styled from "styled-components";
import OutlineLogo from "./OutlineLogo";
type Props = {
href?: string,

View File

@@ -1,17 +1,17 @@
// @flow
import * as React from 'react';
import { observer, inject } from 'mobx-react';
import breakpoint from 'styled-components-breakpoint';
import styled from 'styled-components';
import { Link } from 'react-router-dom';
import { PadlockIcon, GoToIcon, MoreIcon } from 'outline-icons';
import * as React from "react";
import { observer, inject } from "mobx-react";
import breakpoint from "styled-components-breakpoint";
import styled from "styled-components";
import { Link } from "react-router-dom";
import { PadlockIcon, GoToIcon, MoreIcon } from "outline-icons";
import Document from 'models/Document';
import CollectionsStore from 'stores/CollectionsStore';
import { collectionUrl } from 'utils/routeHelpers';
import Flex from 'shared/components/Flex';
import BreadcrumbMenu from './BreadcrumbMenu';
import CollectionIcon from 'components/CollectionIcon';
import Document from "models/Document";
import CollectionsStore from "stores/CollectionsStore";
import { collectionUrl } from "utils/routeHelpers";
import Flex from "shared/components/Flex";
import BreadcrumbMenu from "./BreadcrumbMenu";
import CollectionIcon from "components/CollectionIcon";
type Props = {
document: Document,
@@ -30,7 +30,7 @@ const Breadcrumb = observer(({ document, collections, onlyText }: Props) => {
<React.Fragment>
{collection.private && (
<React.Fragment>
<SmallPadlockIcon color="currentColor" size={16} />{' '}
<SmallPadlockIcon color="currentColor" size={16} />{" "}
</React.Fragment>
)}
{collection.name}
@@ -51,7 +51,7 @@ const Breadcrumb = observer(({ document, collections, onlyText }: Props) => {
return (
<Wrapper justify="flex-start" align="center">
<CollectionName to={collectionUrl(collection.id)}>
<CollectionIcon collection={collection} expanded />{' '}
<CollectionIcon collection={collection} expanded />{" "}
<span>{collection.name}</span>
</CollectionName>
{isNestedDocument && (
@@ -61,7 +61,7 @@ const Breadcrumb = observer(({ document, collections, onlyText }: Props) => {
)}
{lastPath && (
<React.Fragment>
<Slash />{' '}
<Slash />{" "}
<Crumb to={lastPath.url} title={lastPath.title}>
{lastPath.title}
</Crumb>
@@ -74,7 +74,7 @@ const Breadcrumb = observer(({ document, collections, onlyText }: Props) => {
const Wrapper = styled(Flex)`
display: none;
${breakpoint('tablet')`
${breakpoint("tablet")`
display: flex;
`};
`;
@@ -130,4 +130,4 @@ const CollectionName = styled(Link)`
overflow: hidden;
`;
export default inject('collections')(Breadcrumb);
export default inject("collections")(Breadcrumb);

View File

@@ -1,7 +1,7 @@
// @flow
import * as React from 'react';
import { Link } from 'react-router-dom';
import { DropdownMenu, DropdownMenuItem } from 'components/DropdownMenu';
import * as React from "react";
import { Link } from "react-router-dom";
import { DropdownMenu, DropdownMenuItem } from "components/DropdownMenu";
type Props = {
label: React.Node,

View File

@@ -1,20 +1,20 @@
// @flow
import * as React from 'react';
import styled from 'styled-components';
import * as React from "react";
import styled from "styled-components";
type JustifyValues =
| 'center'
| 'space-around'
| 'space-between'
| 'flex-start'
| 'flex-end';
| "center"
| "space-around"
| "space-between"
| "flex-start"
| "flex-end";
type AlignValues =
| 'stretch'
| 'center'
| 'baseline'
| 'flex-start'
| 'flex-end';
| "stretch"
| "center"
| "baseline"
| "flex-start"
| "flex-end";
type Props = {
column?: ?boolean,
@@ -33,11 +33,11 @@ const Flex = (props: Props) => {
const Container = styled.div`
display: flex;
flex: ${({ auto }) => (auto ? '1 1 auto' : 'initial')};
flex-direction: ${({ column }) => (column ? 'column' : 'row')};
flex: ${({ auto }) => (auto ? "1 1 auto" : "initial")};
flex-direction: ${({ column }) => (column ? "column" : "row")};
align-items: ${({ align }) => align};
justify-content: ${({ justify }) => justify};
flex-shrink: ${({ shrink }) => (shrink ? 1 : 'initial')};
flex-shrink: ${({ shrink }) => (shrink ? 1 : "initial")};
min-height: 0;
min-width: 0;
`;

View File

@@ -1,5 +1,5 @@
// @flow
import * as React from 'react';
import * as React from "react";
type Props = {
size?: number,
@@ -7,7 +7,7 @@ type Props = {
className?: string,
};
function GithubLogo({ size = 34, fill = '#FFF', className }: Props) {
function GithubLogo({ size = 34, fill = "#FFF", className }: Props) {
return (
<svg
fill={fill}

View File

@@ -1,5 +1,5 @@
// @flow
import * as React from 'react';
import * as React from "react";
type Props = {
size?: number,
@@ -7,7 +7,7 @@ type Props = {
className?: string,
};
function GoogleLogo({ size = 34, fill = '#FFF', className }: Props) {
function GoogleLogo({ size = 34, fill = "#FFF", className }: Props) {
return (
<svg
fill={fill}

View File

@@ -1,11 +1,11 @@
// @flow
import styled from 'styled-components';
import styled from "styled-components";
const Notice = styled.p`
background: ${props =>
props.muted ? props.theme.sidebarBackground : props.theme.yellow};
color: ${props =>
props.muted ? props.theme.sidebarText : 'hsla(46, 100%, 20%, 1)'};
props.muted ? props.theme.sidebarText : "hsla(46, 100%, 20%, 1)"};
padding: 10px 12px;
border-radius: 4px;
`;

View File

@@ -1,5 +1,5 @@
// @flow
import * as React from 'react';
import * as React from "react";
type Props = {
size?: number,
@@ -7,7 +7,7 @@ type Props = {
className?: string,
};
function OutlineLogo({ size = 32, fill = '#333', className }: Props) {
function OutlineLogo({ size = 32, fill = "#333", className }: Props) {
return (
<svg
fill={fill}

View File

@@ -1,5 +1,5 @@
// @flow
import * as React from 'react';
import * as React from "react";
type Props = {
size?: number,
@@ -7,7 +7,7 @@ type Props = {
className?: string,
};
function SlackLogo({ size = 34, fill = '#FFF', className }: Props) {
function SlackLogo({ size = 34, fill = "#FFF", className }: Props) {
return (
<svg
fill={fill}

View File

@@ -1,5 +1,5 @@
// @flow
import styled from 'styled-components';
import styled from "styled-components";
const TeamLogo = styled.img`
width: 38px;

View File

@@ -1,8 +1,8 @@
// @flow
import * as React from 'react';
import Tooltip from 'components/Tooltip';
import distanceInWordsToNow from 'date-fns/distance_in_words_to_now';
import format from 'date-fns/format';
import * as React from "react";
import Tooltip from "components/Tooltip";
import distanceInWordsToNow from "date-fns/distance_in_words_to_now";
import format from "date-fns/format";
let callbacks = [];
@@ -41,7 +41,7 @@ class Time extends React.Component<Props> {
render() {
return (
<Tooltip
tooltip={format(this.props.dateTime, 'MMMM Do, YYYY h:mm a')}
tooltip={format(this.props.dateTime, "MMMM Do, YYYY h:mm a")}
placement="bottom"
>
<time dateTime={this.props.dateTime}>