diff --git a/frontend/components/Editor/Editor.js b/frontend/components/Editor/Editor.js index 2e95eed0..dc0e0e6d 100644 --- a/frontend/components/Editor/Editor.js +++ b/frontend/components/Editor/Editor.js @@ -204,8 +204,10 @@ type KeyData = { onSave={this.props.onSave} readOnly={this.props.readOnly} /> - {!this.props.readOnly && - } + ); @@ -225,6 +227,7 @@ const HeaderContainer = styled(Flex).attrs({ align: 'flex-end', })` height: 100px; + flex-shrink: 0; ${({ readOnly }) => !readOnly && 'cursor: text;'} `; diff --git a/frontend/components/Editor/components/ClickablePadding/ClickablePadding.js b/frontend/components/Editor/components/ClickablePadding/ClickablePadding.js index 970d0619..81e2b5f1 100644 --- a/frontend/components/Editor/components/ClickablePadding/ClickablePadding.js +++ b/frontend/components/Editor/components/ClickablePadding/ClickablePadding.js @@ -1,20 +1,22 @@ // @flow import React from 'react'; -import classnames from 'classnames'; -import styles from './ClickablePadding.scss'; +import styled from 'styled-components'; type Props = { - onClick: Function, + onClick?: ?Function, grow?: boolean, }; const ClickablePadding = (props: Props) => { - return ( -
- ); + return ; }; +const Container = styled.div` + min-height: 150px; + padding-top: 50px; + cursor: ${({ onClick }) => (onClick ? 'text' : 'default')}; + + ${({ grow }) => grow && `flex-grow: 1;`} +`; + export default ClickablePadding; diff --git a/frontend/components/Editor/components/ClickablePadding/ClickablePadding.scss b/frontend/components/Editor/components/ClickablePadding/ClickablePadding.scss deleted file mode 100644 index cac8ee5a..00000000 --- a/frontend/components/Editor/components/ClickablePadding/ClickablePadding.scss +++ /dev/null @@ -1,15 +0,0 @@ -.container { - min-height: 150px; - padding-top: 50px; - cursor: text; -} - -.grow { - flex-grow: 1; -} - -@media all and (max-width: 960px) { - .container { - padding-top: 50px; - } -} diff --git a/frontend/components/Layout/Layout.js b/frontend/components/Layout/Layout.js index 001d4d96..3aace8a7 100644 --- a/frontend/components/Layout/Layout.js +++ b/frontend/components/Layout/Layout.js @@ -14,11 +14,12 @@ import { documentEditUrl, homeUrl, searchUrl } from 'utils/routeHelpers'; import { DropdownMenu, DropdownMenuItem } from 'components/DropdownMenu'; import { LoadingIndicatorBar } from 'components/LoadingIndicator'; import Scrollable from 'components/Scrollable'; -import KeyboardShortcuts from 'components/KeyboardShortcuts'; import Avatar from 'components/Avatar'; import Modal from 'components/Modal'; import AddIcon from 'components/Icon/AddIcon'; import CollectionNew from 'scenes/CollectionNew'; +import KeyboardShortcuts from 'scenes/KeyboardShortcuts'; +import Settings from 'scenes/Settings'; import SidebarCollection from './components/SidebarCollection'; import SidebarCollectionList from './components/SidebarCollectionList'; @@ -78,6 +79,10 @@ type Props = { this.modal = 'keyboard-shortcuts'; } + handleOpenSettings = () => { + this.modal = 'settings'; + }; + handleCreateCollection = () => { this.modal = 'create-collection'; }; @@ -114,9 +119,9 @@ type Props = { Atlas }> - - Settings - + + Settings + Keyboard shortcuts @@ -176,6 +181,13 @@ type Props = { > + + + ); } diff --git a/frontend/index.js b/frontend/index.js index 371019ac..9fc006ef 100644 --- a/frontend/index.js +++ b/frontend/index.js @@ -28,7 +28,6 @@ import Starred from 'scenes/Starred'; import Collection from 'scenes/Collection'; import Document from 'scenes/Document'; import Search from 'scenes/Search'; -import Settings from 'scenes/Settings'; import SlackAuth from 'scenes/SlackAuth'; import Flatpage from 'scenes/Flatpage'; import ErrorAuth from 'scenes/ErrorAuth'; @@ -126,7 +125,7 @@ render( - + @@ -140,9 +139,6 @@ render( path="/collections/:id/new" component={DocumentNew} /> - - - diff --git a/frontend/components/KeyboardShortcuts/KeyboardShortcuts.js b/frontend/scenes/KeyboardShortcuts/KeyboardShortcuts.js similarity index 100% rename from frontend/components/KeyboardShortcuts/KeyboardShortcuts.js rename to frontend/scenes/KeyboardShortcuts/KeyboardShortcuts.js diff --git a/frontend/components/KeyboardShortcuts/index.js b/frontend/scenes/KeyboardShortcuts/index.js similarity index 100% rename from frontend/components/KeyboardShortcuts/index.js rename to frontend/scenes/KeyboardShortcuts/index.js diff --git a/frontend/scenes/Settings/Settings.js b/frontend/scenes/Settings/Settings.js index 38204d7e..82b1803c 100644 --- a/frontend/scenes/Settings/Settings.js +++ b/frontend/scenes/Settings/Settings.js @@ -1,17 +1,17 @@ // @flow import React from 'react'; import { observer } from 'mobx-react'; -import Flex from 'components/Flex'; - +import { Link } from 'react-router-dom'; +import styled from 'styled-components'; import ApiKeyRow from './components/ApiKeyRow'; -import styles from './Settings.scss'; import SettingsStore from './SettingsStore'; +import { color } from 'styles/constants'; +import Flex from 'components/Flex'; import Button from 'components/Button'; import Input from 'components/Input'; -import CenteredContent from 'components/CenteredContent'; +import HelpText from 'components/HelpText'; import SlackAuthLink from 'components/SlackAuthLink'; -import PageTitle from 'components/PageTitle'; @observer class Settings extends React.Component { store: SettingsStore; @@ -25,15 +25,14 @@ import PageTitle from 'components/PageTitle'; const showSlackSettings = DEPLOYMENT === 'hosted'; return ( - - + {showSlackSettings && -
-

Slack

-

+

+

Slack

+ Connect Atlas to your Slack to instantly search for your documents using /atlas command. -

+
-
} + } -
-

