diff --git a/app/components/DocumentHistory/components/Revision.js b/app/components/DocumentHistory/components/Revision.js index c8d0774c..dbb228a4 100644 --- a/app/components/DocumentHistory/components/Revision.js +++ b/app/components/DocumentHistory/components/Revision.js @@ -11,11 +11,12 @@ import Avatar from "components/Avatar"; import Flex from "components/Flex"; import Time from "components/Time"; import RevisionMenu from "menus/RevisionMenu"; +import { type Theme } from "types"; import { documentHistoryUrl } from "utils/routeHelpers"; type Props = { - theme: Object, + theme: Theme, showMenu: boolean, selected: boolean, document: Document, diff --git a/app/components/InputSearch.js b/app/components/InputSearch.js index 7d594580..1ab086e1 100644 --- a/app/components/InputSearch.js +++ b/app/components/InputSearch.js @@ -7,11 +7,12 @@ import keydown from "react-keydown"; import { withRouter, type RouterHistory } from "react-router-dom"; import styled, { withTheme } from "styled-components"; import Input from "./Input"; +import { type Theme } from "types"; import { searchUrl } from "utils/routeHelpers"; type Props = { history: RouterHistory, - theme: Object, + theme: Theme, source: string, placeholder?: string, collectionId?: string, diff --git a/app/components/Layout.js b/app/components/Layout.js index fcd68518..8f58d5a1 100644 --- a/app/components/Layout.js +++ b/app/components/Layout.js @@ -21,6 +21,7 @@ import { LoadingIndicatorBar } from "components/LoadingIndicator"; import Modal from "components/Modal"; import Sidebar from "components/Sidebar"; import SettingsSidebar from "components/Sidebar/Settings"; +import { type Theme } from "types"; import { homeUrl, searchUrl, @@ -35,7 +36,7 @@ type Props = { auth: AuthStore, ui: UiStore, notifications?: React.Node, - theme: Object, + theme: Theme, }; @observer diff --git a/app/components/Sidebar/components/SidebarLink.js b/app/components/Sidebar/components/SidebarLink.js index db4f2f69..b56ac8c5 100644 --- a/app/components/Sidebar/components/SidebarLink.js +++ b/app/components/Sidebar/components/SidebarLink.js @@ -5,6 +5,7 @@ import * as React from "react"; import { withRouter, NavLink } from "react-router-dom"; import styled, { withTheme } from "styled-components"; import Flex from "components/Flex"; +import { type Theme } from "types"; type Props = { to?: string | Object, @@ -19,7 +20,7 @@ type Props = { hideDisclosure?: boolean, iconColor?: string, active?: boolean, - theme: Object, + theme: Theme, exact?: boolean, depth?: number, }; diff --git a/app/components/Tab.js b/app/components/Tab.js index 4c165b76..75b9e61d 100644 --- a/app/components/Tab.js +++ b/app/components/Tab.js @@ -2,9 +2,10 @@ import * as React from "react"; import { NavLink } from "react-router-dom"; import styled, { withTheme } from "styled-components"; +import { type Theme } from "types"; type Props = { - theme: Object, + theme: Theme, }; const StyledNavLink = styled(NavLink)` diff --git a/app/scenes/Collection.js b/app/scenes/Collection.js index 40729510..fa8e7632 100644 --- a/app/scenes/Collection.js +++ b/app/scenes/Collection.js @@ -36,6 +36,7 @@ import Tab from "components/Tab"; import Tabs from "components/Tabs"; import Tooltip from "components/Tooltip"; import CollectionMenu from "menus/CollectionMenu"; +import { type Theme } from "types"; import { AuthorizationError } from "utils/errors"; import { newDocumentUrl, collectionUrl } from "utils/routeHelpers"; @@ -45,7 +46,7 @@ type Props = { collections: CollectionsStore, policies: PoliciesStore, match: Match, - theme: Object, + theme: Theme, }; @observer diff --git a/app/scenes/Document/components/DataLoader.js b/app/scenes/Document/components/DataLoader.js index 4865db4f..46cdcdca 100644 --- a/app/scenes/Document/components/DataLoader.js +++ b/app/scenes/Document/components/DataLoader.js @@ -22,7 +22,7 @@ import DocumentComponent from "./Document"; import HideSidebar from "./HideSidebar"; import Loading from "./Loading"; import SocketPresence from "./SocketPresence"; -import { type LocationWithState } from "types"; +import { type LocationWithState, type Theme } from "types"; import { NotFoundError, OfflineError } from "utils/errors"; import isInternalUrl from "utils/isInternalUrl"; import { matchDocumentEdit, updateDocumentUrl } from "utils/routeHelpers"; @@ -35,7 +35,7 @@ type Props = {| policies: PoliciesStore, revisions: RevisionsStore, ui: UiStore, - theme: Object, + theme: Theme, history: RouterHistory, |}; diff --git a/app/scenes/Document/components/Document.js b/app/scenes/Document/components/Document.js index d7407240..abccfb43 100644 --- a/app/scenes/Document/components/Document.js +++ b/app/scenes/Document/components/Document.js @@ -30,7 +30,7 @@ import Header from "./Header"; import KeyboardShortcutsButton from "./KeyboardShortcutsButton"; import MarkAsViewed from "./MarkAsViewed"; import References from "./References"; -import { type LocationWithState } from "types"; +import { type LocationWithState, type Theme } from "types"; import { isCustomDomain } from "utils/domains"; import { emojiToUrl } from "utils/emoji"; import { @@ -62,7 +62,7 @@ type Props = { readOnly: boolean, onCreateLink: (title: string) => string, onSearchLink: (term: string) => any, - theme: Object, + theme: Theme, auth: AuthStore, ui: UiStore, }; diff --git a/app/scenes/Search/components/SearchField.js b/app/scenes/Search/components/SearchField.js index 5d8e897f..440627c3 100644 --- a/app/scenes/Search/components/SearchField.js +++ b/app/scenes/Search/components/SearchField.js @@ -3,11 +3,12 @@ import { SearchIcon } from "outline-icons"; import * as React from "react"; import styled, { withTheme } from "styled-components"; import Flex from "components/Flex"; +import { type Theme } from "types"; type Props = { onChange: (string) => void, defaultValue?: string, - theme: Object, + theme: Theme, }; class SearchField extends React.Component { diff --git a/app/types/index.js b/app/types/index.js index 8d8b0444..a30d9260 100644 --- a/app/types/index.js +++ b/app/types/index.js @@ -1,7 +1,10 @@ // @flow import { type Location } from "react-router-dom"; +import theme from "shared/styles/theme"; import Document from "models/Document"; +export type Theme = typeof theme; + export type LocationWithState = Location & { state: { [key: string]: string,