From 84c82c31a9890e4a9577c76461c6cfd234357310 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 29 Oct 2017 15:02:24 -0700 Subject: [PATCH] Shared assets, cleanup for initial deploy --- .env.sample | 1 + app/components/Alert/Alert.js | 2 +- app/components/Collaborators/Collaborators.js | 2 +- app/components/Divider/Divider.js | 2 +- .../components/PublishingInfo.js | 2 +- app/components/DocumentViews/DocumentViews.js | 2 +- .../DocumentViewers/DocumentViewers.js | 2 +- app/components/DropdownMenu/DropdownMenu.js | 2 +- .../DropdownMenu/DropdownMenuItem.js | 2 +- app/components/Editor/Editor.js | 2 +- .../Toolbar/components/LinkToolbar.js | 2 +- app/components/Flex/index.js | 3 - app/components/Input/Input.js | 2 +- app/components/Labeled/Labeled.js | 2 +- app/components/Layout/Layout.js | 2 +- .../Layout/components/HeaderBlock.js | 2 +- .../Layout/components/SidebarCollections.js | 2 +- .../Layout/components/SidebarLink.js | 2 +- .../LoadingListPlaceholder.js | 4 +- .../LoadingPlaceholder/ListPlaceholder.js | 2 +- .../LoadingPlaceholder/LoadingPlaceholder.js | 2 +- .../LoadingPlaceholder/components/Mask.js | 7 +- app/components/Modal/Modal.js | 2 +- app/index.js | 2 +- app/menus/CollectionMenu.js | 2 +- app/scenes/Collection/Collection.js | 2 +- .../CollectionDelete/CollectionDelete.js | 2 +- app/scenes/CollectionEdit/CollectionEdit.js | 2 +- app/scenes/Dashboard/Dashboard.js | 2 +- app/scenes/Document/Document.js | 2 +- .../components/DocumentMove/DocumentMove.js | 2 +- .../DocumentMove/components/PathToDocument.js | 2 +- .../LoadingPlaceholder/LoadingPlaceholder.js | 4 +- app/scenes/DocumentDelete/DocumentDelete.js | 2 +- .../KeyboardShortcuts/KeyboardShortcuts.js | 2 +- app/scenes/Search/Search.js | 2 +- app/scenes/Search/components/SearchField.js | 2 +- app/scenes/Settings/Settings.js | 2 +- package.json | 1 + server/pages/Home.js | 81 ++++--------------- server/pages/components/Hero.js | 2 +- server/pages/components/Navigation.js | 4 +- .../{SlackSignin.js => SignupButton.js} | 0 server/routes.js | 4 + .../Flex => shared/components}/Flex.js | 2 +- {app/utils => shared}/random.js | 0 yarn.lock | 55 +++++++++++-- 47 files changed, 112 insertions(+), 122 deletions(-) delete mode 100644 app/components/Flex/index.js rename server/pages/components/{SlackSignin.js => SignupButton.js} (100%) rename {app/components/Flex => shared/components}/Flex.js (96%) rename {app/utils => shared}/random.js (100%) 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/app/components/Alert/Alert.js b/app/components/Alert/Alert.js index 4fc1c8db8..c1e11d533 100644 --- a/app/components/Alert/Alert.js +++ b/app/components/Alert/Alert.js @@ -1,7 +1,7 @@ // @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 'shared/styles/constants'; diff --git a/app/components/Collaborators/Collaborators.js b/app/components/Collaborators/Collaborators.js index 746c9ad66..3ae8a24b9 100644 --- a/app/components/Collaborators/Collaborators.js +++ b/app/components/Collaborators/Collaborators.js @@ -3,7 +3,7 @@ import React from 'react'; import moment from 'moment'; import styled from 'styled-components'; import { color } from 'shared/styles/constants'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import Tooltip from 'components/Tooltip'; import Document from 'models/Document'; diff --git a/app/components/Divider/Divider.js b/app/components/Divider/Divider.js index 440ef1d9b..7ce582a5b 100644 --- a/app/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/app/components/DocumentPreview/components/PublishingInfo.js b/app/components/DocumentPreview/components/PublishingInfo.js index bb666240f..dc296c440 100644 --- a/app/components/DocumentPreview/components/PublishingInfo.js +++ b/app/components/DocumentPreview/components/PublishingInfo.js @@ -5,7 +5,7 @@ import styled from 'styled-components'; 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/app/components/DocumentViews/DocumentViews.js b/app/components/DocumentViews/DocumentViews.js index 0ff1b2d16..6a293f8bb 100644 --- a/app/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/app/components/DocumentViews/components/DocumentViewers/DocumentViewers.js b/app/components/DocumentViews/components/DocumentViewers/DocumentViewers.js index e545a8d3c..566657d69 100644 --- a/app/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/app/components/DropdownMenu/DropdownMenu.js b/app/components/DropdownMenu/DropdownMenu.js index e2f2ea74c..e53048333 100644 --- a/app/components/DropdownMenu/DropdownMenu.js +++ b/app/components/DropdownMenu/DropdownMenu.js @@ -5,7 +5,7 @@ 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 Flex from 'shared/components/Flex'; import { color } from 'shared/styles/constants'; import { fadeAndScaleIn } from 'shared/styles/animations'; diff --git a/app/components/DropdownMenu/DropdownMenuItem.js b/app/components/DropdownMenu/DropdownMenuItem.js index bdbe4f2eb..322b909ec 100644 --- a/app/components/DropdownMenu/DropdownMenuItem.js +++ b/app/components/DropdownMenu/DropdownMenuItem.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'; import { color } from 'shared/styles/constants'; const DropdownMenuItem = ({ diff --git a/app/components/Editor/Editor.js b/app/components/Editor/Editor.js index 75ed07f1b..e556841d7 100644 --- a/app/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/app/components/Editor/components/Toolbar/components/LinkToolbar.js b/app/components/Editor/components/Toolbar/components/LinkToolbar.js index c7b38bb24..f85d420bc 100644 --- a/app/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/app/components/Flex/index.js b/app/components/Flex/index.js deleted file mode 100644 index d798e8cd8..000000000 --- a/app/components/Flex/index.js +++ /dev/null @@ -1,3 +0,0 @@ -// @flow -import Flex from './Flex'; -export default Flex; diff --git a/app/components/Input/Input.js b/app/components/Input/Input.js index 7a1f81786..5fbe34106 100644 --- a/app/components/Input/Input.js +++ b/app/components/Input/Input.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'; import { size, color } from 'shared/styles/constants'; const RealTextarea = styled.textarea` diff --git a/app/components/Labeled/Labeled.js b/app/components/Labeled/Labeled.js index 985617cb2..ec9e2f8fe 100644 --- a/app/components/Labeled/Labeled.js +++ b/app/components/Labeled/Labeled.js @@ -1,7 +1,7 @@ // @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 'shared/styles/constants'; diff --git a/app/components/Layout/Layout.js b/app/components/Layout/Layout.js index 8dd96e933..2a5d34b31 100644 --- a/app/components/Layout/Layout.js +++ b/app/components/Layout/Layout.js @@ -5,7 +5,7 @@ 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 Flex from 'shared/components/Flex'; import { color, layout } from 'shared/styles/constants'; import { documentEditUrl, homeUrl, searchUrl } from 'utils/routeHelpers'; diff --git a/app/components/Layout/components/HeaderBlock.js b/app/components/Layout/components/HeaderBlock.js index 1cfb73111..9c80e6f0d 100644 --- a/app/components/Layout/components/HeaderBlock.js +++ b/app/components/Layout/components/HeaderBlock.js @@ -3,7 +3,7 @@ import React from 'react'; import styled from 'styled-components'; 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, diff --git a/app/components/Layout/components/SidebarCollections.js b/app/components/Layout/components/SidebarCollections.js index 2516fdad2..45e9e304e 100644 --- a/app/components/Layout/components/SidebarCollections.js +++ b/app/components/Layout/components/SidebarCollections.js @@ -2,7 +2,7 @@ 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 'shared/styles/constants'; diff --git a/app/components/Layout/components/SidebarLink.js b/app/components/Layout/components/SidebarLink.js index b9fa5fffb..02d8508e8 100644 --- a/app/components/Layout/components/SidebarLink.js +++ b/app/components/Layout/components/SidebarLink.js @@ -5,7 +5,7 @@ import { observer } from 'mobx-react'; import { NavLink } from 'react-router-dom'; 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/app/components/LoadingListPlaceholder/LoadingListPlaceholder.js b/app/components/LoadingListPlaceholder/LoadingListPlaceholder.js index e8c37d4a6..0cb35f467 100644 --- a/app/components/LoadingListPlaceholder/LoadingListPlaceholder.js +++ b/app/components/LoadingListPlaceholder/LoadingListPlaceholder.js @@ -4,9 +4,9 @@ import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; import styled from 'styled-components'; import { pulsate } from 'shared/styles/animations'; import { color } from 'shared/styles/constants'; -import Flex from 'components/Flex'; +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/app/components/LoadingPlaceholder/ListPlaceholder.js b/app/components/LoadingPlaceholder/ListPlaceholder.js index 7fba72172..1eef84884 100644 --- a/app/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/app/components/LoadingPlaceholder/LoadingPlaceholder.js b/app/components/LoadingPlaceholder/LoadingPlaceholder.js index 6f978e247..97d9f1a33 100644 --- a/app/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/app/components/LoadingPlaceholder/components/Mask.js b/app/components/LoadingPlaceholder/components/Mask.js index 82d271b08..61ccd1419 100644 --- a/app/components/LoadingPlaceholder/components/Mask.js +++ b/app/components/LoadingPlaceholder/components/Mask.js @@ -3,8 +3,8 @@ import React, { Component } from 'react'; import styled from 'styled-components'; import { pulsate } from 'shared/styles/animations'; import { color } from 'shared/styles/constants'; -import { randomInteger } from 'utils/random'; -import Flex from 'components/Flex'; +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/app/components/Modal/Modal.js b/app/components/Modal/Modal.js index ff97a141a..abc207002 100644 --- a/app/components/Modal/Modal.js +++ b/app/components/Modal/Modal.js @@ -6,7 +6,7 @@ import ReactModal from 'react-modal'; 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, diff --git a/app/index.js b/app/index.js index 1e7833516..5054d3fc2 100644 --- a/app/index.js +++ b/app/index.js @@ -8,7 +8,7 @@ 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'; diff --git a/app/menus/CollectionMenu.js b/app/menus/CollectionMenu.js index 76c778be0..bc393a6ad 100644 --- a/app/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/app/scenes/Collection/Collection.js b/app/scenes/Collection/Collection.js index f5984c78d..22c84ea12 100644 --- a/app/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/app/scenes/CollectionDelete/CollectionDelete.js b/app/scenes/CollectionDelete/CollectionDelete.js index 31573e900..a79359751 100644 --- a/app/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/app/scenes/CollectionEdit/CollectionEdit.js b/app/scenes/CollectionEdit/CollectionEdit.js index 8cb2401e3..17fc570b8 100644 --- a/app/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/app/scenes/Dashboard/Dashboard.js b/app/scenes/Dashboard/Dashboard.js index dbbc805c6..95278492d 100644 --- a/app/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/app/scenes/Document/Document.js b/app/scenes/Document/Document.js index 517c2defe..e0a8aa721 100644 --- a/app/scenes/Document/Document.js +++ b/app/scenes/Document/Document.js @@ -6,7 +6,7 @@ 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 Flex from 'shared/components/Flex'; import { color, layout } from 'shared/styles/constants'; import { collectionUrl, diff --git a/app/scenes/Document/components/DocumentMove/DocumentMove.js b/app/scenes/Document/components/DocumentMove/DocumentMove.js index 55dae6bdd..23adcad30 100644 --- a/app/scenes/Document/components/DocumentMove/DocumentMove.js +++ b/app/scenes/Document/components/DocumentMove/DocumentMove.js @@ -13,7 +13,7 @@ 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/app/scenes/Document/components/DocumentMove/components/PathToDocument.js b/app/scenes/Document/components/DocumentMove/components/PathToDocument.js index 5868596a7..bda84a9c1 100644 --- a/app/scenes/Document/components/DocumentMove/components/PathToDocument.js +++ b/app/scenes/Document/components/DocumentMove/components/PathToDocument.js @@ -6,7 +6,7 @@ import _ from 'lodash'; import styled from 'styled-components'; 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/app/scenes/Document/components/LoadingPlaceholder/LoadingPlaceholder.js b/app/scenes/Document/components/LoadingPlaceholder/LoadingPlaceholder.js index 21c019a8d..5930c7eaf 100644 --- a/app/scenes/Document/components/LoadingPlaceholder/LoadingPlaceholder.js +++ b/app/scenes/Document/components/LoadingPlaceholder/LoadingPlaceholder.js @@ -4,9 +4,9 @@ import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; import styled from 'styled-components'; import { pulsate } from 'shared/styles/animations'; import { color } from 'shared/styles/constants'; -import Flex from 'components/Flex'; +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/app/scenes/DocumentDelete/DocumentDelete.js b/app/scenes/DocumentDelete/DocumentDelete.js index 2e3896903..e6d92383b 100644 --- a/app/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/app/scenes/KeyboardShortcuts/KeyboardShortcuts.js b/app/scenes/KeyboardShortcuts/KeyboardShortcuts.js index afb42649b..f07928318 100644 --- a/app/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/app/scenes/Search/Search.js b/app/scenes/Search/Search.js index 9050d0564..1000d18f7 100644 --- a/app/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/app/scenes/Search/components/SearchField.js b/app/scenes/Search/components/SearchField.js index eeffe9a28..466bcb437 100644 --- a/app/scenes/Search/components/SearchField.js +++ b/app/scenes/Search/components/SearchField.js @@ -1,7 +1,7 @@ // @flow import React, { Component } from 'react'; import SearchIcon from 'components/Icon/SearchIcon'; -import Flex from 'components/Flex'; +import Flex from 'shared/components/Flex'; import { color } from 'shared/styles/constants'; import styled from 'styled-components'; diff --git a/app/scenes/Settings/Settings.js b/app/scenes/Settings/Settings.js index a0c792979..7b3a02280 100644 --- a/app/scenes/Settings/Settings.js +++ b/app/scenes/Settings/Settings.js @@ -7,7 +7,7 @@ import ApiKeyRow from './components/ApiKeyRow'; import SettingsStore from './SettingsStore'; 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/package.json b/package.json index bab052ba1..1971c3794 100644 --- a/package.json +++ b/package.json @@ -121,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", diff --git a/server/pages/Home.js b/server/pages/Home.js index f29548c24..6500ba268 100644 --- a/server/pages/Home.js +++ b/server/pages/Home.js @@ -3,79 +3,26 @@ import React from 'react'; import styled from 'styled-components'; import Grid from 'styled-components-grid'; import Hero from './components/Hero'; -import SlackSignin from './components/SlackSignin'; -import { color } from '../../shared/styles/constants'; - -const Unit = Grid.Unit; +import SignupButton from './components/SignupButton'; function Home() { return ( - - -

