diff --git a/.env.sample b/.env.sample index fc5095471..d0698531a 100644 --- a/.env.sample +++ b/.env.sample @@ -8,3 +8,4 @@ SEQUELIZE_SECRET=F0E5AD933D7F6FD8F4DBB3E038C501C052DC0593C686D21ACB30AE205D2F634 SLACK_KEY=71315967491.XXXXXXXXXX SLACK_SECRET=d2dc414f9953226bad0a356c794XXXXX URL=http://localhost:3000 +DEPLOYMENT=hosted diff --git a/.flowconfig b/.flowconfig index ef6f9d9ea..7c57deb48 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,5 +1,5 @@ [include] -.*/frontend/.* +.*/app/.* .*/server/.* .*/shared/.* @@ -17,10 +17,12 @@ emoji=true module.system.node.resolve_dirname=node_modules -module.system.node.resolve_dirname=frontend +module.system.node.resolve_dirname=app module.name_mapper='^\(.*\)\.s?css$' -> 'empty/object' module.name_mapper='^\(.*\)\.md$' -> 'empty/object' +module.name_mapper='^shared\/\(.*\)$' -> '/shared/\1' + module.file_ext=.js module.file_ext=.scss module.file_ext=.md diff --git a/frontend/components/Alert/Alert.js b/app/components/Alert/Alert.js similarity index 88% rename from frontend/components/Alert/Alert.js rename to app/components/Alert/Alert.js index fbceee6a3..c1e11d533 100644 --- a/frontend/components/Alert/Alert.js +++ b/app/components/Alert/Alert.js @@ -1,9 +1,9 @@ // @flow import React from 'react'; import { observer } from 'mobx-react'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import styled from 'styled-components'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; type Props = { children: React.Element<*>, diff --git a/frontend/components/Alert/index.js b/app/components/Alert/index.js similarity index 100% rename from frontend/components/Alert/index.js rename to app/components/Alert/index.js diff --git a/frontend/components/Avatar/Avatar.js b/app/components/Avatar/Avatar.js similarity index 100% rename from frontend/components/Avatar/Avatar.js rename to app/components/Avatar/Avatar.js diff --git a/frontend/components/Avatar/index.js b/app/components/Avatar/index.js similarity index 100% rename from frontend/components/Avatar/index.js rename to app/components/Avatar/index.js diff --git a/frontend/components/Button/Button.js b/app/components/Button/Button.js similarity index 97% rename from frontend/components/Button/Button.js rename to app/components/Button/Button.js index 20ecb553c..411031e44 100644 --- a/frontend/components/Button/Button.js +++ b/app/components/Button/Button.js @@ -1,7 +1,7 @@ // @flow import React from 'react'; import styled from 'styled-components'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; import { darken, lighten } from 'polished'; const RealButton = styled.button` diff --git a/frontend/components/Button/index.js b/app/components/Button/index.js similarity index 100% rename from frontend/components/Button/index.js rename to app/components/Button/index.js diff --git a/frontend/components/CenteredContent/CenteredContent.js b/app/components/CenteredContent/CenteredContent.js similarity index 100% rename from frontend/components/CenteredContent/CenteredContent.js rename to app/components/CenteredContent/CenteredContent.js diff --git a/frontend/components/CenteredContent/index.js b/app/components/CenteredContent/index.js similarity index 100% rename from frontend/components/CenteredContent/index.js rename to app/components/CenteredContent/index.js diff --git a/frontend/components/Collaborators/Collaborators.js b/app/components/Collaborators/Collaborators.js similarity index 93% rename from frontend/components/Collaborators/Collaborators.js rename to app/components/Collaborators/Collaborators.js index 8bb7c7882..3ae8a24b9 100644 --- a/frontend/components/Collaborators/Collaborators.js +++ b/app/components/Collaborators/Collaborators.js @@ -2,8 +2,8 @@ import React from 'react'; import moment from 'moment'; import styled from 'styled-components'; -import { color } from 'styles/constants'; -import Flex from 'components/Flex'; +import { color } from 'shared/styles/constants'; +import Flex from 'shared/components/Flex'; import Tooltip from 'components/Tooltip'; import Document from 'models/Document'; diff --git a/frontend/components/Collaborators/index.js b/app/components/Collaborators/index.js similarity index 100% rename from frontend/components/Collaborators/index.js rename to app/components/Collaborators/index.js diff --git a/frontend/components/CopyToClipboard/CopyToClipboard.js b/app/components/CopyToClipboard/CopyToClipboard.js similarity index 100% rename from frontend/components/CopyToClipboard/CopyToClipboard.js rename to app/components/CopyToClipboard/CopyToClipboard.js diff --git a/frontend/components/CopyToClipboard/index.js b/app/components/CopyToClipboard/index.js similarity index 100% rename from frontend/components/CopyToClipboard/index.js rename to app/components/CopyToClipboard/index.js diff --git a/frontend/components/Divider/Divider.js b/app/components/Divider/Divider.js similarity index 87% rename from frontend/components/Divider/Divider.js rename to app/components/Divider/Divider.js index 440ef1d9b..7ce582a5b 100644 --- a/frontend/components/Divider/Divider.js +++ b/app/components/Divider/Divider.js @@ -1,7 +1,7 @@ // @flow import React from 'react'; import styled from 'styled-components'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; const Divider = () => { return ; diff --git a/frontend/components/Divider/index.js b/app/components/Divider/index.js similarity index 100% rename from frontend/components/Divider/index.js rename to app/components/Divider/index.js diff --git a/frontend/components/DocumentList/DocumentList.js b/app/components/DocumentList/DocumentList.js similarity index 100% rename from frontend/components/DocumentList/DocumentList.js rename to app/components/DocumentList/DocumentList.js diff --git a/frontend/components/DocumentList/index.js b/app/components/DocumentList/index.js similarity index 100% rename from frontend/components/DocumentList/index.js rename to app/components/DocumentList/index.js diff --git a/frontend/components/DocumentPreview/DocumentPreview.js b/app/components/DocumentPreview/DocumentPreview.js similarity index 97% rename from frontend/components/DocumentPreview/DocumentPreview.js rename to app/components/DocumentPreview/DocumentPreview.js index d9da9bd8e..40d29961f 100644 --- a/frontend/components/DocumentPreview/DocumentPreview.js +++ b/app/components/DocumentPreview/DocumentPreview.js @@ -4,7 +4,7 @@ import { observer } from 'mobx-react'; import { Link } from 'react-router-dom'; import Document from 'models/Document'; import styled from 'styled-components'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; import StarredIcon from 'components/Icon/StarredIcon'; import PublishingInfo from './components/PublishingInfo'; diff --git a/frontend/components/DocumentPreview/components/PublishingInfo.js b/app/components/DocumentPreview/components/PublishingInfo.js similarity index 94% rename from frontend/components/DocumentPreview/components/PublishingInfo.js rename to app/components/DocumentPreview/components/PublishingInfo.js index 878bfddac..dc296c440 100644 --- a/frontend/components/DocumentPreview/components/PublishingInfo.js +++ b/app/components/DocumentPreview/components/PublishingInfo.js @@ -2,10 +2,10 @@ import React, { Component } from 'react'; import moment from 'moment'; import styled from 'styled-components'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; import Collection from 'models/Collection'; import Document from 'models/Document'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; const Container = styled(Flex)` color: ${color.slate}; diff --git a/frontend/components/DocumentPreview/index.js b/app/components/DocumentPreview/index.js similarity index 100% rename from frontend/components/DocumentPreview/index.js rename to app/components/DocumentPreview/index.js diff --git a/frontend/components/DocumentViews/DocumentViewersStore.js b/app/components/DocumentViews/DocumentViewersStore.js similarity index 100% rename from frontend/components/DocumentViews/DocumentViewersStore.js rename to app/components/DocumentViews/DocumentViewersStore.js diff --git a/frontend/components/DocumentViews/DocumentViews.js b/app/components/DocumentViews/DocumentViews.js similarity index 97% rename from frontend/components/DocumentViews/DocumentViews.js rename to app/components/DocumentViews/DocumentViews.js index 0ff1b2d16..6a293f8bb 100644 --- a/frontend/components/DocumentViews/DocumentViews.js +++ b/app/components/DocumentViews/DocumentViews.js @@ -5,7 +5,7 @@ import Popover from 'components/Popover'; import styled from 'styled-components'; import DocumentViewers from './components/DocumentViewers'; import DocumentViewersStore from './DocumentViewersStore'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; const Container = styled(Flex)` font-size: 13px; diff --git a/frontend/components/DocumentViews/components/DocumentViewers/DocumentViewers.js b/app/components/DocumentViews/components/DocumentViewers/DocumentViewers.js similarity index 95% rename from frontend/components/DocumentViews/components/DocumentViewers/DocumentViewers.js rename to app/components/DocumentViews/components/DocumentViewers/DocumentViewers.js index e545a8d3c..566657d69 100644 --- a/frontend/components/DocumentViews/components/DocumentViewers/DocumentViewers.js +++ b/app/components/DocumentViews/components/DocumentViewers/DocumentViewers.js @@ -1,6 +1,6 @@ // @flow import React, { Component } from 'react'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import styled from 'styled-components'; import map from 'lodash/map'; import Avatar from 'components/Avatar'; diff --git a/frontend/components/DocumentViews/components/DocumentViewers/index.js b/app/components/DocumentViews/components/DocumentViewers/index.js similarity index 100% rename from frontend/components/DocumentViews/components/DocumentViewers/index.js rename to app/components/DocumentViews/components/DocumentViewers/index.js diff --git a/frontend/components/DocumentViews/index.js b/app/components/DocumentViews/index.js similarity index 100% rename from frontend/components/DocumentViews/index.js rename to app/components/DocumentViews/index.js diff --git a/frontend/components/DropToImport/DropToImport.js b/app/components/DropToImport/DropToImport.js similarity index 90% rename from frontend/components/DropToImport/DropToImport.js rename to app/components/DropToImport/DropToImport.js index 8c1341f70..34bb84cc1 100644 --- a/frontend/components/DropToImport/DropToImport.js +++ b/app/components/DropToImport/DropToImport.js @@ -1,6 +1,8 @@ // @flow import React, { Component } from 'react'; import { inject } from 'mobx-react'; +import { injectGlobal } from 'styled-components'; +import { color } from 'shared/styles/constants'; import invariant from 'invariant'; import _ from 'lodash'; import Dropzone from 'react-dropzone'; @@ -20,6 +22,17 @@ type Props = { history: Object, }; +injectGlobal` + .activeDropZone { + background: ${color.slateDark}; + svg { fill: ${color.white}; } + } + + .activeDropZone a { + color: ${color.white} !important; + } +`; + class DropToImport extends Component { state: { isImporting: boolean, diff --git a/frontend/components/DropToImport/index.js b/app/components/DropToImport/index.js similarity index 100% rename from frontend/components/DropToImport/index.js rename to app/components/DropToImport/index.js diff --git a/frontend/components/DropdownMenu/DropdownMenu.js b/app/components/DropdownMenu/DropdownMenu.js similarity index 94% rename from frontend/components/DropdownMenu/DropdownMenu.js rename to app/components/DropdownMenu/DropdownMenu.js index 2ce37c8c4..e53048333 100644 --- a/frontend/components/DropdownMenu/DropdownMenu.js +++ b/app/components/DropdownMenu/DropdownMenu.js @@ -5,9 +5,9 @@ import { observable } from 'mobx'; import { observer } from 'mobx-react'; import styled from 'styled-components'; import Portal from 'react-portal'; -import Flex from 'components/Flex'; -import { color } from 'styles/constants'; -import { fadeAndScaleIn } from 'styles/animations'; +import Flex from 'shared/components/Flex'; +import { color } from 'shared/styles/constants'; +import { fadeAndScaleIn } from 'shared/styles/animations'; type Props = { label: React.Element<*>, diff --git a/frontend/components/DropdownMenu/DropdownMenuItem.js b/app/components/DropdownMenu/DropdownMenuItem.js similarity index 88% rename from frontend/components/DropdownMenu/DropdownMenuItem.js rename to app/components/DropdownMenu/DropdownMenuItem.js index 7e6738f45..322b909ec 100644 --- a/frontend/components/DropdownMenu/DropdownMenuItem.js +++ b/app/components/DropdownMenu/DropdownMenuItem.js @@ -1,8 +1,8 @@ // @flow import React from 'react'; import styled from 'styled-components'; -import Flex from 'components/Flex'; -import { color } from 'styles/constants'; +import Flex from 'shared/components/Flex'; +import { color } from 'shared/styles/constants'; const DropdownMenuItem = ({ onClick, diff --git a/frontend/components/DropdownMenu/index.js b/app/components/DropdownMenu/index.js similarity index 100% rename from frontend/components/DropdownMenu/index.js rename to app/components/DropdownMenu/index.js diff --git a/frontend/components/Editor/Editor.js b/app/components/Editor/Editor.js similarity index 99% rename from frontend/components/Editor/Editor.js rename to app/components/Editor/Editor.js index 75ed07f1b..e556841d7 100644 --- a/frontend/components/Editor/Editor.js +++ b/app/components/Editor/Editor.js @@ -6,7 +6,7 @@ import { Editor, Plain } from 'slate'; import keydown from 'react-keydown'; import type { State, Editor as EditorType } from './types'; import getDataTransferFiles from 'utils/getDataTransferFiles'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import ClickablePadding from './components/ClickablePadding'; import Toolbar from './components/Toolbar'; import BlockInsert from './components/BlockInsert'; diff --git a/frontend/components/Editor/components/BlockInsert.js b/app/components/Editor/components/BlockInsert.js similarity index 99% rename from frontend/components/Editor/components/BlockInsert.js rename to app/components/Editor/components/BlockInsert.js index 441d8880a..8988881a8 100644 --- a/frontend/components/Editor/components/BlockInsert.js +++ b/app/components/Editor/components/BlockInsert.js @@ -6,7 +6,7 @@ import Portal from 'react-portal'; import { observable } from 'mobx'; import { observer } from 'mobx-react'; import styled from 'styled-components'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; import PlusIcon from 'components/Icon/PlusIcon'; import BlockMenu from 'menus/BlockMenu'; import type { State } from '../types'; diff --git a/frontend/components/Editor/components/ClickablePadding/ClickablePadding.js b/app/components/Editor/components/ClickablePadding/ClickablePadding.js similarity index 100% rename from frontend/components/Editor/components/ClickablePadding/ClickablePadding.js rename to app/components/Editor/components/ClickablePadding/ClickablePadding.js diff --git a/frontend/components/Editor/components/ClickablePadding/index.js b/app/components/Editor/components/ClickablePadding/index.js similarity index 100% rename from frontend/components/Editor/components/ClickablePadding/index.js rename to app/components/Editor/components/ClickablePadding/index.js diff --git a/frontend/components/Editor/components/Code.js b/app/components/Editor/components/Code.js similarity index 94% rename from frontend/components/Editor/components/Code.js rename to app/components/Editor/components/Code.js index f370392d0..883d57535 100644 --- a/frontend/components/Editor/components/Code.js +++ b/app/components/Editor/components/Code.js @@ -2,7 +2,7 @@ import React from 'react'; import styled from 'styled-components'; import CopyButton from './CopyButton'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; import type { Props } from '../types'; export default function Code({ children, node, readOnly, attributes }: Props) { diff --git a/frontend/components/Editor/components/Contents.js b/app/components/Editor/components/Contents.js similarity index 98% rename from frontend/components/Editor/components/Contents.js rename to app/components/Editor/components/Contents.js index 7a1f19a44..625aad93a 100644 --- a/frontend/components/Editor/components/Contents.js +++ b/app/components/Editor/components/Contents.js @@ -3,7 +3,7 @@ import React, { Component } from 'react'; import { observable } from 'mobx'; import { observer } from 'mobx-react'; import { List } from 'immutable'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; import headingToSlug from '../headingToSlug'; import type { State, Block } from '../types'; import styled from 'styled-components'; diff --git a/frontend/components/Editor/components/CopyButton.js b/app/components/Editor/components/CopyButton.js similarity index 95% rename from frontend/components/Editor/components/CopyButton.js rename to app/components/Editor/components/CopyButton.js index 696e6c610..7e1bb6b5b 100644 --- a/frontend/components/Editor/components/CopyButton.js +++ b/app/components/Editor/components/CopyButton.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { observable } from 'mobx'; import { observer } from 'mobx-react'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; import styled from 'styled-components'; import CopyToClipboard from 'components/CopyToClipboard'; diff --git a/frontend/components/Editor/components/Heading.js b/app/components/Editor/components/Heading.js similarity index 100% rename from frontend/components/Editor/components/Heading.js rename to app/components/Editor/components/Heading.js diff --git a/frontend/components/Editor/components/HorizontalRule.js b/app/components/Editor/components/HorizontalRule.js similarity index 90% rename from frontend/components/Editor/components/HorizontalRule.js rename to app/components/Editor/components/HorizontalRule.js index 286a5acb1..49cf4ca0f 100644 --- a/frontend/components/Editor/components/HorizontalRule.js +++ b/app/components/Editor/components/HorizontalRule.js @@ -2,7 +2,7 @@ import React from 'react'; import styled from 'styled-components'; import type { Props } from '../types'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; function HorizontalRule(props: Props) { const { state, node } = props; diff --git a/frontend/components/Editor/components/Image.js b/app/components/Editor/components/Image.js similarity index 97% rename from frontend/components/Editor/components/Image.js rename to app/components/Editor/components/Image.js index af1c5de44..ad1857b49 100644 --- a/frontend/components/Editor/components/Image.js +++ b/app/components/Editor/components/Image.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import styled from 'styled-components'; import type { Props } from '../types'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; class Image extends Component { props: Props; diff --git a/frontend/components/Editor/components/InlineCode.js b/app/components/Editor/components/InlineCode.js similarity index 81% rename from frontend/components/Editor/components/InlineCode.js rename to app/components/Editor/components/InlineCode.js index ad498a7b0..c59965c30 100644 --- a/frontend/components/Editor/components/InlineCode.js +++ b/app/components/Editor/components/InlineCode.js @@ -1,6 +1,6 @@ // @flow import styled from 'styled-components'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; const InlineCode = styled.code` padding: .25em; diff --git a/frontend/components/Editor/components/Link.js b/app/components/Editor/components/Link.js similarity index 100% rename from frontend/components/Editor/components/Link.js rename to app/components/Editor/components/Link.js diff --git a/frontend/components/Editor/components/ListItem.js b/app/components/Editor/components/ListItem.js similarity index 100% rename from frontend/components/Editor/components/ListItem.js rename to app/components/Editor/components/ListItem.js diff --git a/frontend/components/Editor/components/Paragraph.js b/app/components/Editor/components/Paragraph.js similarity index 100% rename from frontend/components/Editor/components/Paragraph.js rename to app/components/Editor/components/Paragraph.js diff --git a/frontend/components/Editor/components/Placeholder.js b/app/components/Editor/components/Placeholder.js similarity index 100% rename from frontend/components/Editor/components/Placeholder.js rename to app/components/Editor/components/Placeholder.js diff --git a/frontend/components/Editor/components/TodoItem.js b/app/components/Editor/components/TodoItem.js similarity index 95% rename from frontend/components/Editor/components/TodoItem.js rename to app/components/Editor/components/TodoItem.js index 2418ead44..7b18c7b88 100644 --- a/frontend/components/Editor/components/TodoItem.js +++ b/app/components/Editor/components/TodoItem.js @@ -1,7 +1,7 @@ // @flow import React, { Component } from 'react'; import styled from 'styled-components'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; import type { Props } from '../types'; export default class TodoItem extends Component { diff --git a/frontend/components/Editor/components/TodoList.js b/app/components/Editor/components/TodoList.js similarity index 100% rename from frontend/components/Editor/components/TodoList.js rename to app/components/Editor/components/TodoList.js diff --git a/frontend/components/Editor/components/Toolbar/Toolbar.js b/app/components/Editor/components/Toolbar/Toolbar.js similarity index 100% rename from frontend/components/Editor/components/Toolbar/Toolbar.js rename to app/components/Editor/components/Toolbar/Toolbar.js diff --git a/frontend/components/Editor/components/Toolbar/components/DocumentResult.js b/app/components/Editor/components/Toolbar/components/DocumentResult.js similarity index 92% rename from frontend/components/Editor/components/Toolbar/components/DocumentResult.js rename to app/components/Editor/components/Toolbar/components/DocumentResult.js index 7d4b157b0..9b15b72b3 100644 --- a/frontend/components/Editor/components/Toolbar/components/DocumentResult.js +++ b/app/components/Editor/components/Toolbar/components/DocumentResult.js @@ -1,7 +1,7 @@ // @flow import React from 'react'; import styled from 'styled-components'; -import { fontWeight, color } from 'styles/constants'; +import { fontWeight, color } from 'shared/styles/constants'; import Document from 'models/Document'; import NextIcon from 'components/Icon/NextIcon'; diff --git a/frontend/components/Editor/components/Toolbar/components/FormattingToolbar.js b/app/components/Editor/components/Toolbar/components/FormattingToolbar.js similarity index 100% rename from frontend/components/Editor/components/Toolbar/components/FormattingToolbar.js rename to app/components/Editor/components/Toolbar/components/FormattingToolbar.js diff --git a/frontend/components/Editor/components/Toolbar/components/LinkToolbar.js b/app/components/Editor/components/Toolbar/components/LinkToolbar.js similarity index 99% rename from frontend/components/Editor/components/Toolbar/components/LinkToolbar.js rename to app/components/Editor/components/Toolbar/components/LinkToolbar.js index c7b38bb24..f85d420bc 100644 --- a/frontend/components/Editor/components/Toolbar/components/LinkToolbar.js +++ b/app/components/Editor/components/Toolbar/components/LinkToolbar.js @@ -14,7 +14,7 @@ import keydown from 'react-keydown'; import CloseIcon from 'components/Icon/CloseIcon'; import OpenIcon from 'components/Icon/OpenIcon'; import TrashIcon from 'components/Icon/TrashIcon'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; @keydown @observer diff --git a/frontend/components/Editor/components/Toolbar/components/ToolbarButton.js b/app/components/Editor/components/Toolbar/components/ToolbarButton.js similarity index 100% rename from frontend/components/Editor/components/Toolbar/components/ToolbarButton.js rename to app/components/Editor/components/Toolbar/components/ToolbarButton.js diff --git a/frontend/components/Editor/components/Toolbar/index.js b/app/components/Editor/components/Toolbar/index.js similarity index 100% rename from frontend/components/Editor/components/Toolbar/index.js rename to app/components/Editor/components/Toolbar/index.js diff --git a/frontend/components/Editor/headingToSlug.js b/app/components/Editor/headingToSlug.js similarity index 100% rename from frontend/components/Editor/headingToSlug.js rename to app/components/Editor/headingToSlug.js diff --git a/frontend/components/Editor/index.js b/app/components/Editor/index.js similarity index 100% rename from frontend/components/Editor/index.js rename to app/components/Editor/index.js diff --git a/frontend/components/Editor/insertImage.js b/app/components/Editor/insertImage.js similarity index 100% rename from frontend/components/Editor/insertImage.js rename to app/components/Editor/insertImage.js diff --git a/frontend/components/Editor/plugins.js b/app/components/Editor/plugins.js similarity index 100% rename from frontend/components/Editor/plugins.js rename to app/components/Editor/plugins.js diff --git a/frontend/components/Editor/plugins/EditList.js b/app/components/Editor/plugins/EditList.js similarity index 100% rename from frontend/components/Editor/plugins/EditList.js rename to app/components/Editor/plugins/EditList.js diff --git a/frontend/components/Editor/plugins/KeyboardShortcuts.js b/app/components/Editor/plugins/KeyboardShortcuts.js similarity index 100% rename from frontend/components/Editor/plugins/KeyboardShortcuts.js rename to app/components/Editor/plugins/KeyboardShortcuts.js diff --git a/frontend/components/Editor/plugins/MarkdownShortcuts.js b/app/components/Editor/plugins/MarkdownShortcuts.js similarity index 100% rename from frontend/components/Editor/plugins/MarkdownShortcuts.js rename to app/components/Editor/plugins/MarkdownShortcuts.js diff --git a/frontend/components/Editor/schema.js b/app/components/Editor/schema.js similarity index 100% rename from frontend/components/Editor/schema.js rename to app/components/Editor/schema.js diff --git a/frontend/components/Editor/serializer.js b/app/components/Editor/serializer.js similarity index 100% rename from frontend/components/Editor/serializer.js rename to app/components/Editor/serializer.js diff --git a/frontend/components/Editor/types.js b/app/components/Editor/types.js similarity index 100% rename from frontend/components/Editor/types.js rename to app/components/Editor/types.js diff --git a/frontend/components/Empty/Empty.js b/app/components/Empty/Empty.js similarity index 88% rename from frontend/components/Empty/Empty.js rename to app/components/Empty/Empty.js index 822d990aa..2f44b7436 100644 --- a/frontend/components/Empty/Empty.js +++ b/app/components/Empty/Empty.js @@ -1,7 +1,7 @@ // @flow import React from 'react'; import styled from 'styled-components'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; type Props = { children: string, diff --git a/frontend/components/Empty/index.js b/app/components/Empty/index.js similarity index 100% rename from frontend/components/Empty/index.js rename to app/components/Empty/index.js diff --git a/frontend/components/HelpText/HelpText.js b/app/components/HelpText/HelpText.js similarity index 75% rename from frontend/components/HelpText/HelpText.js rename to app/components/HelpText/HelpText.js index a4ff8c9b3..4e728ed67 100644 --- a/frontend/components/HelpText/HelpText.js +++ b/app/components/HelpText/HelpText.js @@ -1,6 +1,6 @@ // @flow import styled from 'styled-components'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; const HelpText = styled.p` margin-top: 0; diff --git a/frontend/components/HelpText/index.js b/app/components/HelpText/index.js similarity index 100% rename from frontend/components/HelpText/index.js rename to app/components/HelpText/index.js diff --git a/frontend/components/Icon/BackIcon.js b/app/components/Icon/BackIcon.js similarity index 100% rename from frontend/components/Icon/BackIcon.js rename to app/components/Icon/BackIcon.js diff --git a/frontend/components/Icon/BoldIcon.js b/app/components/Icon/BoldIcon.js similarity index 100% rename from frontend/components/Icon/BoldIcon.js rename to app/components/Icon/BoldIcon.js diff --git a/frontend/components/Icon/BulletedListIcon.js b/app/components/Icon/BulletedListIcon.js similarity index 100% rename from frontend/components/Icon/BulletedListIcon.js rename to app/components/Icon/BulletedListIcon.js diff --git a/frontend/components/Icon/CheckboxIcon.js b/app/components/Icon/CheckboxIcon.js similarity index 100% rename from frontend/components/Icon/CheckboxIcon.js rename to app/components/Icon/CheckboxIcon.js diff --git a/frontend/components/Icon/CloseIcon.js b/app/components/Icon/CloseIcon.js similarity index 100% rename from frontend/components/Icon/CloseIcon.js rename to app/components/Icon/CloseIcon.js diff --git a/frontend/components/Icon/CodeIcon.js b/app/components/Icon/CodeIcon.js similarity index 100% rename from frontend/components/Icon/CodeIcon.js rename to app/components/Icon/CodeIcon.js diff --git a/frontend/components/Icon/CollapsedIcon.js b/app/components/Icon/CollapsedIcon.js similarity index 100% rename from frontend/components/Icon/CollapsedIcon.js rename to app/components/Icon/CollapsedIcon.js diff --git a/frontend/components/Icon/CollectionIcon.js b/app/components/Icon/CollectionIcon.js similarity index 100% rename from frontend/components/Icon/CollectionIcon.js rename to app/components/Icon/CollectionIcon.js diff --git a/frontend/components/Icon/DocumentIcon.js b/app/components/Icon/DocumentIcon.js similarity index 100% rename from frontend/components/Icon/DocumentIcon.js rename to app/components/Icon/DocumentIcon.js diff --git a/frontend/components/Icon/EditIcon.js b/app/components/Icon/EditIcon.js similarity index 100% rename from frontend/components/Icon/EditIcon.js rename to app/components/Icon/EditIcon.js diff --git a/frontend/components/Icon/GoToIcon.js b/app/components/Icon/GoToIcon.js similarity index 100% rename from frontend/components/Icon/GoToIcon.js rename to app/components/Icon/GoToIcon.js diff --git a/frontend/components/Icon/Heading1Icon.js b/app/components/Icon/Heading1Icon.js similarity index 100% rename from frontend/components/Icon/Heading1Icon.js rename to app/components/Icon/Heading1Icon.js diff --git a/frontend/components/Icon/Heading2Icon.js b/app/components/Icon/Heading2Icon.js similarity index 100% rename from frontend/components/Icon/Heading2Icon.js rename to app/components/Icon/Heading2Icon.js diff --git a/frontend/components/Icon/HomeIcon.js b/app/components/Icon/HomeIcon.js similarity index 100% rename from frontend/components/Icon/HomeIcon.js rename to app/components/Icon/HomeIcon.js diff --git a/frontend/components/Icon/HorizontalRuleIcon.js b/app/components/Icon/HorizontalRuleIcon.js similarity index 100% rename from frontend/components/Icon/HorizontalRuleIcon.js rename to app/components/Icon/HorizontalRuleIcon.js diff --git a/frontend/components/Icon/Icon.js b/app/components/Icon/Icon.js similarity index 94% rename from frontend/components/Icon/Icon.js rename to app/components/Icon/Icon.js index 46bf1acbc..609792738 100644 --- a/frontend/components/Icon/Icon.js +++ b/app/components/Icon/Icon.js @@ -1,6 +1,6 @@ // @flow import React from 'react'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; export type Props = { className?: string, diff --git a/frontend/components/Icon/ImageIcon.js b/app/components/Icon/ImageIcon.js similarity index 100% rename from frontend/components/Icon/ImageIcon.js rename to app/components/Icon/ImageIcon.js diff --git a/frontend/components/Icon/ItalicIcon.js b/app/components/Icon/ItalicIcon.js similarity index 100% rename from frontend/components/Icon/ItalicIcon.js rename to app/components/Icon/ItalicIcon.js diff --git a/frontend/components/Icon/LinkIcon.js b/app/components/Icon/LinkIcon.js similarity index 100% rename from frontend/components/Icon/LinkIcon.js rename to app/components/Icon/LinkIcon.js diff --git a/frontend/components/Icon/MoreIcon.js b/app/components/Icon/MoreIcon.js similarity index 100% rename from frontend/components/Icon/MoreIcon.js rename to app/components/Icon/MoreIcon.js diff --git a/frontend/components/Icon/NewDocumentIcon.js b/app/components/Icon/NewDocumentIcon.js similarity index 100% rename from frontend/components/Icon/NewDocumentIcon.js rename to app/components/Icon/NewDocumentIcon.js diff --git a/frontend/components/Icon/NextIcon.js b/app/components/Icon/NextIcon.js similarity index 100% rename from frontend/components/Icon/NextIcon.js rename to app/components/Icon/NextIcon.js diff --git a/frontend/components/Icon/OpenIcon.js b/app/components/Icon/OpenIcon.js similarity index 100% rename from frontend/components/Icon/OpenIcon.js rename to app/components/Icon/OpenIcon.js diff --git a/frontend/components/Icon/OrderedListIcon.js b/app/components/Icon/OrderedListIcon.js similarity index 100% rename from frontend/components/Icon/OrderedListIcon.js rename to app/components/Icon/OrderedListIcon.js diff --git a/frontend/components/Icon/PlusIcon.js b/app/components/Icon/PlusIcon.js similarity index 100% rename from frontend/components/Icon/PlusIcon.js rename to app/components/Icon/PlusIcon.js diff --git a/frontend/components/Icon/SearchIcon.js b/app/components/Icon/SearchIcon.js similarity index 100% rename from frontend/components/Icon/SearchIcon.js rename to app/components/Icon/SearchIcon.js diff --git a/frontend/components/Icon/StarredIcon.js b/app/components/Icon/StarredIcon.js similarity index 100% rename from frontend/components/Icon/StarredIcon.js rename to app/components/Icon/StarredIcon.js diff --git a/frontend/components/Icon/StrikethroughIcon.js b/app/components/Icon/StrikethroughIcon.js similarity index 100% rename from frontend/components/Icon/StrikethroughIcon.js rename to app/components/Icon/StrikethroughIcon.js diff --git a/frontend/components/Icon/TableIcon.js b/app/components/Icon/TableIcon.js similarity index 100% rename from frontend/components/Icon/TableIcon.js rename to app/components/Icon/TableIcon.js diff --git a/frontend/components/Icon/TodoListIcon.js b/app/components/Icon/TodoListIcon.js similarity index 100% rename from frontend/components/Icon/TodoListIcon.js rename to app/components/Icon/TodoListIcon.js diff --git a/frontend/components/Icon/TrashIcon.js b/app/components/Icon/TrashIcon.js similarity index 100% rename from frontend/components/Icon/TrashIcon.js rename to app/components/Icon/TrashIcon.js diff --git a/frontend/components/Icon/index.js b/app/components/Icon/index.js similarity index 100% rename from frontend/components/Icon/index.js rename to app/components/Icon/index.js diff --git a/frontend/components/Input/Input.js b/app/components/Input/Input.js similarity index 92% rename from frontend/components/Input/Input.js rename to app/components/Input/Input.js index 6b25d24f7..5fbe34106 100644 --- a/frontend/components/Input/Input.js +++ b/app/components/Input/Input.js @@ -1,8 +1,8 @@ // @flow import React from 'react'; import styled from 'styled-components'; -import Flex from 'components/Flex'; -import { size, color } from 'styles/constants'; +import Flex from 'shared/components/Flex'; +import { size, color } from 'shared/styles/constants'; const RealTextarea = styled.textarea` border: 0; diff --git a/frontend/components/Input/index.js b/app/components/Input/index.js similarity index 100% rename from frontend/components/Input/index.js rename to app/components/Input/index.js diff --git a/frontend/components/Key/index.js b/app/components/Key/index.js similarity index 100% rename from frontend/components/Key/index.js rename to app/components/Key/index.js diff --git a/frontend/components/Key/key.js b/app/components/Key/key.js similarity index 90% rename from frontend/components/Key/key.js rename to app/components/Key/key.js index 8f4954d8c..0e2f7a19a 100644 --- a/frontend/components/Key/key.js +++ b/app/components/Key/key.js @@ -1,6 +1,6 @@ // @flow import styled from 'styled-components'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; const Key = styled.kbd` display: inline-block; diff --git a/frontend/components/Labeled/Labeled.js b/app/components/Labeled/Labeled.js similarity index 86% rename from frontend/components/Labeled/Labeled.js rename to app/components/Labeled/Labeled.js index bfff39c91..ec9e2f8fe 100644 --- a/frontend/components/Labeled/Labeled.js +++ b/app/components/Labeled/Labeled.js @@ -1,9 +1,9 @@ // @flow import React from 'react'; import { observer } from 'mobx-react'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import styled from 'styled-components'; -import { size } from 'styles/constants'; +import { size } from 'shared/styles/constants'; type Props = { label: React.Element<*> | string, diff --git a/frontend/components/Labeled/index.js b/app/components/Labeled/index.js similarity index 100% rename from frontend/components/Labeled/index.js rename to app/components/Labeled/index.js diff --git a/frontend/components/Layout/Layout.js b/app/components/Layout/Layout.js similarity index 93% rename from frontend/components/Layout/Layout.js rename to app/components/Layout/Layout.js index 22dc66b93..2a5d34b31 100644 --- a/frontend/components/Layout/Layout.js +++ b/app/components/Layout/Layout.js @@ -1,12 +1,12 @@ // @flow import React from 'react'; import { withRouter } from 'react-router-dom'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet'; import styled from 'styled-components'; import { observer, inject } from 'mobx-react'; import keydown from 'react-keydown'; -import Flex from 'components/Flex'; -import { color, layout } from 'styles/constants'; +import Flex from 'shared/components/Flex'; +import { color, layout } from 'shared/styles/constants'; import { documentEditUrl, homeUrl, searchUrl } from 'utils/routeHelpers'; import Avatar from 'components/Avatar'; @@ -99,18 +99,15 @@ type Props = { return ( - + + Atlas + + {this.props.ui.progressBarVisible && } - {this.props.notifications} diff --git a/frontend/components/Layout/components/HeaderBlock.js b/app/components/Layout/components/HeaderBlock.js similarity index 90% rename from frontend/components/Layout/components/HeaderBlock.js rename to app/components/Layout/components/HeaderBlock.js index 553114946..9c80e6f0d 100644 --- a/frontend/components/Layout/components/HeaderBlock.js +++ b/app/components/Layout/components/HeaderBlock.js @@ -1,9 +1,9 @@ // @flow import React from 'react'; import styled from 'styled-components'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; import type { User, Team } from 'types'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; type Props = { user: User, @@ -28,7 +28,6 @@ const UserName = styled.div` `; const TeamName = styled.div` - font-family: 'Atlas Grotesk'; font-weight: bold; color: ${color.text}; text-decoration: none; diff --git a/frontend/components/Layout/components/Modals.js b/app/components/Layout/components/Modals.js similarity index 100% rename from frontend/components/Layout/components/Modals.js rename to app/components/Layout/components/Modals.js diff --git a/frontend/components/Layout/components/SidebarCollections.js b/app/components/Layout/components/SidebarCollections.js similarity index 98% rename from frontend/components/Layout/components/SidebarCollections.js rename to app/components/Layout/components/SidebarCollections.js index 7cb3e992a..45e9e304e 100644 --- a/frontend/components/Layout/components/SidebarCollections.js +++ b/app/components/Layout/components/SidebarCollections.js @@ -2,9 +2,9 @@ import React from 'react'; import { observable } from 'mobx'; import { observer, inject } from 'mobx-react'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import styled from 'styled-components'; -import { color, fontWeight } from 'styles/constants'; +import { color, fontWeight } from 'shared/styles/constants'; import SidebarLink from './SidebarLink'; import DropToImport from 'components/DropToImport'; diff --git a/frontend/components/Layout/components/SidebarLink.js b/app/components/Layout/components/SidebarLink.js similarity index 96% rename from frontend/components/Layout/components/SidebarLink.js rename to app/components/Layout/components/SidebarLink.js index 5a349fd47..02d8508e8 100644 --- a/frontend/components/Layout/components/SidebarLink.js +++ b/app/components/Layout/components/SidebarLink.js @@ -3,9 +3,9 @@ import React, { Component } from 'react'; import { observable, action } from 'mobx'; import { observer } from 'mobx-react'; import { NavLink } from 'react-router-dom'; -import { color, fontWeight } from 'styles/constants'; +import { color, fontWeight } from 'shared/styles/constants'; import styled from 'styled-components'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import CollapsedIcon from 'components/Icon/CollapsedIcon'; const activeStyle = { diff --git a/frontend/components/Layout/components/Title.js b/app/components/Layout/components/Title.js similarity index 100% rename from frontend/components/Layout/components/Title.js rename to app/components/Layout/components/Title.js diff --git a/frontend/components/Layout/index.js b/app/components/Layout/index.js similarity index 100% rename from frontend/components/Layout/index.js rename to app/components/Layout/index.js diff --git a/frontend/components/LoadingIndicator/LoadingIndicator.js b/app/components/LoadingIndicator/LoadingIndicator.js similarity index 100% rename from frontend/components/LoadingIndicator/LoadingIndicator.js rename to app/components/LoadingIndicator/LoadingIndicator.js diff --git a/frontend/components/LoadingIndicator/LoadingIndicatorBar.js b/app/components/LoadingIndicator/LoadingIndicatorBar.js similarity index 100% rename from frontend/components/LoadingIndicator/LoadingIndicatorBar.js rename to app/components/LoadingIndicator/LoadingIndicatorBar.js diff --git a/frontend/components/LoadingIndicator/index.js b/app/components/LoadingIndicator/index.js similarity index 100% rename from frontend/components/LoadingIndicator/index.js rename to app/components/LoadingIndicator/index.js diff --git a/frontend/components/LoadingListPlaceholder/LoadingListPlaceholder.js b/app/components/LoadingListPlaceholder/LoadingListPlaceholder.js similarity index 85% rename from frontend/components/LoadingListPlaceholder/LoadingListPlaceholder.js rename to app/components/LoadingListPlaceholder/LoadingListPlaceholder.js index 26bf3dbcd..0cb35f467 100644 --- a/frontend/components/LoadingListPlaceholder/LoadingListPlaceholder.js +++ b/app/components/LoadingListPlaceholder/LoadingListPlaceholder.js @@ -2,11 +2,11 @@ import React from 'react'; import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; import styled from 'styled-components'; -import { pulsate } from 'styles/animations'; -import { color } from 'styles/constants'; -import Flex from 'components/Flex'; +import { pulsate } from 'shared/styles/animations'; +import { color } from 'shared/styles/constants'; +import Flex from 'shared/components/Flex'; -import { randomInteger } from 'utils/random'; +import { randomInteger } from 'shared/random'; const randomValues = Array.from( new Array(5), diff --git a/frontend/components/LoadingListPlaceholder/index.js b/app/components/LoadingListPlaceholder/index.js similarity index 100% rename from frontend/components/LoadingListPlaceholder/index.js rename to app/components/LoadingListPlaceholder/index.js diff --git a/frontend/components/LoadingPlaceholder/ListPlaceholder.js b/app/components/LoadingPlaceholder/ListPlaceholder.js similarity index 94% rename from frontend/components/LoadingPlaceholder/ListPlaceholder.js rename to app/components/LoadingPlaceholder/ListPlaceholder.js index 7fba72172..1eef84884 100644 --- a/frontend/components/LoadingPlaceholder/ListPlaceholder.js +++ b/app/components/LoadingPlaceholder/ListPlaceholder.js @@ -4,7 +4,7 @@ import _ from 'lodash'; import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; import styled from 'styled-components'; import Mask from './components/Mask'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; type Props = { count?: number, diff --git a/frontend/components/LoadingPlaceholder/LoadingPlaceholder.js b/app/components/LoadingPlaceholder/LoadingPlaceholder.js similarity index 93% rename from frontend/components/LoadingPlaceholder/LoadingPlaceholder.js rename to app/components/LoadingPlaceholder/LoadingPlaceholder.js index 6f978e247..97d9f1a33 100644 --- a/frontend/components/LoadingPlaceholder/LoadingPlaceholder.js +++ b/app/components/LoadingPlaceholder/LoadingPlaceholder.js @@ -2,7 +2,7 @@ import React from 'react'; import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; import Mask from './components/Mask'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; export default (props: Object) => { return ( diff --git a/frontend/components/LoadingPlaceholder/components/Mask.js b/app/components/LoadingPlaceholder/components/Mask.js similarity index 75% rename from frontend/components/LoadingPlaceholder/components/Mask.js rename to app/components/LoadingPlaceholder/components/Mask.js index a49810e14..61ccd1419 100644 --- a/frontend/components/LoadingPlaceholder/components/Mask.js +++ b/app/components/LoadingPlaceholder/components/Mask.js @@ -1,10 +1,10 @@ // @flow import React, { Component } from 'react'; import styled from 'styled-components'; -import { pulsate } from 'styles/animations'; -import { color } from 'styles/constants'; -import { randomInteger } from 'utils/random'; -import Flex from 'components/Flex'; +import { pulsate } from 'shared/styles/animations'; +import { color } from 'shared/styles/constants'; +import { randomInteger } from 'shared/random'; +import Flex from 'shared/components/Flex'; class Mask extends Component { width: number; @@ -13,8 +13,7 @@ class Mask extends Component { return false; } - constructor(props: Object) { - super(props); + componentWillmount() { this.width = randomInteger(75, 100); } diff --git a/frontend/components/LoadingPlaceholder/index.js b/app/components/LoadingPlaceholder/index.js similarity index 100% rename from frontend/components/LoadingPlaceholder/index.js rename to app/components/LoadingPlaceholder/index.js diff --git a/frontend/components/Modal/Modal.js b/app/components/Modal/Modal.js similarity index 82% rename from frontend/components/Modal/Modal.js rename to app/components/Modal/Modal.js index de4f8841b..105f62291 100644 --- a/frontend/components/Modal/Modal.js +++ b/app/components/Modal/Modal.js @@ -1,12 +1,12 @@ // @flow import React from 'react'; import { observer } from 'mobx-react'; -import styled from 'styled-components'; +import styled, { injectGlobal } from 'styled-components'; import ReactModal from 'react-modal'; -import { color } from 'styles/constants'; -import { fadeAndScaleIn } from 'styles/animations'; +import { color } from 'shared/styles/constants'; +import { fadeAndScaleIn } from 'shared/styles/animations'; import CloseIcon from 'components/Icon/CloseIcon'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; type Props = { children?: React$Element, @@ -15,6 +15,12 @@ type Props = { onRequestClose: () => void, }; +injectGlobal` + .ReactModal__Body--open { + overflow: hidden; + } +`; + const Modal = ({ children, isOpen, diff --git a/frontend/components/Modal/index.js b/app/components/Modal/index.js similarity index 100% rename from frontend/components/Modal/index.js rename to app/components/Modal/index.js diff --git a/app/components/PageTitle/PageTitle.js b/app/components/PageTitle/PageTitle.js new file mode 100644 index 000000000..deb763670 --- /dev/null +++ b/app/components/PageTitle/PageTitle.js @@ -0,0 +1,13 @@ +// @flow +import React from 'react'; +import { Helmet } from 'react-helmet'; + +type Props = { + title: string, +}; + +const PageTitle = ({ title }: Props) => ( + {`${title} - Atlas`} +); + +export default PageTitle; diff --git a/frontend/components/PageTitle/index.js b/app/components/PageTitle/index.js similarity index 100% rename from frontend/components/PageTitle/index.js rename to app/components/PageTitle/index.js diff --git a/frontend/components/Popover/Popover.js b/app/components/Popover/Popover.js similarity index 100% rename from frontend/components/Popover/Popover.js rename to app/components/Popover/Popover.js diff --git a/frontend/components/Popover/index.js b/app/components/Popover/index.js similarity index 100% rename from frontend/components/Popover/index.js rename to app/components/Popover/index.js diff --git a/frontend/components/RouteSidebarHidden/RouteSidebarHidden.js b/app/components/RouteSidebarHidden/RouteSidebarHidden.js similarity index 100% rename from frontend/components/RouteSidebarHidden/RouteSidebarHidden.js rename to app/components/RouteSidebarHidden/RouteSidebarHidden.js diff --git a/frontend/components/RouteSidebarHidden/index.js b/app/components/RouteSidebarHidden/index.js similarity index 100% rename from frontend/components/RouteSidebarHidden/index.js rename to app/components/RouteSidebarHidden/index.js diff --git a/frontend/components/ScrollToTop/ScrollToTop.js b/app/components/ScrollToTop/ScrollToTop.js similarity index 100% rename from frontend/components/ScrollToTop/ScrollToTop.js rename to app/components/ScrollToTop/ScrollToTop.js diff --git a/frontend/components/ScrollToTop/index.js b/app/components/ScrollToTop/index.js similarity index 100% rename from frontend/components/ScrollToTop/index.js rename to app/components/ScrollToTop/index.js diff --git a/frontend/components/Scrollable/Scrollable.js b/app/components/Scrollable/Scrollable.js similarity index 100% rename from frontend/components/Scrollable/Scrollable.js rename to app/components/Scrollable/Scrollable.js diff --git a/frontend/components/Scrollable/index.js b/app/components/Scrollable/index.js similarity index 100% rename from frontend/components/Scrollable/index.js rename to app/components/Scrollable/index.js diff --git a/frontend/components/SlackAuthLink/SlackAuthLink.js b/app/components/SlackAuthLink/SlackAuthLink.js similarity index 86% rename from frontend/components/SlackAuthLink/SlackAuthLink.js rename to app/components/SlackAuthLink/SlackAuthLink.js index d8225c679..3bf9e164f 100644 --- a/frontend/components/SlackAuthLink/SlackAuthLink.js +++ b/app/components/SlackAuthLink/SlackAuthLink.js @@ -4,8 +4,8 @@ import { observer, inject } from 'mobx-react'; import AuthStore from 'stores/AuthStore'; type Props = { - children: React.Element, - scopes?: Array, + children: React$Element<*>, + scopes?: string[], auth: AuthStore, redirectUri: string, }; @@ -32,9 +32,7 @@ type Props = { }; const urlParams = Object.keys(params) - .map(key => { - return `${key}=${encodeURIComponent(params[key])}`; - }) + .map(key => `${key}=${encodeURIComponent(params[key])}`) .join('&'); return `${baseUrl}?${urlParams}`; diff --git a/frontend/components/SlackAuthLink/assets/slack_icon.svg b/app/components/SlackAuthLink/assets/slack_icon.svg similarity index 100% rename from frontend/components/SlackAuthLink/assets/slack_icon.svg rename to app/components/SlackAuthLink/assets/slack_icon.svg diff --git a/frontend/components/SlackAuthLink/index.js b/app/components/SlackAuthLink/index.js similarity index 100% rename from frontend/components/SlackAuthLink/index.js rename to app/components/SlackAuthLink/index.js diff --git a/frontend/components/Toasts/Toasts.js b/app/components/Toasts/Toasts.js similarity index 94% rename from frontend/components/Toasts/Toasts.js rename to app/components/Toasts/Toasts.js index fd1457c6f..565fd6da4 100644 --- a/frontend/components/Toasts/Toasts.js +++ b/app/components/Toasts/Toasts.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { inject, observer } from 'mobx-react'; import styled from 'styled-components'; -import { layout } from 'styles/constants'; +import { layout } from 'shared/styles/constants'; import Toast from './components/Toast'; @observer class Toasts extends Component { diff --git a/frontend/components/Toasts/components/Toast.js b/app/components/Toasts/components/Toast.js similarity index 91% rename from frontend/components/Toasts/components/Toast.js rename to app/components/Toasts/components/Toast.js index da25a022b..4fc42580f 100644 --- a/frontend/components/Toasts/components/Toast.js +++ b/app/components/Toasts/components/Toast.js @@ -2,8 +2,8 @@ import React, { Component } from 'react'; import styled from 'styled-components'; import { darken } from 'polished'; -import { color } from 'styles/constants'; -import { fadeAndScaleIn } from 'styles/animations'; +import { color } from 'shared/styles/constants'; +import { fadeAndScaleIn } from 'shared/styles/animations'; type Props = { onRequestClose: () => void, diff --git a/frontend/components/Toasts/index.js b/app/components/Toasts/index.js similarity index 100% rename from frontend/components/Toasts/index.js rename to app/components/Toasts/index.js diff --git a/frontend/components/Tooltip/index.js b/app/components/Tooltip/index.js similarity index 100% rename from frontend/components/Tooltip/index.js rename to app/components/Tooltip/index.js diff --git a/frontend/fonts/atlas/AtlasGrotesk-Black-Web.woff b/app/fonts/atlas/AtlasGrotesk-Black-Web.woff similarity index 100% rename from frontend/fonts/atlas/AtlasGrotesk-Black-Web.woff rename to app/fonts/atlas/AtlasGrotesk-Black-Web.woff diff --git a/frontend/fonts/atlas/AtlasGrotesk-BlackItalic-Web.woff b/app/fonts/atlas/AtlasGrotesk-BlackItalic-Web.woff similarity index 100% rename from frontend/fonts/atlas/AtlasGrotesk-BlackItalic-Web.woff rename to app/fonts/atlas/AtlasGrotesk-BlackItalic-Web.woff diff --git a/frontend/fonts/atlas/AtlasGrotesk-Bold-Web.woff b/app/fonts/atlas/AtlasGrotesk-Bold-Web.woff similarity index 100% rename from frontend/fonts/atlas/AtlasGrotesk-Bold-Web.woff rename to app/fonts/atlas/AtlasGrotesk-Bold-Web.woff diff --git a/frontend/fonts/atlas/AtlasGrotesk-BoldItalic-Web.woff b/app/fonts/atlas/AtlasGrotesk-BoldItalic-Web.woff similarity index 100% rename from frontend/fonts/atlas/AtlasGrotesk-BoldItalic-Web.woff rename to app/fonts/atlas/AtlasGrotesk-BoldItalic-Web.woff diff --git a/frontend/fonts/atlas/AtlasGrotesk-Light-Web.woff b/app/fonts/atlas/AtlasGrotesk-Light-Web.woff similarity index 100% rename from frontend/fonts/atlas/AtlasGrotesk-Light-Web.woff rename to app/fonts/atlas/AtlasGrotesk-Light-Web.woff diff --git a/frontend/fonts/atlas/AtlasGrotesk-LightItalic-Web.woff b/app/fonts/atlas/AtlasGrotesk-LightItalic-Web.woff similarity index 100% rename from frontend/fonts/atlas/AtlasGrotesk-LightItalic-Web.woff rename to app/fonts/atlas/AtlasGrotesk-LightItalic-Web.woff diff --git a/frontend/fonts/atlas/AtlasGrotesk-Medium-Web.woff b/app/fonts/atlas/AtlasGrotesk-Medium-Web.woff similarity index 100% rename from frontend/fonts/atlas/AtlasGrotesk-Medium-Web.woff rename to app/fonts/atlas/AtlasGrotesk-Medium-Web.woff diff --git a/frontend/fonts/atlas/AtlasGrotesk-MediumItalic-Web.woff b/app/fonts/atlas/AtlasGrotesk-MediumItalic-Web.woff similarity index 100% rename from frontend/fonts/atlas/AtlasGrotesk-MediumItalic-Web.woff rename to app/fonts/atlas/AtlasGrotesk-MediumItalic-Web.woff diff --git a/frontend/fonts/atlas/AtlasGrotesk-Regular-Web.woff b/app/fonts/atlas/AtlasGrotesk-Regular-Web.woff similarity index 100% rename from frontend/fonts/atlas/AtlasGrotesk-Regular-Web.woff rename to app/fonts/atlas/AtlasGrotesk-Regular-Web.woff diff --git a/frontend/fonts/atlas/AtlasGrotesk-RegularItalic-Web.woff b/app/fonts/atlas/AtlasGrotesk-RegularItalic-Web.woff similarity index 100% rename from frontend/fonts/atlas/AtlasGrotesk-RegularItalic-Web.woff rename to app/fonts/atlas/AtlasGrotesk-RegularItalic-Web.woff diff --git a/frontend/fonts/atlas/AtlasGrotesk-Thin-Web.woff b/app/fonts/atlas/AtlasGrotesk-Thin-Web.woff similarity index 100% rename from frontend/fonts/atlas/AtlasGrotesk-Thin-Web.woff rename to app/fonts/atlas/AtlasGrotesk-Thin-Web.woff diff --git a/frontend/fonts/atlas/AtlasGrotesk-ThinItalic-Web.woff b/app/fonts/atlas/AtlasGrotesk-ThinItalic-Web.woff similarity index 100% rename from frontend/fonts/atlas/AtlasGrotesk-ThinItalic-Web.woff rename to app/fonts/atlas/AtlasGrotesk-ThinItalic-Web.woff diff --git a/frontend/fonts/atlas/AtlasTypewriterMedium.woff b/app/fonts/atlas/AtlasTypewriterMedium.woff similarity index 100% rename from frontend/fonts/atlas/AtlasTypewriterMedium.woff rename to app/fonts/atlas/AtlasTypewriterMedium.woff diff --git a/frontend/fonts/atlas/AtlasTypewriterRegular.woff b/app/fonts/atlas/AtlasTypewriterRegular.woff similarity index 100% rename from frontend/fonts/atlas/AtlasTypewriterRegular.woff rename to app/fonts/atlas/AtlasTypewriterRegular.woff diff --git a/frontend/index.js b/app/index.js similarity index 97% rename from frontend/index.js rename to app/index.js index 3c5d593ae..5054d3fc2 100644 --- a/frontend/index.js +++ b/app/index.js @@ -8,16 +8,14 @@ import { Route, Redirect, } from 'react-router-dom'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import stores from 'stores'; import DocumentsStore from 'stores/DocumentsStore'; import CollectionsStore from 'stores/CollectionsStore'; import CacheStore from 'stores/CacheStore'; +import globalStyles from 'shared/styles/globals'; -import 'normalize.css/normalize.css'; -import 'styles/base.css'; -import 'styles/fonts.css'; import 'styles/transitions.css'; import 'styles/prism.css'; @@ -103,6 +101,8 @@ const RedirectDocument = ({ match }: { match: Object }) => ( ); +globalStyles(); + render(
diff --git a/frontend/menus/AccountMenu.js b/app/menus/AccountMenu.js similarity index 97% rename from frontend/menus/AccountMenu.js rename to app/menus/AccountMenu.js index 77ca6cb2d..4a701da9b 100644 --- a/frontend/menus/AccountMenu.js +++ b/app/menus/AccountMenu.js @@ -24,7 +24,7 @@ import { DropdownMenu, DropdownMenuItem } from 'components/DropdownMenu'; handleLogout = () => { this.props.auth.logout(); - this.props.history.push('/'); + window.location.href = BASE_URL; }; render() { diff --git a/frontend/menus/BlockMenu.js b/app/menus/BlockMenu.js similarity index 100% rename from frontend/menus/BlockMenu.js rename to app/menus/BlockMenu.js diff --git a/frontend/menus/CollectionMenu.js b/app/menus/CollectionMenu.js similarity index 97% rename from frontend/menus/CollectionMenu.js rename to app/menus/CollectionMenu.js index 76c778be0..bc393a6ad 100644 --- a/frontend/menus/CollectionMenu.js +++ b/app/menus/CollectionMenu.js @@ -5,7 +5,7 @@ import { inject, observer } from 'mobx-react'; import Collection from 'models/Collection'; import UiStore from 'stores/UiStore'; import MoreIcon from 'components/Icon/MoreIcon'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import { DropdownMenu, DropdownMenuItem } from 'components/DropdownMenu'; @observer class CollectionMenu extends Component { diff --git a/frontend/menus/DocumentMenu.js b/app/menus/DocumentMenu.js similarity index 100% rename from frontend/menus/DocumentMenu.js rename to app/menus/DocumentMenu.js diff --git a/frontend/models/BaseModel.js b/app/models/BaseModel.js similarity index 100% rename from frontend/models/BaseModel.js rename to app/models/BaseModel.js diff --git a/frontend/models/Collection.js b/app/models/Collection.js similarity index 100% rename from frontend/models/Collection.js rename to app/models/Collection.js diff --git a/frontend/models/Collection.test.js b/app/models/Collection.test.js similarity index 100% rename from frontend/models/Collection.test.js rename to app/models/Collection.test.js diff --git a/frontend/models/Document.js b/app/models/Document.js similarity index 100% rename from frontend/models/Document.js rename to app/models/Document.js diff --git a/frontend/models/Document.test.js b/app/models/Document.test.js similarity index 100% rename from frontend/models/Document.test.js rename to app/models/Document.test.js diff --git a/frontend/scenes/Collection/Collection.js b/app/scenes/Collection/Collection.js similarity index 98% rename from frontend/scenes/Collection/Collection.js rename to app/scenes/Collection/Collection.js index f5984c78d..22c84ea12 100644 --- a/frontend/scenes/Collection/Collection.js +++ b/app/scenes/Collection/Collection.js @@ -14,7 +14,7 @@ import Collection from 'models/Collection'; import CenteredContent from 'components/CenteredContent'; import LoadingListPlaceholder from 'components/LoadingListPlaceholder'; import Button from 'components/Button'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import HelpText from 'components/HelpText'; type Props = { diff --git a/frontend/scenes/Collection/index.js b/app/scenes/Collection/index.js similarity index 100% rename from frontend/scenes/Collection/index.js rename to app/scenes/Collection/index.js diff --git a/frontend/scenes/CollectionDelete/CollectionDelete.js b/app/scenes/CollectionDelete/CollectionDelete.js similarity index 97% rename from frontend/scenes/CollectionDelete/CollectionDelete.js rename to app/scenes/CollectionDelete/CollectionDelete.js index 31573e900..a79359751 100644 --- a/frontend/scenes/CollectionDelete/CollectionDelete.js +++ b/app/scenes/CollectionDelete/CollectionDelete.js @@ -5,7 +5,7 @@ import { observable } from 'mobx'; import { inject, observer } from 'mobx-react'; import { homeUrl } from 'utils/routeHelpers'; import Button from 'components/Button'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import HelpText from 'components/HelpText'; import Collection from 'models/Collection'; import CollectionsStore from 'stores/CollectionsStore'; diff --git a/frontend/scenes/CollectionDelete/index.js b/app/scenes/CollectionDelete/index.js similarity index 100% rename from frontend/scenes/CollectionDelete/index.js rename to app/scenes/CollectionDelete/index.js diff --git a/frontend/scenes/CollectionEdit/CollectionEdit.js b/app/scenes/CollectionEdit/CollectionEdit.js similarity index 97% rename from frontend/scenes/CollectionEdit/CollectionEdit.js rename to app/scenes/CollectionEdit/CollectionEdit.js index 8cb2401e3..17fc570b8 100644 --- a/frontend/scenes/CollectionEdit/CollectionEdit.js +++ b/app/scenes/CollectionEdit/CollectionEdit.js @@ -5,7 +5,7 @@ import { observable } from 'mobx'; import { inject, observer } from 'mobx-react'; import Button from 'components/Button'; import Input from 'components/Input'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import HelpText from 'components/HelpText'; import Collection from 'models/Collection'; diff --git a/frontend/scenes/CollectionEdit/index.js b/app/scenes/CollectionEdit/index.js similarity index 100% rename from frontend/scenes/CollectionEdit/index.js rename to app/scenes/CollectionEdit/index.js diff --git a/frontend/scenes/CollectionNew/CollectionNew.js b/app/scenes/CollectionNew/CollectionNew.js similarity index 100% rename from frontend/scenes/CollectionNew/CollectionNew.js rename to app/scenes/CollectionNew/CollectionNew.js diff --git a/frontend/scenes/CollectionNew/index.js b/app/scenes/CollectionNew/index.js similarity index 100% rename from frontend/scenes/CollectionNew/index.js rename to app/scenes/CollectionNew/index.js diff --git a/frontend/scenes/Dashboard/Dashboard.js b/app/scenes/Dashboard/Dashboard.js similarity index 98% rename from frontend/scenes/Dashboard/Dashboard.js rename to app/scenes/Dashboard/Dashboard.js index dbbc805c6..95278492d 100644 --- a/frontend/scenes/Dashboard/Dashboard.js +++ b/app/scenes/Dashboard/Dashboard.js @@ -5,7 +5,7 @@ import { observer, inject } from 'mobx-react'; import styled from 'styled-components'; import DocumentsStore from 'stores/DocumentsStore'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import DocumentList from 'components/DocumentList'; import PageTitle from 'components/PageTitle'; import CenteredContent from 'components/CenteredContent'; diff --git a/frontend/scenes/Dashboard/index.js b/app/scenes/Dashboard/index.js similarity index 100% rename from frontend/scenes/Dashboard/index.js rename to app/scenes/Dashboard/index.js diff --git a/frontend/scenes/Document/Document.js b/app/scenes/Document/Document.js similarity index 98% rename from frontend/scenes/Document/Document.js rename to app/scenes/Document/Document.js index ed517e30d..e0a8aa721 100644 --- a/frontend/scenes/Document/Document.js +++ b/app/scenes/Document/Document.js @@ -6,8 +6,8 @@ import { observable } from 'mobx'; import { observer, inject } from 'mobx-react'; import { withRouter, Prompt } from 'react-router'; import keydown from 'react-keydown'; -import Flex from 'components/Flex'; -import { color, layout } from 'styles/constants'; +import Flex from 'shared/components/Flex'; +import { color, layout } from 'shared/styles/constants'; import { collectionUrl, updateDocumentUrl, diff --git a/frontend/scenes/Document/components/DocumentMove/DocumentMove.js b/app/scenes/Document/components/DocumentMove/DocumentMove.js similarity index 98% rename from frontend/scenes/Document/components/DocumentMove/DocumentMove.js rename to app/scenes/Document/components/DocumentMove/DocumentMove.js index 53eeed8ec..23adcad30 100644 --- a/frontend/scenes/Document/components/DocumentMove/DocumentMove.js +++ b/app/scenes/Document/components/DocumentMove/DocumentMove.js @@ -8,12 +8,12 @@ import { Search } from 'js-search'; import ArrowKeyNavigation from 'boundless-arrow-key-navigation'; import _ from 'lodash'; import styled from 'styled-components'; -import { size } from 'styles/constants'; +import { size } from 'shared/styles/constants'; import Modal from 'components/Modal'; import Input from 'components/Input'; import Labeled from 'components/Labeled'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import PathToDocument from './components/PathToDocument'; import Document from 'models/Document'; diff --git a/frontend/scenes/Document/components/DocumentMove/components/PathToDocument.js b/app/scenes/Document/components/DocumentMove/components/PathToDocument.js similarity index 95% rename from frontend/scenes/Document/components/DocumentMove/components/PathToDocument.js rename to app/scenes/Document/components/DocumentMove/components/PathToDocument.js index 82058efd4..bda84a9c1 100644 --- a/frontend/scenes/Document/components/DocumentMove/components/PathToDocument.js +++ b/app/scenes/Document/components/DocumentMove/components/PathToDocument.js @@ -4,9 +4,9 @@ import { observer } from 'mobx-react'; import invariant from 'invariant'; import _ from 'lodash'; import styled from 'styled-components'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import GoToIcon from 'components/Icon/GoToIcon'; import Document from 'models/Document'; diff --git a/frontend/scenes/Document/components/DocumentMove/index.js b/app/scenes/Document/components/DocumentMove/index.js similarity index 100% rename from frontend/scenes/Document/components/DocumentMove/index.js rename to app/scenes/Document/components/DocumentMove/index.js diff --git a/frontend/scenes/Document/components/LoadingPlaceholder/LoadingPlaceholder.js b/app/scenes/Document/components/LoadingPlaceholder/LoadingPlaceholder.js similarity index 84% rename from frontend/scenes/Document/components/LoadingPlaceholder/LoadingPlaceholder.js rename to app/scenes/Document/components/LoadingPlaceholder/LoadingPlaceholder.js index 1052f403f..5930c7eaf 100644 --- a/frontend/scenes/Document/components/LoadingPlaceholder/LoadingPlaceholder.js +++ b/app/scenes/Document/components/LoadingPlaceholder/LoadingPlaceholder.js @@ -2,11 +2,11 @@ import React from 'react'; import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; import styled from 'styled-components'; -import { pulsate } from 'styles/animations'; -import { color } from 'styles/constants'; -import Flex from 'components/Flex'; +import { pulsate } from 'shared/styles/animations'; +import { color } from 'shared/styles/constants'; +import Flex from 'shared/components/Flex'; -import { randomInteger } from 'utils/random'; +import { randomInteger } from 'shared/random'; const randomValues = Array.from( new Array(5), diff --git a/frontend/scenes/Document/components/LoadingPlaceholder/index.js b/app/scenes/Document/components/LoadingPlaceholder/index.js similarity index 100% rename from frontend/scenes/Document/components/LoadingPlaceholder/index.js rename to app/scenes/Document/components/LoadingPlaceholder/index.js diff --git a/frontend/scenes/Document/components/SaveAction/SaveAction.js b/app/scenes/Document/components/SaveAction/SaveAction.js similarity index 100% rename from frontend/scenes/Document/components/SaveAction/SaveAction.js rename to app/scenes/Document/components/SaveAction/SaveAction.js diff --git a/frontend/scenes/Document/components/SaveAction/index.js b/app/scenes/Document/components/SaveAction/index.js similarity index 100% rename from frontend/scenes/Document/components/SaveAction/index.js rename to app/scenes/Document/components/SaveAction/index.js diff --git a/frontend/scenes/Document/index.js b/app/scenes/Document/index.js similarity index 100% rename from frontend/scenes/Document/index.js rename to app/scenes/Document/index.js diff --git a/frontend/scenes/DocumentDelete/DocumentDelete.js b/app/scenes/DocumentDelete/DocumentDelete.js similarity index 97% rename from frontend/scenes/DocumentDelete/DocumentDelete.js rename to app/scenes/DocumentDelete/DocumentDelete.js index 2e3896903..e6d92383b 100644 --- a/frontend/scenes/DocumentDelete/DocumentDelete.js +++ b/app/scenes/DocumentDelete/DocumentDelete.js @@ -4,7 +4,7 @@ import { withRouter } from 'react-router-dom'; import { observable } from 'mobx'; import { inject, observer } from 'mobx-react'; import Button from 'components/Button'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import HelpText from 'components/HelpText'; import Document from 'models/Document'; import DocumentsStore from 'stores/DocumentsStore'; diff --git a/frontend/scenes/DocumentDelete/index.js b/app/scenes/DocumentDelete/index.js similarity index 100% rename from frontend/scenes/DocumentDelete/index.js rename to app/scenes/DocumentDelete/index.js diff --git a/frontend/scenes/Error404/Error404.js b/app/scenes/Error404/Error404.js similarity index 100% rename from frontend/scenes/Error404/Error404.js rename to app/scenes/Error404/Error404.js diff --git a/frontend/scenes/Error404/index.js b/app/scenes/Error404/index.js similarity index 100% rename from frontend/scenes/Error404/index.js rename to app/scenes/Error404/index.js diff --git a/frontend/scenes/ErrorAuth/ErrorAuth.js b/app/scenes/ErrorAuth/ErrorAuth.js similarity index 100% rename from frontend/scenes/ErrorAuth/ErrorAuth.js rename to app/scenes/ErrorAuth/ErrorAuth.js diff --git a/frontend/scenes/ErrorAuth/index.js b/app/scenes/ErrorAuth/index.js similarity index 100% rename from frontend/scenes/ErrorAuth/index.js rename to app/scenes/ErrorAuth/index.js diff --git a/frontend/scenes/Flatpage/Flatpage.js b/app/scenes/Flatpage/Flatpage.js similarity index 100% rename from frontend/scenes/Flatpage/Flatpage.js rename to app/scenes/Flatpage/Flatpage.js diff --git a/frontend/scenes/Flatpage/index.js b/app/scenes/Flatpage/index.js similarity index 100% rename from frontend/scenes/Flatpage/index.js rename to app/scenes/Flatpage/index.js diff --git a/app/scenes/Home/Home.js b/app/scenes/Home/Home.js new file mode 100644 index 000000000..37ef49dc0 --- /dev/null +++ b/app/scenes/Home/Home.js @@ -0,0 +1,17 @@ +// @flow +import React from 'react'; +import { observer, inject } from 'mobx-react'; +import { Redirect } from 'react-router'; +import AuthStore from 'stores/AuthStore'; + +type Props = { + auth: AuthStore, +}; + +const Home = observer((props: Props) => { + if (props.auth.authenticated) return ; + window.location.href = BASE_URL; + return null; +}); + +export default inject('auth')(Home); diff --git a/frontend/scenes/Home/index.js b/app/scenes/Home/index.js similarity index 100% rename from frontend/scenes/Home/index.js rename to app/scenes/Home/index.js diff --git a/frontend/scenes/KeyboardShortcuts/KeyboardShortcuts.js b/app/scenes/KeyboardShortcuts/KeyboardShortcuts.js similarity index 98% rename from frontend/scenes/KeyboardShortcuts/KeyboardShortcuts.js rename to app/scenes/KeyboardShortcuts/KeyboardShortcuts.js index afb42649b..f07928318 100644 --- a/frontend/scenes/KeyboardShortcuts/KeyboardShortcuts.js +++ b/app/scenes/KeyboardShortcuts/KeyboardShortcuts.js @@ -2,7 +2,7 @@ import React from 'react'; import styled from 'styled-components'; import Key from 'components/Key'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import HelpText from 'components/HelpText'; function KeyboardShortcuts() { diff --git a/frontend/scenes/KeyboardShortcuts/index.js b/app/scenes/KeyboardShortcuts/index.js similarity index 100% rename from frontend/scenes/KeyboardShortcuts/index.js rename to app/scenes/KeyboardShortcuts/index.js diff --git a/frontend/scenes/Search/Search.js b/app/scenes/Search/Search.js similarity index 99% rename from frontend/scenes/Search/Search.js rename to app/scenes/Search/Search.js index 9050d0564..1000d18f7 100644 --- a/frontend/scenes/Search/Search.js +++ b/app/scenes/Search/Search.js @@ -13,7 +13,7 @@ import styled from 'styled-components'; import ArrowKeyNavigation from 'boundless-arrow-key-navigation'; import Empty from 'components/Empty'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import CenteredContent from 'components/CenteredContent'; import LoadingIndicator from 'components/LoadingIndicator'; import SearchField from './components/SearchField'; diff --git a/frontend/scenes/Search/components/SearchField/SearchField.js b/app/scenes/Search/components/SearchField.js similarity index 93% rename from frontend/scenes/Search/components/SearchField/SearchField.js rename to app/scenes/Search/components/SearchField.js index 8c0645767..466bcb437 100644 --- a/frontend/scenes/Search/components/SearchField/SearchField.js +++ b/app/scenes/Search/components/SearchField.js @@ -1,8 +1,8 @@ // @flow import React, { Component } from 'react'; import SearchIcon from 'components/Icon/SearchIcon'; -import Flex from 'components/Flex'; -import { color } from 'styles/constants'; +import Flex from 'shared/components/Flex'; +import { color } from 'shared/styles/constants'; import styled from 'styled-components'; class SearchField extends Component { diff --git a/frontend/scenes/Search/index.js b/app/scenes/Search/index.js similarity index 100% rename from frontend/scenes/Search/index.js rename to app/scenes/Search/index.js diff --git a/frontend/scenes/Settings/Settings.js b/app/scenes/Settings/Settings.js similarity index 97% rename from frontend/scenes/Settings/Settings.js rename to app/scenes/Settings/Settings.js index 82b1803c7..7b3a02280 100644 --- a/frontend/scenes/Settings/Settings.js +++ b/app/scenes/Settings/Settings.js @@ -5,9 +5,9 @@ import { Link } from 'react-router-dom'; import styled from 'styled-components'; import ApiKeyRow from './components/ApiKeyRow'; import SettingsStore from './SettingsStore'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import Button from 'components/Button'; import Input from 'components/Input'; import HelpText from 'components/HelpText'; diff --git a/frontend/scenes/Settings/SettingsStore.js b/app/scenes/Settings/SettingsStore.js similarity index 100% rename from frontend/scenes/Settings/SettingsStore.js rename to app/scenes/Settings/SettingsStore.js diff --git a/frontend/scenes/Settings/components/ApiKeyRow/ApiKeyRow.js b/app/scenes/Settings/components/ApiKeyRow.js similarity index 95% rename from frontend/scenes/Settings/components/ApiKeyRow/ApiKeyRow.js rename to app/scenes/Settings/components/ApiKeyRow.js index 36e7dbc4b..f6f2ae09b 100644 --- a/frontend/scenes/Settings/components/ApiKeyRow/ApiKeyRow.js +++ b/app/scenes/Settings/components/ApiKeyRow.js @@ -3,7 +3,7 @@ import React from 'react'; import { observable } from 'mobx'; import { observer } from 'mobx-react'; import styled from 'styled-components'; -import { color } from 'styles/constants'; +import { color } from 'shared/styles/constants'; type Props = { id: string, diff --git a/frontend/scenes/Settings/index.js b/app/scenes/Settings/index.js similarity index 100% rename from frontend/scenes/Settings/index.js rename to app/scenes/Settings/index.js diff --git a/frontend/scenes/SlackAuth/SlackAuth.js b/app/scenes/SlackAuth/SlackAuth.js similarity index 89% rename from frontend/scenes/SlackAuth/SlackAuth.js rename to app/scenes/SlackAuth/SlackAuth.js index 2846b75ad..87a0ff7f1 100644 --- a/frontend/scenes/SlackAuth/SlackAuth.js +++ b/app/scenes/SlackAuth/SlackAuth.js @@ -5,6 +5,7 @@ import queryString from 'query-string'; import { observable } from 'mobx'; import { observer, inject } from 'mobx-react'; import { client } from 'utils/ApiClient'; +import { slackAuth } from 'utils/routeHelpers'; import AuthStore from 'stores/AuthStore'; @@ -33,7 +34,7 @@ type Props = { } else { this.redirectTo = '/auth/error'; } - } else { + } else if (code) { if (this.props.location.pathname === '/auth/slack/commands') { // User adding webhook integrations try { @@ -43,7 +44,7 @@ type Props = { this.redirectTo = '/auth/error'; } } else { - // Regular Slack authentication + // Slack authentication const redirectTo = sessionStorage.getItem('redirectTo'); sessionStorage.removeItem('redirectTo'); @@ -52,6 +53,9 @@ type Props = { ? (this.redirectTo = redirectTo || '/dashboard') : (this.redirectTo = '/auth/error'); } + } else { + // Sign In + window.location.href = slackAuth(this.props.auth.getOauthState()); } } diff --git a/frontend/scenes/SlackAuth/index.js b/app/scenes/SlackAuth/index.js similarity index 100% rename from frontend/scenes/SlackAuth/index.js rename to app/scenes/SlackAuth/index.js diff --git a/frontend/scenes/Starred/Starred.js b/app/scenes/Starred/Starred.js similarity index 100% rename from frontend/scenes/Starred/Starred.js rename to app/scenes/Starred/Starred.js diff --git a/frontend/scenes/Starred/index.js b/app/scenes/Starred/index.js similarity index 100% rename from frontend/scenes/Starred/index.js rename to app/scenes/Starred/index.js diff --git a/frontend/static/flatpages/api.md b/app/static/flatpages/api.md similarity index 100% rename from frontend/static/flatpages/api.md rename to app/static/flatpages/api.md diff --git a/frontend/static/flatpages/index.js b/app/static/flatpages/index.js similarity index 100% rename from frontend/static/flatpages/index.js rename to app/static/flatpages/index.js diff --git a/frontend/stores/AuthStore.js b/app/stores/AuthStore.js similarity index 96% rename from frontend/stores/AuthStore.js rename to app/stores/AuthStore.js index c0c7800e9..d165de33c 100644 --- a/frontend/stores/AuthStore.js +++ b/app/stores/AuthStore.js @@ -1,6 +1,7 @@ // @flow import { observable, action, computed, autorunAsync } from 'mobx'; import invariant from 'invariant'; +import Cookie from 'js-cookie'; import { client } from 'utils/ApiClient'; import type { User, Team } from 'types'; @@ -33,6 +34,7 @@ class AuthStore { @action logout = () => { this.user = null; this.token = null; + Cookie.remove('loggedIn', { path: '/' }); }; @action getOauthState = () => { diff --git a/frontend/stores/BaseStore.js b/app/stores/BaseStore.js similarity index 100% rename from frontend/stores/BaseStore.js rename to app/stores/BaseStore.js diff --git a/frontend/stores/CacheStore.js b/app/stores/CacheStore.js similarity index 100% rename from frontend/stores/CacheStore.js rename to app/stores/CacheStore.js diff --git a/frontend/stores/CollectionsStore.js b/app/stores/CollectionsStore.js similarity index 100% rename from frontend/stores/CollectionsStore.js rename to app/stores/CollectionsStore.js diff --git a/frontend/stores/CollectionsStore.test.js b/app/stores/CollectionsStore.test.js similarity index 100% rename from frontend/stores/CollectionsStore.test.js rename to app/stores/CollectionsStore.test.js diff --git a/frontend/stores/DocumentsStore.js b/app/stores/DocumentsStore.js similarity index 100% rename from frontend/stores/DocumentsStore.js rename to app/stores/DocumentsStore.js diff --git a/frontend/stores/ErrorsStore.js b/app/stores/ErrorsStore.js similarity index 100% rename from frontend/stores/ErrorsStore.js rename to app/stores/ErrorsStore.js diff --git a/frontend/stores/ErrorsStore.test.js b/app/stores/ErrorsStore.test.js similarity index 100% rename from frontend/stores/ErrorsStore.test.js rename to app/stores/ErrorsStore.test.js diff --git a/frontend/stores/UiStore.js b/app/stores/UiStore.js similarity index 100% rename from frontend/stores/UiStore.js rename to app/stores/UiStore.js diff --git a/frontend/stores/index.js b/app/stores/index.js similarity index 100% rename from frontend/stores/index.js rename to app/stores/index.js diff --git a/frontend/styles/prism.css b/app/styles/prism.css similarity index 100% rename from frontend/styles/prism.css rename to app/styles/prism.css diff --git a/frontend/styles/transitions.css b/app/styles/transitions.css similarity index 100% rename from frontend/styles/transitions.css rename to app/styles/transitions.css diff --git a/frontend/types/index.js b/app/types/index.js similarity index 100% rename from frontend/types/index.js rename to app/types/index.js diff --git a/frontend/utils/ApiClient.js b/app/utils/ApiClient.js similarity index 98% rename from frontend/utils/ApiClient.js rename to app/utils/ApiClient.js index 3c7ff2bea..c94ed2f24 100644 --- a/frontend/utils/ApiClient.js +++ b/app/utils/ApiClient.js @@ -52,6 +52,7 @@ class ApiClient { body, headers, redirect: 'follow', + credentials: 'include', }); // Handle request promises and return a new promise diff --git a/frontend/utils/__mocks__/ApiClient.js b/app/utils/__mocks__/ApiClient.js similarity index 100% rename from frontend/utils/__mocks__/ApiClient.js rename to app/utils/__mocks__/ApiClient.js diff --git a/frontend/utils/getDataTransferFiles.js b/app/utils/getDataTransferFiles.js similarity index 100% rename from frontend/utils/getDataTransferFiles.js rename to app/utils/getDataTransferFiles.js diff --git a/frontend/utils/routeHelpers.js b/app/utils/routeHelpers.js similarity index 75% rename from frontend/utils/routeHelpers.js rename to app/utils/routeHelpers.js index 4db4200f7..b1e5f16ab 100644 --- a/frontend/utils/routeHelpers.js +++ b/app/utils/routeHelpers.js @@ -22,6 +22,31 @@ export function documentUrl(doc: Document): string { return doc.url; } +export function slackAuth( + state: string, + scopes: string[] = [ + 'identity.email', + 'identity.basic', + 'identity.avatar', + 'identity.team', + ], + redirectUri: string = `${BASE_URL}/auth/slack` +): string { + const baseUrl = 'https://slack.com/oauth/authorize'; + const params = { + client_id: SLACK_KEY, + scope: scopes ? scopes.join(' ') : '', + redirect_uri: redirectUri, + state, + }; + + const urlParams = Object.keys(params) + .map(key => `${key}=${encodeURIComponent(params[key])}`) + .join('&'); + + return `${baseUrl}?${urlParams}`; +} + export function documentNewUrl(doc: Document): string { const newUrl = `${doc.collection.url}/new`; if (doc.parentDocumentId) { diff --git a/frontend/utils/uploadFile.js b/app/utils/uploadFile.js similarity index 100% rename from frontend/utils/uploadFile.js rename to app/utils/uploadFile.js diff --git a/flow-typed/npm/react-helmet_v3.x.x.js b/flow-typed/npm/react-helmet_v3.x.x.js deleted file mode 100644 index 06a1432e1..000000000 --- a/flow-typed/npm/react-helmet_v3.x.x.js +++ /dev/null @@ -1,37 +0,0 @@ -// flow-typed signature: 7ee00cf01ba33eeba35dee9d286ece86 -// flow-typed version: 0d0440f3d3/react-helmet_v3.x.x/flow_>=v0.26.x - -declare module 'react-helmet' { - declare type Props = { - htmlAttributes?: Object, - title?: string, - defaultTitle?: string, - titleTemplate?: string, - base?: Object, - meta?: Array, - link?: Array, - script?: Array, - noscript?: Array, - style?: Array, - onChangeClientState?: (newState: Object, addedTags: Object, removeTags: Object) => void | mixed, - }; - declare interface HeadAttribute { - toString(): string; - toComponent(): React$Element<*>; - } - declare interface Head { - htmlAttributes: HeadAttribute; - title: HeadAttribute; - base: HeadAttribute; - meta: HeadAttribute; - link: HeadAttribute; - script: HeadAttribute; - style: HeadAttribute; - } - - declare class Helmet extends React$Component { - static rewind(): Head; - props: Props; - } - declare var exports: typeof Helmet; -} diff --git a/frontend/components/Flex/index.js b/frontend/components/Flex/index.js deleted file mode 100644 index d798e8cd8..000000000 --- a/frontend/components/Flex/index.js +++ /dev/null @@ -1,3 +0,0 @@ -// @flow -import Flex from './Flex'; -export default Flex; diff --git a/frontend/components/PageTitle/PageTitle.js b/frontend/components/PageTitle/PageTitle.js deleted file mode 100644 index 1b3526a89..000000000 --- a/frontend/components/PageTitle/PageTitle.js +++ /dev/null @@ -1,11 +0,0 @@ -// @flow -import React from 'react'; -import Helmet from 'react-helmet'; - -type Props = { - title: string, -}; - -const PageTitle = ({ title }: Props) => ; - -export default PageTitle; diff --git a/frontend/scenes/Home/Home.js b/frontend/scenes/Home/Home.js deleted file mode 100644 index a65b665d0..000000000 --- a/frontend/scenes/Home/Home.js +++ /dev/null @@ -1,77 +0,0 @@ -// @flow -import React from 'react'; -import { observer, inject } from 'mobx-react'; -import { Redirect } from 'react-router'; -import Flex from 'components/Flex'; -import styled from 'styled-components'; - -import AuthStore from 'stores/AuthStore'; - -import CenteredContent from 'components/CenteredContent'; -import SlackAuthLink from 'components/SlackAuthLink'; -import Alert from 'components/Alert'; - -type Props = { - auth: AuthStore, - location: Object, -}; - -@observer class Home extends React.Component { - props: Props; - - get notifications(): React.Element[] { - const notifications = []; - const { state } = this.props.location; - - if (state && state.nextPathname) { - sessionStorage.removeItem('redirectTo'); - sessionStorage.setItem('redirectTo', state.nextPathname); - notifications.push(Please login to continue); - } - - return notifications; - } - - render() { - const showLandingPageCopy = DEPLOYMENT === 'hosted'; - - return ( - - {this.props.auth.authenticated && } - - - {showLandingPageCopy && -
- Simple, fast, markdown. - - We're building a modern wiki for engineering teams. - -
} -
- - Sign in with Slack - -
-
-
- ); - } -} - -const Title = styled.h1` - font-size: 36px; - margin-bottom: 24px; -}`; - -const Copy = styled.p` - font-size: 20px; - margin-bottom: 36px; -}`; - -export default inject('auth')(Home); diff --git a/frontend/scenes/Search/components/SearchField/index.js b/frontend/scenes/Search/components/SearchField/index.js deleted file mode 100644 index a45be6bf8..000000000 --- a/frontend/scenes/Search/components/SearchField/index.js +++ /dev/null @@ -1,3 +0,0 @@ -// @flow -import SearchField from './SearchField'; -export default SearchField; diff --git a/frontend/scenes/Settings/components/ApiKeyRow/index.js b/frontend/scenes/Settings/components/ApiKeyRow/index.js deleted file mode 100644 index 1c94f8f0c..000000000 --- a/frontend/scenes/Settings/components/ApiKeyRow/index.js +++ /dev/null @@ -1,3 +0,0 @@ -// @flow -import ApiKeyRow from './ApiKeyRow'; -export default ApiKeyRow; diff --git a/frontend/styles/base.css b/frontend/styles/base.css deleted file mode 100644 index ec8a87f07..000000000 --- a/frontend/styles/base.css +++ /dev/null @@ -1,143 +0,0 @@ -* { - box-sizing: border-box; -} - -:root { - --line-height-1: 1; - --line-height-2: 1.125; - --line-height-3: 1.25; - --line-height-4: 1.5; - --letter-spacing: 1; - --caps-letter-spacing: 0.2em; - --bold-font-weight: bold; -} - -html, -body, -.viewport { - width: 100%; - min-height: 100vh; - margin: 0; -} - -body, -button, -input, -optgroup, -select, -textarea { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, - Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; -} - -body { - font-size: 16px; - line-height: 1.5; - margin: 0; - color: #617180; - background-color: #fff; - display: flex; - - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; - text-rendering: optimizeLegibility; -} -img { - max-width: 100%; - height: auto; -} -svg { - max-height: 100%; -} -a { - color: #16B3FF; - text-decoration: none; - cursor: pointer; -} -h1, -h2, -h3, -h4, -h5, -h6 { - font-weight: 500; - line-height: 1.25; - margin-top: 1em; - margin-bottom: 0.5em; - color: #1f2429; -} -h1 { - font-size: 2em; -} -h2 { - font-size: 1.5em; -} -h3 { - font-size: 1.25em; -} -h4 { - font-size: 1em; -} -h5 { - font-size: 0.875em; -} -h6 { - font-size: 0.75em; -} -p, -dl, -ol, -ul, -pre, -blockquote { - margin-top: 1em; - margin-bottom: 1em; -} -code, -pre, -samp { - font-family: 'Atlas Typewriter', 'Source Code Pro', Menlo, Consolas, - 'Liberation Mono', monospace; -} -code, -samp { - font-size: 85%; - padding: 0.125em; -} -pre { - font-size: 85%; - overflow: scroll; -} -blockquote { - font-size: 1.25em; - font-style: italic; - margin-left: 0; -} -hr { - margin: 2em 0; - border: 0; - border-bottom-width: 1px; - border-bottom-style: solid; - border-bottom-color: #dedede; -} -*[role='button'] { - cursor: pointer; -} - -.hljs { - border: 1px solid rgba(0, 0, 0, 0.0625); - padding: 1em; - border-radius: 0.25em; -} - -.activeDropZone { - background: #4E5C6E; -} - -.activeDropZone a { - color: #FFF !important; -} - -.ReactModal__Body--open { - overflow: hidden; -} diff --git a/frontend/styles/fonts.css b/frontend/styles/fonts.css deleted file mode 100644 index c5cff8a83..000000000 --- a/frontend/styles/fonts.css +++ /dev/null @@ -1,62 +0,0 @@ -@font-face { - font-family: 'Atlas Grotesk'; - src: url('../fonts/atlas/AtlasGrotesk-Regular-Web.woff') format('woff'); - font-weight: normal; - font-style: normal; -} - -@font-face { - font-family: 'Atlas Grotesk'; - src: url('../fonts/atlas/AtlasGrotesk-Medium-Web.woff') format('woff'); - font-weight: bold; - font-style: normal; -} - -/*@font-face { - font-family: 'Atlas Grotesk'; - src: url('../fonts/atlas/AtlasGrotesk-Light-Web.woff') format('woff'); - font-weight: lighter; - font-style: normal; -} - -@font-face { - font-family: 'Atlas Grotesk'; - src: url('../fonts/atlas/AtlasGrotesk-LightItalic-Web.woff') format('woff'); - font-weight: lighter; - font-style: italic; -}*/ - -@font-face { - font-family: 'Atlas Grotesk'; - src: url('../fonts/atlas/AtlasGrotesk-RegularItalic-Web.woff') format('woff'); - font-weight: normal; - font-style: italic; -} - -@font-face { - font-family: 'Atlas Grotesk'; - src: url('../fonts/atlas/AtlasGrotesk-MediumItalic-Web.woff') format('woff'); - font-weight: bold; - font-style: italic; -} - -@font-face { - font-family: 'Atlas Grotesk'; - src: url('../fonts/atlas/AtlasGrotesk-MediumItalic-Web.woff') format('woff'); - font-weight: bold; - font-style: italic; -} - -@font-face { - font-family: 'Atlas Typewriter'; - src: url('../fonts/atlas/AtlasTypewriterRegular.woff') format('woff'); - font-weight: normal; - font-style: normal; -} - -@font-face { - font-family: 'Atlas Typewriter'; - src: url('../fonts/atlas/AtlasTypewriterMedium.woff') format('woff'); - font-weight: bold; - font-style: normal; -} diff --git a/package.json b/package.json index da53a3aac..1971c3794 100644 --- a/package.json +++ b/package.json @@ -10,14 +10,14 @@ "start": "node index.js", "dev": "NODE_ENV=development DEBUG=sql,cache,presenters ./node_modules/.bin/nodemon --inspect --watch server index.js", "lint": "npm run lint:flow && npm run lint:js", - "lint:js": "eslint frontend", + "lint:js": "eslint app", "lint:flow": "flow", "deploy": "git push heroku master", "heroku-postbuild": "npm run build && npm run sequelize:migrate", "sequelize:create-migration": "sequelize migration:create", "sequelize:migrate": "sequelize db:migrate", - "test": "npm run test:frontend && npm run test:server", - "test:frontend": "jest", + "test": "npm run test:app && npm run test:server", + "test:app": "jest", "test:server": "jest --config=server/.jestconfig.json --runInBand --forceExit", "precommit": "lint-staged" }, @@ -30,7 +30,7 @@ "jest": { "verbose": false, "roots": [ - "frontend" + "app" ], "moduleNameMapper": { "^.*[.](s?css|css)$": "/__mocks__/styleMock.js", @@ -45,7 +45,7 @@ "node_modules" ], "modulePaths": [ - "frontend" + "app" ], "setupFiles": [ "/setupJest.js", @@ -78,7 +78,7 @@ "babel-preset-react": "6.11.1", "babel-preset-react-hmre": "1.1.1", "babel-regenerator-runtime": "6.5.0", - "bcrypt": "^0.8.7", + "bcrypt": "1.0.3", "boundless-arrow-key-navigation": "^1.0.4", "boundless-popover": "^1.0.4", "bugsnag": "^1.7.0", @@ -106,6 +106,7 @@ "imports-loader": "0.6.5", "invariant": "^2.2.2", "isomorphic-fetch": "2.2.1", + "js-cookie": "^2.1.4", "js-search": "^1.4.2", "json-loader": "0.5.4", "jsonwebtoken": "7.0.1", @@ -120,6 +121,7 @@ "koa-mount": "^3.0.0", "koa-router": "7.0.1", "koa-sendfile": "2.0.0", + "koa-static": "^4.0.1", "localforage": "^1.5.0", "lodash": "^4.17.4", "lodash.orderby": "4.4.0", @@ -141,7 +143,7 @@ "react-addons-css-transition-group": "15.3.2", "react-dom": "^15.6.1", "react-dropzone": "3.6.0", - "react-helmet": "3.1.0", + "react-helmet": "^5.2.0", "react-keydown": "^1.7.3", "react-modal": "^2.2.1", "react-portal": "^3.1.0", @@ -165,6 +167,8 @@ "string-hash": "^1.1.0", "style-loader": "^0.18.2", "styled-components": "^2.0.0", + "styled-components-grid": "^1.0.0-preview.15", + "styled-normalize": "^2.2.1", "url-loader": "0.5.7", "uuid": "2.0.2", "validator": "5.2.0", diff --git a/server/api/auth.js b/server/api/auth.js index 51304e5d7..01bc6f1ad 100644 --- a/server/api/auth.js +++ b/server/api/auth.js @@ -47,6 +47,14 @@ router.post('auth.slack', async ctx => { await team.createFirstCollection(user.id); } + // Signal to backend that the user is logged in. + // This is only used to signal SSR rendering, not + // used for auth. + ctx.cookies.set('loggedIn', 'true', { + httpOnly: false, + expires: new Date('2100'), + }); + // Update user's avatar await user.updateAvatar(); await user.save(); diff --git a/server/index.js b/server/index.js index 10c7bb925..92eb0738e 100644 --- a/server/index.js +++ b/server/index.js @@ -46,7 +46,7 @@ if (process.env.NODE_ENV === 'development') { // use the same as in webpack publicPath: config.output.publicPath, - // options for formating the statistics + // options for formatting the statistics stats: { colors: true, }, diff --git a/server/pages/About.js b/server/pages/About.js new file mode 100644 index 000000000..281ff9197 --- /dev/null +++ b/server/pages/About.js @@ -0,0 +1,21 @@ +// @flow +import React from 'react'; +import Grid from 'styled-components-grid'; +import { Helmet } from 'react-helmet'; +import Hero from './components/Hero'; + +export default function About() { + return ( + + + About + + +

About Atlas

+

+ Just a proof of concept for multiple pages. +

+
+
+ ); +} diff --git a/server/pages/Home.js b/server/pages/Home.js new file mode 100644 index 000000000..6500ba268 --- /dev/null +++ b/server/pages/Home.js @@ -0,0 +1,34 @@ +// @flow +import React from 'react'; +import styled from 'styled-components'; +import Grid from 'styled-components-grid'; +import Hero from './components/Hero'; +import SignupButton from './components/SignupButton'; + +function Home() { + return ( + + + +