API access

-

+

+

API access

+ Create API tokens to hack on your Atlas. - Learn more in API documentation. -

+ Learn more in API documentation. +
{this.store.apiKeys && - +
{this.store.apiKeys && this.store.apiKeys.map(key => ( @@ -70,21 +69,18 @@ import PageTitle from 'components/PageTitle'; /> ))} -
} - -
- -
-
-
+ } + + + ); } } @@ -148,4 +144,18 @@ class InlineForm extends React.Component { } } +const Section = styled.div` + margin-bottom: 40px; +`; + +const Table = styled.table` + margin-bottom: 20px; + width: 100%; + + td { + margin-right: 20px; + color: ${color.slate}; + } +`; + export default Settings; diff --git a/frontend/scenes/Settings/Settings.scss b/frontend/scenes/Settings/Settings.scss deleted file mode 100644 index 20a48ff8..00000000 --- a/frontend/scenes/Settings/Settings.scss +++ /dev/null @@ -1,19 +0,0 @@ -@import '~styles/constants.scss'; - -.section { - margin-bottom: 40px; -} - -.sectionHeader { - border-bottom: 1px solid #eee; -} - -.apiKeyTable { - margin-bottom: 20px; - width: 100%; - - td { - margin-right: 20px; - color: #969696; - } -} diff --git a/package.json b/package.json index 98c1f5b9..52833a1b 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,9 @@ "build": "npm run clean && npm run build:webpack", "start": "node index.js", "dev": "NODE_ENV=development DEBUG=sql,cache,presenters ./node_modules/.bin/nodemon --watch server index.js", - "lint": "npm run lint:js && npm run lint:flow", + "lint": "npm run lint:flow && npm run lint:js", "lint:js": "eslint frontend", - "lint:flow": "flow check", + "lint:flow": "flow", "deploy": "git push heroku master", "heroku-postbuild": "npm run build && npm run sequelize:migrate", "sequelize:create-migration": "sequelize migration:create", @@ -22,35 +22,19 @@ "precommit": "lint-staged" }, "lint-staged": { - "*.js": [ - "eslint --fix", - "git add" - ] + "*.js": ["eslint --fix", "git add"] }, "jest": { "verbose": false, - "roots": [ - "frontend" - ], + "roots": ["frontend"], "moduleNameMapper": { "^.*[.](s?css|css)$": "/__mocks__/styleMock.js", "^.*[.](gif|ttf|eot|svg)$": "/__test__/fileMock.js" }, - "moduleFileExtensions": [ - "js", - "jsx", - "json" - ], - "moduleDirectories": [ - "node_modules" - ], - "modulePaths": [ - "frontend" - ], - "setupFiles": [ - "/setupJest.js", - "/__mocks__/window.js" - ] + "moduleFileExtensions": ["js", "jsx", "json"], + "moduleDirectories": ["node_modules"], + "modulePaths": ["frontend"], + "setupFiles": ["/setupJest.js", "/__mocks__/window.js"] }, "engines": { "node": ">= 7.6"