Your team’s knowledge base

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

- -

-
- - -

Blazing Fast

-

- Atlas is fast, really fast. We’ve trimmed 100ms and 50ms there to make sure that documents load instantly, search is speedy and there are keyboard shortcuts for everything. -

-
- - -

Markdown Support

-

- Documents are stored in Markdown and you can export them at any time. Markdown shortcuts are also built right into the editor so you can easily format using markdown syntax or our GUI. -

-
- - - - -

Beautiful Editor

-

- We built a custom editor that’s a joy to use. Whether you’re typing up quick meeting notes or documenting a full API the interface gets out of your way and lets you focus on the content. -

-
- - -

Powerful Search

-

- Built-in search makes that one document easy to find in a large knowledgebase. -

-
- -

API & Integrations

-

- Atlas is built on it’s own API, treat Atlas as a CMS or automatically create documents from outside events. -

-
- -

Open Source

-

- Want to contribute or host Atlas yourself? All of the code is available on GitHub. -

-
-
+ + + +

Your team’s knowledge base

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

+ +

+
+
+
); } -const Feature = styled(Unit)` - padding: 3em; - padding: 80px; - background: ${color.smoke} -`; - -const MiniFeature = styled(Unit)` - padding: 80px 40px; -`; - const HeroText = styled.p` font-size: 18px; max-width: 600px; diff --git a/server/pages/components/Hero.js b/server/pages/components/Hero.js index 381bfef88..f597c92a2 100644 --- a/server/pages/components/Hero.js +++ b/server/pages/components/Hero.js @@ -3,7 +3,7 @@ import styled from 'styled-components'; const Hero = styled.div` width: 100%; - padding: 4em 3em; + padding: 6em 2em 8em; text-align: center; h1 { diff --git a/server/pages/components/Navigation.js b/server/pages/components/Navigation.js index 6626c3836..0ff578067 100644 --- a/server/pages/components/Navigation.js +++ b/server/pages/components/Navigation.js @@ -8,8 +8,6 @@ function Navigation() { @@ -18,7 +16,7 @@ function Navigation() { const Nav = styled.nav` display: flex; - padding: 20px; + padding: 20px 30px; justify-content: space-between; `; diff --git a/server/pages/components/SlackSignin.js b/server/pages/components/SignupButton.js similarity index 100% rename from server/pages/components/SlackSignin.js rename to server/pages/components/SignupButton.js diff --git a/server/routes.js b/server/routes.js index 2f88a4b20..3edbf4bea 100644 --- a/server/routes.js +++ b/server/routes.js @@ -5,6 +5,7 @@ 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'; @@ -24,6 +25,9 @@ const renderapp = async ctx => { } }; +// serve static assets +koa.use(serve(path.resolve(__dirname, '../public'))); + router.get('/_health', ctx => (ctx.body = 'OK')); if (process.env.NODE_ENV === 'production') { diff --git a/app/components/Flex/Flex.js b/shared/components/Flex.js similarity index 96% rename from app/components/Flex/Flex.js rename to shared/components/Flex.js index d14c0ce15..3b420fafb 100644 --- a/app/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/app/utils/random.js b/shared/random.js similarity index 100% rename from app/utils/random.js rename to shared/random.js diff --git a/yarn.lock b/yarn.lock index f5accbea0..1f83c0d29 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4006,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" @@ -4013,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: @@ -5114,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" @@ -5122,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" @@ -6009,6 +6033,14 @@ mz@2: object-assign "^4.0.1" thenify-all "^1.0.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" @@ -6624,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" @@ -7737,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" @@ -7994,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"