Your team’s knowledge base

+ + Documentation, meeting notes, playbooks, onboarding, work logs, brainstorming, decisions, & more… + +

+ +

+
+
+
+ ); +} + +const HeroText = styled.p` + font-size: 18px; + max-width: 600px; + margin-left: auto; + margin-right: auto; + margin-bottom: 2em; +`; + +export default Home; diff --git a/server/pages/Pricing.js b/server/pages/Pricing.js new file mode 100644 index 000000000..d8d76ec66 --- /dev/null +++ b/server/pages/Pricing.js @@ -0,0 +1,21 @@ +// @flow +import React from 'react'; +import Grid from 'styled-components-grid'; +import { Helmet } from 'react-helmet'; +import Hero from './components/Hero'; + +export default function Pricing() { + return ( + + + Pricing + + +

Pricing

+

+ Explore Atlas with a 14 day trial, free forever for teams smaller than 5. +

+
+
+ ); +} diff --git a/server/pages/components/Hero.js b/server/pages/components/Hero.js new file mode 100644 index 000000000..f597c92a2 --- /dev/null +++ b/server/pages/components/Hero.js @@ -0,0 +1,14 @@ +// @flow +import styled from 'styled-components'; + +const Hero = styled.div` + width: 100%; + padding: 6em 2em 8em; + text-align: center; + + h1 { + font-size: 2.5em; + } +`; + +export default Hero; diff --git a/server/pages/components/Layout.js b/server/pages/components/Layout.js new file mode 100644 index 000000000..3f873c086 --- /dev/null +++ b/server/pages/components/Layout.js @@ -0,0 +1,31 @@ +// @flow +import React from 'react'; +import { Helmet } from 'react-helmet'; +import Navigation from './Navigation'; +import globalStyles from '../../../shared/styles/globals'; + +type Props = { + children?: React$Element<*>, +}; + +export default function Layout({ children }: Props) { + globalStyles(); + + return ( + + + + Atlas + + + + {'{{HEAD}}'} + {'{{CSS}}'} + + + + {children} + + + ); +} diff --git a/server/pages/components/Navigation.js b/server/pages/components/Navigation.js new file mode 100644 index 000000000..0ff578067 --- /dev/null +++ b/server/pages/components/Navigation.js @@ -0,0 +1,43 @@ +// @flow +import React from 'react'; +import styled from 'styled-components'; +import { color } from '../../../shared/styles/constants'; + +function Navigation() { + return ( + + ); +} + +const Nav = styled.nav` + display: flex; + padding: 20px 30px; + justify-content: space-between; +`; + +const Menu = styled.ul` + margin: 0; + padding: 0; + list-style: none; +`; + +const MenuItem = styled.li` + display: inline-block; + margin: 0 0 0 40px; + font-size: 15px; + font-weight: 500; +`; + +const Brand = styled.a` + font-weight: 600; + font-size: 20px; + text-decoration: none; + color: ${color.black}; +`; + +export default Navigation; diff --git a/server/pages/components/SignupButton.js b/server/pages/components/SignupButton.js new file mode 100644 index 000000000..be26fae58 --- /dev/null +++ b/server/pages/components/SignupButton.js @@ -0,0 +1,19 @@ +// @flow +import React from 'react'; +import styled from 'styled-components'; +import { color } from '../../../shared/styles/constants'; + +const SlackSignin = () => { + return ; +}; + +const Button = styled.a` + display: inline-block; + padding: 10px 20px; + color: ${color.white}; + background: ${color.black}; + border-radius: 4px; + font-weight: 500; +`; + +export default SlackSignin; diff --git a/server/routes.js b/server/routes.js index 5d1987a02..3edbf4bea 100644 --- a/server/routes.js +++ b/server/routes.js @@ -1,21 +1,32 @@ +// @flow +import React from 'react'; import path from 'path'; import httpErrors from 'http-errors'; import Koa from 'koa'; import Router from 'koa-router'; import sendfile from 'koa-sendfile'; - +import serve from 'koa-static'; import subdomainRedirect from './middlewares/subdomainRedirect'; +import renderpage from './utils/renderpage'; +import Home from './pages/Home'; +import About from './pages/About'; +import Pricing from './pages/Pricing'; + +const isProduction = process.env.NODE_ENV === 'production'; const koa = new Koa(); const router = new Router(); -router.get('/service-worker.js', async ctx => { - ctx.set('Content-Type', 'application/javascript'); - if (process.env.NODE_ENV === 'production') - ctx.set('Cache-Control', `max-age=${30}`); - await sendfile(ctx, path.join(__dirname, './static/service-worker.js')); - if (!ctx.status) ctx.throw(httpErrors.NotFound()); -}); +const renderapp = async ctx => { + if (isProduction) { + await sendfile(ctx, path.join(__dirname, '../dist/index.html')); + } else { + await sendfile(ctx, path.join(__dirname, './static/dev.html')); + } +}; + +// serve static assets +koa.use(serve(path.resolve(__dirname, '../public'))); router.get('/_health', ctx => (ctx.body = 'OK')); @@ -30,23 +41,30 @@ if (process.env.NODE_ENV === 'production') { path.join(__dirname, '../dist/', ctx.path.substring(8)) ); }); - - router.get('*', async ctx => { - await sendfile(ctx, path.join(__dirname, '../dist/index.html')); - if (!ctx.status) ctx.throw(httpErrors.NotFound()); - }); - - koa.use(subdomainRedirect()); -} else { - router.get('*', async ctx => { - await sendfile(ctx, path.join(__dirname, './static/dev.html')); - if (!ctx.status) ctx.throw(httpErrors.NotFound()); - }); } -koa.use(router.routes()); +// static pages +router.get('/about', ctx => renderpage(ctx, )); +router.get('/pricing', ctx => renderpage(ctx, )); -// 404 handler +// home page +router.get('/', async ctx => { + if (ctx.cookies.get('loggedIn')) { + await renderapp(ctx); + } else { + await renderpage(ctx, ); + } +}); + +// catch all for react app +router.get('*', async ctx => { + await renderapp(ctx); + if (!ctx.status) ctx.throw(httpErrors.NotFound()); +}); + +// middleware +koa.use(subdomainRedirect()); +koa.use(router.routes()); koa.use(async () => { throw httpErrors.NotFound(); }); diff --git a/server/static/index.html b/server/static/index.html index 3613c5c07..612e83c83 100644 --- a/server/static/index.html +++ b/server/static/index.html @@ -25,7 +25,7 @@
+ - - \ No newline at end of file + diff --git a/server/utils/renderpage.js b/server/utils/renderpage.js new file mode 100644 index 000000000..7a8c73998 --- /dev/null +++ b/server/utils/renderpage.js @@ -0,0 +1,27 @@ +// @flow +import React from 'react'; +import ReactDOMServer from 'react-dom/server'; +import { Helmet } from 'react-helmet'; +import { ServerStyleSheet, StyleSheetManager } from 'styled-components'; +import Layout from '../pages/components/Layout'; + +const sheet = new ServerStyleSheet(); + +export default function renderpage(ctx: Object, children: React$Element<*>) { + const html = ReactDOMServer.renderToString( + + + {children} + + + ); + + // helmet returns an object of meta tags with toString methods, urgh. + const helmet = Helmet.renderStatic(); + let head = ''; + Object.keys(helmet).forEach(key => (head += helmet[key].toString())); + + ctx.body = html + .replace('{{CSS}}', sheet.getStyleTags()) + .replace('{{HEAD}}', head); +} diff --git a/frontend/components/Flex/Flex.js b/shared/components/Flex.js similarity index 96% rename from frontend/components/Flex/Flex.js rename to shared/components/Flex.js index d14c0ce15..3b420fafb 100644 --- a/frontend/components/Flex/Flex.js +++ b/shared/components/Flex.js @@ -22,7 +22,7 @@ type Props = { justify?: JustifyValues, auto?: ?boolean, className?: string, - children?: React.Element, + children?: React$Element<*>, }; const Flex = (props: Props) => { diff --git a/frontend/utils/random.js b/shared/random.js similarity index 100% rename from frontend/utils/random.js rename to shared/random.js diff --git a/frontend/styles/animations.js b/shared/styles/animations.js similarity index 100% rename from frontend/styles/animations.js rename to shared/styles/animations.js diff --git a/shared/styles/base.js b/shared/styles/base.js new file mode 100644 index 000000000..99239b560 --- /dev/null +++ b/shared/styles/base.js @@ -0,0 +1,71 @@ +// @flow +import { color } from './constants'; + +export default ` + * { + box-sizing: border-box; + } + + html, + body { + width: 100%; + min-height: 100vh; + margin: 0; + padding: 0; + } + + body, + button, + input, + optgroup, + select, + textarea { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, + Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + } + + body { + font-size: 16px; + line-height: 1.5; + color: ${color.text}; + + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + } + + a { + color: ${color.blue}; + text-decoration: none; + cursor: pointer; + } + + h1, + h2, + h3, + h4, + h5, + h6 { + font-weight: 500; + line-height: 1.25; + margin-top: 1em; + margin-bottom: 0.5em; + color: ${color.text}; + } + h1 { font-size: 2em; } + h2 { font-size: 1.5em; } + h3 { font-size: 1.25em; } + h4 { font-size: 1em; } + h5 { font-size: 0.875em; } + h6 { font-size: 0.75em; } + + p, + dl, + ol, + ul, + pre, + blockquote { + margin-top: 1em; + margin-bottom: 1em; + } +`; diff --git a/frontend/styles/constants.js b/shared/styles/constants.js similarity index 97% rename from frontend/styles/constants.js rename to shared/styles/constants.js index 24b53ab62..9bd4f6f43 100644 --- a/frontend/styles/constants.js +++ b/shared/styles/constants.js @@ -1,5 +1,4 @@ // @flow - export const layout = { padding: '1.5vw 1.875vw', vpadding: '1.5vw', @@ -60,6 +59,5 @@ export const color = { /* Misc */ white: '#FFFFFF', black: '#000000', - - /* Alert colors */ + blue: '#16B3FF', }; diff --git a/shared/styles/globals.js b/shared/styles/globals.js new file mode 100644 index 000000000..6bdb1a67a --- /dev/null +++ b/shared/styles/globals.js @@ -0,0 +1,9 @@ +// @flow +import styledNormalize from 'styled-normalize'; +import { injectGlobal } from 'styled-components'; +import base from './base'; + +export default () => injectGlobal` + ${styledNormalize} + ${base} +`; diff --git a/webpack.config.dev.js b/webpack.config.dev.js index a09773b95..640cd2e47 100644 --- a/webpack.config.dev.js +++ b/webpack.config.dev.js @@ -12,7 +12,7 @@ const developmentWebpackConfig = Object.assign(commonWebpackConfig, { 'babel-polyfill', 'babel-regenerator-runtime', 'webpack-hot-middleware/client', - './frontend/index', + './app/index', ], }); diff --git a/webpack.config.js b/webpack.config.js index 5e33b37a8..53e855a8e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -29,7 +29,7 @@ module.exports = { test: /\.js$/, loader: 'babel', include: [ - path.join(__dirname, 'frontend'), + path.join(__dirname, 'app'), path.join(__dirname, 'shared'), ], }, @@ -50,9 +50,9 @@ module.exports = { noParse: [new RegExp('node_modules/localforage/dist/localforage.js')], }, resolve: { - root: path.join(__dirname, 'frontend'), - // you can now require('file') instead of require('file.json') + root: path.resolve(__dirname, 'app'), extensions: ['', '.js', '.json'], + alias: { shared: path.resolve(__dirname, 'shared') } }, plugins: [ definePlugin, diff --git a/webpack.config.prod.js b/webpack.config.prod.js index f3e0b0dfa..a17b872e3 100644 --- a/webpack.config.prod.js +++ b/webpack.config.prod.js @@ -9,7 +9,7 @@ commonWebpackConfig = require('./webpack.config'); productionWebpackConfig = Object.assign(commonWebpackConfig, { cache: true, devtool: 'source-map', - entry: ['babel-polyfill', 'babel-regenerator-runtime', './frontend/index'], + entry: ['babel-polyfill', 'babel-regenerator-runtime', './app/index'], output: { path: path.join(__dirname, 'dist'), filename: 'bundle.[hash].js', diff --git a/yarn.lock b/yarn.lock index 80829ae84..1f83c0d29 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1056,12 +1056,12 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -bcrypt@^0.8.7: - version "0.8.7" - resolved "https://registry.yarnpkg.com/bcrypt/-/bcrypt-0.8.7.tgz#bc3875a9afd0a7b2cd231a6a7f218a5ce156b093" +bcrypt@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/bcrypt/-/bcrypt-1.0.3.tgz#b02ddc6c0b52ea16b8d3cf375d5a32e780dab548" dependencies: - bindings "1.2.1" - nan "2.3.5" + nan "2.6.2" + node-pre-gyp "0.6.36" beeper@^1.0.0: version "1.1.1" @@ -1082,10 +1082,6 @@ binary-extensions@^1.0.0: buffers "~0.1.1" chainsaw "~0.1.0" -bindings@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.2.1.tgz#14ad6113812d2d37d72e67b4cacb4bb726505f11" - block-stream@*: version "0.0.9" resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" @@ -2227,7 +2223,7 @@ decompress-response@^3.2.0: dependencies: mimic-response "^1.0.0" -deep-equal@1.0.1, deep-equal@~1.0.1: +deep-equal@^1.0.1, deep-equal@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" @@ -2971,7 +2967,7 @@ execa@^0.7.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -exenv@^1.2.0: +exenv@^1.2.0, exenv@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/exenv/-/exenv-1.2.2.tgz#2ae78e85d9894158670b03d47bec1f03bd91bb9d" @@ -3100,14 +3096,6 @@ fbemitter@^2.1.1: dependencies: fbjs "^0.8.4" -fbjs@0.1.0-alpha.10: - version "0.1.0-alpha.10" - resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.1.0-alpha.10.tgz#46e457c09cbefb51fc752a3e030e7b67fcc384c8" - dependencies: - core-js "^1.0.0" - promise "^7.0.3" - whatwg-fetch "^0.9.0" - fbjs@^0.8.4, fbjs@^0.8.5, fbjs@^0.8.9: version "0.8.14" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.14.tgz#d1dbe2be254c35a91e09f31f9cd50a40b2a0ed1c" @@ -4018,6 +4006,15 @@ http-errors@1.6.1: setprototypeof "1.0.3" statuses ">= 1.3.1 < 2" +http-errors@^1.6.1, http-errors@~1.6.1: + version "1.6.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" + dependencies: + depd "1.1.1" + inherits "2.0.3" + setprototypeof "1.0.3" + statuses ">= 1.3.1 < 2" + http-errors@~1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.3.1.tgz#197e22cdebd4198585e8694ef6786197b91ed942" @@ -4025,13 +4022,12 @@ http-errors@~1.3.1: inherits "~2.0.1" statuses "1" -http-errors@~1.6.1: - version "1.6.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" +http-errors@~1.5.0: + version "1.5.1" + resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.5.1.tgz#788c0d2c1de2c81b9e6e8c01843b6b97eb920750" dependencies: - depd "1.1.1" inherits "2.0.3" - setprototypeof "1.0.3" + setprototypeof "1.0.2" statuses ">= 1.3.1 < 2" http-signature@~1.1.0: @@ -4861,6 +4857,10 @@ js-beautify@^1.6.11: mkdirp "~0.5.0" nopt "~3.0.1" +js-cookie@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.1.4.tgz#da4ec503866f149d164cf25f579ef31015025d8d" + js-search@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/js-search/-/js-search-1.4.2.tgz#59a91e117d6badb20bf0d7643ba7577d5a81d7e2" @@ -5122,6 +5122,15 @@ koa-router@7.0.1: methods "^1.0.1" path-to-regexp "^1.1.1" +koa-send@^4.1.0: + version "4.1.1" + resolved "https://registry.npmjs.org/koa-send/-/koa-send-4.1.1.tgz#bd3fa116b1f592f5fff23c9670aae69787f6cb57" + dependencies: + debug "^2.6.3" + http-errors "^1.6.1" + mz "^2.6.0" + resolve-path "^1.3.3" + koa-sendfile@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/koa-sendfile/-/koa-sendfile-2.0.0.tgz#446e2a35ba7074ed03afda2c667c2359406e1082" @@ -5130,6 +5139,13 @@ koa-sendfile@2.0.0: etag "^1.5.1" mz "2" +koa-static@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/koa-static/-/koa-static-4.0.1.tgz#b99521ed848d7adb79acae9c824d8d8277a8c4d5" + dependencies: + debug "^2.6.8" + koa-send "^4.1.0" + koa-unless@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/koa-unless/-/koa-unless-1.0.0.tgz#5aa57384bc882568afc90ac04852a3d58658aeeb" @@ -5538,7 +5554,7 @@ lodash.isstring@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" -lodash.keys@^3.0.0, lodash.keys@^3.1.2: +lodash.keys@^3.0.0: version "3.1.2" resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" dependencies: @@ -6017,7 +6033,19 @@ mz@2: object-assign "^4.0.1" thenify-all "^1.0.0" -nan@2.3.5, nan@^2.3.0: +mz@^2.6.0: + version "2.7.0" + resolved "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" + dependencies: + any-promise "^1.0.0" + object-assign "^4.0.1" + thenify-all "^1.0.0" + +nan@2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45" + +nan@^2.3.0: version "2.3.5" resolved "https://registry.yarnpkg.com/nan/-/nan-2.3.5.tgz#822a0dc266290ce4cd3a12282ca3e7e364668a08" @@ -6172,7 +6200,7 @@ node-notifier@^5.0.2: shellwords "^0.1.0" which "^1.2.12" -node-pre-gyp@^0.6.36: +node-pre-gyp@0.6.36, node-pre-gyp@^0.6.36: version "0.6.36" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.36.tgz#db604112cb74e0d477554e9b505b17abddfab786" dependencies: @@ -6628,7 +6656,7 @@ path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" -path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: +path-is-absolute@1.0.1, path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -7120,7 +7148,7 @@ progress@^1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" -promise@7.x, promise@^7.0.3, promise@^7.1.1: +promise@7.x, promise@^7.1.1: version "7.3.1" resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" dependencies: @@ -7287,6 +7315,13 @@ react-addons-test-utils@^15.3.1: version "15.6.0" resolved "https://registry.yarnpkg.com/react-addons-test-utils/-/react-addons-test-utils-15.6.0.tgz#062d36117fe8d18f3ba5e06eb33383b0b85ea5b9" +react-create-component-from-tag-prop@^1.2.1: + version "1.3.1" + resolved "https://registry.npmjs.org/react-create-component-from-tag-prop/-/react-create-component-from-tag-prop-1.3.1.tgz#5389407d99f88ba2b36351780a6094470b44a7c7" + dependencies: + lodash "^4.17.4" + react "^15.5.4" + react-deep-force-update@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-1.1.1.tgz#bcd31478027b64b3339f108921ab520b4313dc2c" @@ -7310,15 +7345,14 @@ react-dropzone@3.6.0: dependencies: attr-accept "^1.0.3" -react-helmet@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-3.1.0.tgz#63486194682f33004826f3687dc49a138b557050" +react-helmet@^5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/react-helmet/-/react-helmet-5.2.0.tgz#a81811df21313a6d55c5f058c4aeba5d6f3d97a7" dependencies: - deep-equal "1.0.1" - object-assign "^4.0.1" - react-side-effect "1.0.2" - shallowequal "0.2.2" - warning "2.1.0" + deep-equal "^1.0.1" + object-assign "^4.1.1" + prop-types "^15.5.4" + react-side-effect "^1.1.0" react-keydown@^1.7.3: version "1.9.4" @@ -7370,11 +7404,12 @@ react-router@^4.2.0: prop-types "^15.5.4" warning "^3.0.0" -react-side-effect@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-1.0.2.tgz#98e354decdbf0281e4223d87852d33e345eda561" +react-side-effect@^1.1.0: + version "1.1.3" + resolved "https://registry.npmjs.org/react-side-effect/-/react-side-effect-1.1.3.tgz#512c25abe0dec172834c4001ec5c51e04d41bc5c" dependencies: - fbjs "0.1.0-alpha.10" + exenv "^1.2.1" + shallowequal "^1.0.1" react-test-renderer@^15.3.1: version "15.6.1" @@ -7394,6 +7429,16 @@ react-transform-hmr@^1.0.3: global "^4.3.0" react-proxy "^1.1.7" +react@^15.5.4: + version "15.6.2" + resolved "https://registry.npmjs.org/react/-/react-15.6.2.tgz#dba0434ab439cfe82f108f0f511663908179aa72" + dependencies: + create-react-class "^15.6.0" + fbjs "^0.8.9" + loose-envify "^1.1.0" + object-assign "^4.1.0" + prop-types "^15.5.10" + react@^15.6.1: version "15.6.1" resolved "https://registry.yarnpkg.com/react/-/react-15.6.1.tgz#baa8434ec6780bde997cdc380b79cd33b96393df" @@ -7724,6 +7769,13 @@ resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" +resolve-path@^1.3.3: + version "1.3.3" + resolved "https://registry.npmjs.org/resolve-path/-/resolve-path-1.3.3.tgz#4d83aba6468c2b8e632a575e3f52b0fa0dbe1a5c" + dependencies: + http-errors "~1.5.0" + path-is-absolute "1.0.1" + resolve-pathname@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-2.2.0.tgz#7e9ae21ed815fd63ab189adeee64dc831eefa879" @@ -7981,6 +8033,10 @@ set-immediate-shim@^1.0.1: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" +setprototypeof@1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.2.tgz#81a552141ec104b88e89ce383103ad5c66564d08" + setprototypeof@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04" @@ -7995,11 +8051,9 @@ sha.js@^2.4.0, sha.js@^2.4.8: dependencies: inherits "^2.0.1" -shallowequal@0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-0.2.2.tgz#1e32fd5bcab6ad688a4812cb0cc04efc75c7014e" - dependencies: - lodash.keys "^3.1.2" +shallowequal@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/shallowequal/-/shallowequal-1.0.2.tgz#1561dbdefb8c01408100319085764da3fcf83f8f" shebang-command@^1.2.0: version "1.2.0" @@ -8398,6 +8452,18 @@ style-loader@^0.18.2: loader-utils "^1.0.2" schema-utils "^0.3.0" +styled-components-breakpoint@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/styled-components-breakpoint/-/styled-components-breakpoint-1.0.1.tgz#51fb474d9449e228b6f3f2cd232631ec65c149bc" + +styled-components-grid@^1.0.0-preview.15: + version "1.0.0-preview.15" + resolved "https://registry.npmjs.org/styled-components-grid/-/styled-components-grid-1.0.0-preview.15.tgz#90c6a4caa22292f7a2d80f055395f3fa18cd6720" + dependencies: + prop-types "^15.5.8" + react-create-component-from-tag-prop "^1.2.1" + styled-components-breakpoint "^1.0.1" + styled-components@^2.0.0: version "2.1.2" resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-2.1.2.tgz#bb419978e1287c5d0d88fa9106b2dd75f66a324c" @@ -8412,6 +8478,10 @@ styled-components@^2.0.0: stylis "^3.2.1" supports-color "^3.2.3" +styled-normalize@^2.2.1: + version "2.2.1" + resolved "https://registry.npmjs.org/styled-normalize/-/styled-normalize-2.2.1.tgz#c93a007c0339a69e3254eeef8cb6a5a96e5ca4eb" + stylis@^3.2.1: version "3.2.15" resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.2.15.tgz#1800f829fdf3cf0d647ae6cdb5fb70a1fd81c3e2" @@ -9019,7 +9089,7 @@ walker@~1.0.5: dependencies: makeerror "1.0.x" -warning@2.1.0, warning@^2.0.0: +warning@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/warning/-/warning-2.1.0.tgz#21220d9c63afc77a8c92111e011af705ce0c6901" dependencies: @@ -9114,10 +9184,6 @@ whatwg-fetch@>=0.10.0: version "2.0.3" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" -whatwg-fetch@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-0.9.0.tgz#0e3684c6cb9995b43efc9df03e4c365d95fd9cc0" - whatwg-url@^4.3.0: version "4.8.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.8.0.tgz#d2981aa9148c1e00a41c5a6131166ab4683bbcc0"