flow: Correctly type Theme
This commit is contained in:
@ -11,11 +11,12 @@ import Avatar from "components/Avatar";
|
|||||||
import Flex from "components/Flex";
|
import Flex from "components/Flex";
|
||||||
import Time from "components/Time";
|
import Time from "components/Time";
|
||||||
import RevisionMenu from "menus/RevisionMenu";
|
import RevisionMenu from "menus/RevisionMenu";
|
||||||
|
import { type Theme } from "types";
|
||||||
|
|
||||||
import { documentHistoryUrl } from "utils/routeHelpers";
|
import { documentHistoryUrl } from "utils/routeHelpers";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
theme: Object,
|
theme: Theme,
|
||||||
showMenu: boolean,
|
showMenu: boolean,
|
||||||
selected: boolean,
|
selected: boolean,
|
||||||
document: Document,
|
document: Document,
|
||||||
|
@ -7,11 +7,12 @@ import keydown from "react-keydown";
|
|||||||
import { withRouter, type RouterHistory } from "react-router-dom";
|
import { withRouter, type RouterHistory } from "react-router-dom";
|
||||||
import styled, { withTheme } from "styled-components";
|
import styled, { withTheme } from "styled-components";
|
||||||
import Input from "./Input";
|
import Input from "./Input";
|
||||||
|
import { type Theme } from "types";
|
||||||
import { searchUrl } from "utils/routeHelpers";
|
import { searchUrl } from "utils/routeHelpers";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
history: RouterHistory,
|
history: RouterHistory,
|
||||||
theme: Object,
|
theme: Theme,
|
||||||
source: string,
|
source: string,
|
||||||
placeholder?: string,
|
placeholder?: string,
|
||||||
collectionId?: string,
|
collectionId?: string,
|
||||||
|
@ -21,6 +21,7 @@ import { LoadingIndicatorBar } from "components/LoadingIndicator";
|
|||||||
import Modal from "components/Modal";
|
import Modal from "components/Modal";
|
||||||
import Sidebar from "components/Sidebar";
|
import Sidebar from "components/Sidebar";
|
||||||
import SettingsSidebar from "components/Sidebar/Settings";
|
import SettingsSidebar from "components/Sidebar/Settings";
|
||||||
|
import { type Theme } from "types";
|
||||||
import {
|
import {
|
||||||
homeUrl,
|
homeUrl,
|
||||||
searchUrl,
|
searchUrl,
|
||||||
@ -35,7 +36,7 @@ type Props = {
|
|||||||
auth: AuthStore,
|
auth: AuthStore,
|
||||||
ui: UiStore,
|
ui: UiStore,
|
||||||
notifications?: React.Node,
|
notifications?: React.Node,
|
||||||
theme: Object,
|
theme: Theme,
|
||||||
};
|
};
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
|
@ -5,6 +5,7 @@ import * as React from "react";
|
|||||||
import { withRouter, NavLink } from "react-router-dom";
|
import { withRouter, NavLink } from "react-router-dom";
|
||||||
import styled, { withTheme } from "styled-components";
|
import styled, { withTheme } from "styled-components";
|
||||||
import Flex from "components/Flex";
|
import Flex from "components/Flex";
|
||||||
|
import { type Theme } from "types";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
to?: string | Object,
|
to?: string | Object,
|
||||||
@ -19,7 +20,7 @@ type Props = {
|
|||||||
hideDisclosure?: boolean,
|
hideDisclosure?: boolean,
|
||||||
iconColor?: string,
|
iconColor?: string,
|
||||||
active?: boolean,
|
active?: boolean,
|
||||||
theme: Object,
|
theme: Theme,
|
||||||
exact?: boolean,
|
exact?: boolean,
|
||||||
depth?: number,
|
depth?: number,
|
||||||
};
|
};
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { NavLink } from "react-router-dom";
|
import { NavLink } from "react-router-dom";
|
||||||
import styled, { withTheme } from "styled-components";
|
import styled, { withTheme } from "styled-components";
|
||||||
|
import { type Theme } from "types";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
theme: Object,
|
theme: Theme,
|
||||||
};
|
};
|
||||||
|
|
||||||
const StyledNavLink = styled(NavLink)`
|
const StyledNavLink = styled(NavLink)`
|
||||||
|
@ -36,6 +36,7 @@ import Tab from "components/Tab";
|
|||||||
import Tabs from "components/Tabs";
|
import Tabs from "components/Tabs";
|
||||||
import Tooltip from "components/Tooltip";
|
import Tooltip from "components/Tooltip";
|
||||||
import CollectionMenu from "menus/CollectionMenu";
|
import CollectionMenu from "menus/CollectionMenu";
|
||||||
|
import { type Theme } from "types";
|
||||||
import { AuthorizationError } from "utils/errors";
|
import { AuthorizationError } from "utils/errors";
|
||||||
import { newDocumentUrl, collectionUrl } from "utils/routeHelpers";
|
import { newDocumentUrl, collectionUrl } from "utils/routeHelpers";
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ type Props = {
|
|||||||
collections: CollectionsStore,
|
collections: CollectionsStore,
|
||||||
policies: PoliciesStore,
|
policies: PoliciesStore,
|
||||||
match: Match,
|
match: Match,
|
||||||
theme: Object,
|
theme: Theme,
|
||||||
};
|
};
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
|
@ -22,7 +22,7 @@ import DocumentComponent from "./Document";
|
|||||||
import HideSidebar from "./HideSidebar";
|
import HideSidebar from "./HideSidebar";
|
||||||
import Loading from "./Loading";
|
import Loading from "./Loading";
|
||||||
import SocketPresence from "./SocketPresence";
|
import SocketPresence from "./SocketPresence";
|
||||||
import { type LocationWithState } from "types";
|
import { type LocationWithState, type Theme } from "types";
|
||||||
import { NotFoundError, OfflineError } from "utils/errors";
|
import { NotFoundError, OfflineError } from "utils/errors";
|
||||||
import isInternalUrl from "utils/isInternalUrl";
|
import isInternalUrl from "utils/isInternalUrl";
|
||||||
import { matchDocumentEdit, updateDocumentUrl } from "utils/routeHelpers";
|
import { matchDocumentEdit, updateDocumentUrl } from "utils/routeHelpers";
|
||||||
@ -35,7 +35,7 @@ type Props = {|
|
|||||||
policies: PoliciesStore,
|
policies: PoliciesStore,
|
||||||
revisions: RevisionsStore,
|
revisions: RevisionsStore,
|
||||||
ui: UiStore,
|
ui: UiStore,
|
||||||
theme: Object,
|
theme: Theme,
|
||||||
history: RouterHistory,
|
history: RouterHistory,
|
||||||
|};
|
|};
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ import Header from "./Header";
|
|||||||
import KeyboardShortcutsButton from "./KeyboardShortcutsButton";
|
import KeyboardShortcutsButton from "./KeyboardShortcutsButton";
|
||||||
import MarkAsViewed from "./MarkAsViewed";
|
import MarkAsViewed from "./MarkAsViewed";
|
||||||
import References from "./References";
|
import References from "./References";
|
||||||
import { type LocationWithState } from "types";
|
import { type LocationWithState, type Theme } from "types";
|
||||||
import { isCustomDomain } from "utils/domains";
|
import { isCustomDomain } from "utils/domains";
|
||||||
import { emojiToUrl } from "utils/emoji";
|
import { emojiToUrl } from "utils/emoji";
|
||||||
import {
|
import {
|
||||||
@ -62,7 +62,7 @@ type Props = {
|
|||||||
readOnly: boolean,
|
readOnly: boolean,
|
||||||
onCreateLink: (title: string) => string,
|
onCreateLink: (title: string) => string,
|
||||||
onSearchLink: (term: string) => any,
|
onSearchLink: (term: string) => any,
|
||||||
theme: Object,
|
theme: Theme,
|
||||||
auth: AuthStore,
|
auth: AuthStore,
|
||||||
ui: UiStore,
|
ui: UiStore,
|
||||||
};
|
};
|
||||||
|
@ -3,11 +3,12 @@ import { SearchIcon } from "outline-icons";
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import styled, { withTheme } from "styled-components";
|
import styled, { withTheme } from "styled-components";
|
||||||
import Flex from "components/Flex";
|
import Flex from "components/Flex";
|
||||||
|
import { type Theme } from "types";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
onChange: (string) => void,
|
onChange: (string) => void,
|
||||||
defaultValue?: string,
|
defaultValue?: string,
|
||||||
theme: Object,
|
theme: Theme,
|
||||||
};
|
};
|
||||||
|
|
||||||
class SearchField extends React.Component<Props> {
|
class SearchField extends React.Component<Props> {
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import { type Location } from "react-router-dom";
|
import { type Location } from "react-router-dom";
|
||||||
|
import theme from "shared/styles/theme";
|
||||||
import Document from "models/Document";
|
import Document from "models/Document";
|
||||||
|
|
||||||
|
export type Theme = typeof theme;
|
||||||
|
|
||||||
export type LocationWithState = Location & {
|
export type LocationWithState = Location & {
|
||||||
state: {
|
state: {
|
||||||
[key: string]: string,
|
[key: string]: string,
|
||||||
|
Reference in New Issue
Block a user