From 29a25c28a8de03301312bfbc1a5a9e1fec6a1f0d Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Sat, 14 Oct 2017 12:31:20 -0400 Subject: [PATCH] distinguish between route components and reusable components --- frontend/src/Metamaps/GlobalUI/ImportDialog.js | 2 +- frontend/src/Metamaps/GlobalUI/ReactApp.js | 2 +- frontend/src/components/{App => }/AccountMenu.js | 0 frontend/src/components/{common => }/ContextMenu.js | 2 +- frontend/src/components/{common => }/DataVis.js | 0 frontend/src/components/{common => }/FilterBox.js | 0 frontend/src/components/{common => }/InfoAndHelp.js | 2 +- frontend/src/components/{App => }/LoginForm.js | 0 frontend/src/components/{App => }/MobileHeader.js | 2 +- frontend/src/components/{App => }/NavBar.js | 0 frontend/src/components/{App => }/NavBarLink.js | 0 frontend/src/components/{App => }/NotificationBox.js | 4 ++-- .../src/components/{App => }/NotificationIcon.js | 0 frontend/src/components/{common => }/Sprite.js | 0 frontend/src/components/{App => }/Toast.js | 0 frontend/src/components/{App => }/UpperLeftUI.js | 0 frontend/src/components/{common => }/UpperOptions.js | 2 +- frontend/src/components/{App => }/UpperRightUI.js | 0 .../components/{common => }/VisualizationControls.js | 0 .../src/{components/App/index.js => routes/App.js} | 8 ++++---- .../src/{components/Apps/index.js => routes/Apps.js} | 4 ++-- .../MapView/ImportDialogBox.js | 0 .../{components => routes}/MapView/Instructions.js | 0 .../MapView/MapChat/Message.js | 0 .../MapView/MapChat/NewMessage.js | 0 .../MapView/MapChat/Participant.js | 0 .../{components => routes}/MapView/MapChat/Unread.js | 0 .../{components => routes}/MapView/MapChat/index.js | 0 .../src/{components => routes}/MapView/MapInfoBox.js | 0 frontend/src/{components => routes}/MapView/index.js | 12 ++++++------ frontend/src/{components => routes}/Maps/Header.js | 4 ++-- frontend/src/{components => routes}/Maps/MapCard.js | 0 .../src/{components => routes}/Maps/MapperCard.js | 0 frontend/src/{components => routes}/Maps/index.js | 0 .../index.js => routes/Notifications.js} | 4 ++-- .../TopicView/index.js => routes/TopicView.js} | 12 ++++++------ frontend/src/{components => routes}/makeRoutes.js | 0 37 files changed, 30 insertions(+), 30 deletions(-) rename frontend/src/components/{App => }/AccountMenu.js (100%) rename frontend/src/components/{common => }/ContextMenu.js (99%) rename frontend/src/components/{common => }/DataVis.js (100%) rename frontend/src/components/{common => }/FilterBox.js (100%) rename frontend/src/components/{common => }/InfoAndHelp.js (96%) rename frontend/src/components/{App => }/LoginForm.js (100%) rename frontend/src/components/{App => }/MobileHeader.js (99%) rename frontend/src/components/{App => }/NavBar.js (100%) rename frontend/src/components/{App => }/NavBarLink.js (100%) rename frontend/src/components/{App => }/NotificationBox.js (96%) rename frontend/src/components/{App => }/NotificationIcon.js (100%) rename frontend/src/components/{common => }/Sprite.js (100%) rename frontend/src/components/{App => }/Toast.js (100%) rename frontend/src/components/{App => }/UpperLeftUI.js (100%) rename frontend/src/components/{common => }/UpperOptions.js (98%) rename frontend/src/components/{App => }/UpperRightUI.js (100%) rename frontend/src/components/{common => }/VisualizationControls.js (100%) rename frontend/src/{components/App/index.js => routes/App.js} (94%) rename frontend/src/{components/Apps/index.js => routes/Apps.js} (87%) rename frontend/src/{components => routes}/MapView/ImportDialogBox.js (100%) rename frontend/src/{components => routes}/MapView/Instructions.js (100%) rename frontend/src/{components => routes}/MapView/MapChat/Message.js (100%) rename frontend/src/{components => routes}/MapView/MapChat/NewMessage.js (100%) rename frontend/src/{components => routes}/MapView/MapChat/Participant.js (100%) rename frontend/src/{components => routes}/MapView/MapChat/Unread.js (100%) rename frontend/src/{components => routes}/MapView/MapChat/index.js (100%) rename frontend/src/{components => routes}/MapView/MapInfoBox.js (100%) rename frontend/src/{components => routes}/MapView/index.js (92%) rename frontend/src/{components => routes}/Maps/Header.js (94%) rename frontend/src/{components => routes}/Maps/MapCard.js (100%) rename frontend/src/{components => routes}/Maps/MapperCard.js (100%) rename frontend/src/{components => routes}/Maps/index.js (100%) rename frontend/src/{components/Notifications/index.js => routes/Notifications.js} (80%) rename frontend/src/{components/TopicView/index.js => routes/TopicView.js} (89%) rename frontend/src/{components => routes}/makeRoutes.js (100%) diff --git a/frontend/src/Metamaps/GlobalUI/ImportDialog.js b/frontend/src/Metamaps/GlobalUI/ImportDialog.js index 63c47491..c253512d 100644 --- a/frontend/src/Metamaps/GlobalUI/ImportDialog.js +++ b/frontend/src/Metamaps/GlobalUI/ImportDialog.js @@ -4,7 +4,7 @@ import React from 'react' import ReactDOM from 'react-dom' import outdent from 'outdent' -import ImportDialogBox from '../../components/MapView/ImportDialogBox' +import ImportDialogBox from '../../routes/MapView/ImportDialogBox' import PasteInput from '../PasteInput' import Map from '../Map' diff --git a/frontend/src/Metamaps/GlobalUI/ReactApp.js b/frontend/src/Metamaps/GlobalUI/ReactApp.js index caa483d2..6237f08a 100644 --- a/frontend/src/Metamaps/GlobalUI/ReactApp.js +++ b/frontend/src/Metamaps/GlobalUI/ReactApp.js @@ -18,7 +18,7 @@ import Realtime from '../Realtime' import Map, { InfoBox } from '../Map' import Topic from '../Topic' import Visualize from '../Visualize' -import makeRoutes from '../../components/makeRoutes' +import makeRoutes from '../../routes/makeRoutes' let routes // 220 wide + 16 padding on both sides diff --git a/frontend/src/components/App/AccountMenu.js b/frontend/src/components/AccountMenu.js similarity index 100% rename from frontend/src/components/App/AccountMenu.js rename to frontend/src/components/AccountMenu.js diff --git a/frontend/src/components/common/ContextMenu.js b/frontend/src/components/ContextMenu.js similarity index 99% rename from frontend/src/components/common/ContextMenu.js rename to frontend/src/components/ContextMenu.js index e3649e5d..35ea0ee8 100644 --- a/frontend/src/components/common/ContextMenu.js +++ b/frontend/src/components/ContextMenu.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import MetacodeSelect from '../MetacodeSelect' +import MetacodeSelect from './MetacodeSelect' class ContextMenu extends Component { static propTypes = { diff --git a/frontend/src/components/common/DataVis.js b/frontend/src/components/DataVis.js similarity index 100% rename from frontend/src/components/common/DataVis.js rename to frontend/src/components/DataVis.js diff --git a/frontend/src/components/common/FilterBox.js b/frontend/src/components/FilterBox.js similarity index 100% rename from frontend/src/components/common/FilterBox.js rename to frontend/src/components/FilterBox.js diff --git a/frontend/src/components/common/InfoAndHelp.js b/frontend/src/components/InfoAndHelp.js similarity index 96% rename from frontend/src/components/common/InfoAndHelp.js rename to frontend/src/components/InfoAndHelp.js index 8a4edf25..e6bc01d8 100644 --- a/frontend/src/components/common/InfoAndHelp.js +++ b/frontend/src/components/InfoAndHelp.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import MapInfoBox from '../MapView/MapInfoBox' +import MapInfoBox from '../routes/MapView/MapInfoBox' class InfoAndHelp extends Component { static propTypes = { diff --git a/frontend/src/components/App/LoginForm.js b/frontend/src/components/LoginForm.js similarity index 100% rename from frontend/src/components/App/LoginForm.js rename to frontend/src/components/LoginForm.js diff --git a/frontend/src/components/App/MobileHeader.js b/frontend/src/components/MobileHeader.js similarity index 99% rename from frontend/src/components/App/MobileHeader.js rename to frontend/src/components/MobileHeader.js index a9acce37..dd27c2a7 100644 --- a/frontend/src/components/App/MobileHeader.js +++ b/frontend/src/components/MobileHeader.js @@ -2,7 +2,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import { Link } from 'react-router' -import Sprite from '../common/Sprite' +import Sprite from './Sprite' class MobileHeader extends Component { static propTypes = { diff --git a/frontend/src/components/App/NavBar.js b/frontend/src/components/NavBar.js similarity index 100% rename from frontend/src/components/App/NavBar.js rename to frontend/src/components/NavBar.js diff --git a/frontend/src/components/App/NavBarLink.js b/frontend/src/components/NavBarLink.js similarity index 100% rename from frontend/src/components/App/NavBarLink.js rename to frontend/src/components/NavBarLink.js diff --git a/frontend/src/components/App/NotificationBox.js b/frontend/src/components/NotificationBox.js similarity index 96% rename from frontend/src/components/App/NotificationBox.js rename to frontend/src/components/NotificationBox.js index f5f0b801..bfd5f409 100644 --- a/frontend/src/components/App/NotificationBox.js +++ b/frontend/src/components/NotificationBox.js @@ -2,8 +2,8 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import onClickOutsideAddon from 'react-onclickoutside' -import Notification from '../Notification' -import Loading from '../Loading' +import Notification from './Notification' +import Loading from './Loading' class NotificationBox extends Component { static propTypes = { diff --git a/frontend/src/components/App/NotificationIcon.js b/frontend/src/components/NotificationIcon.js similarity index 100% rename from frontend/src/components/App/NotificationIcon.js rename to frontend/src/components/NotificationIcon.js diff --git a/frontend/src/components/common/Sprite.js b/frontend/src/components/Sprite.js similarity index 100% rename from frontend/src/components/common/Sprite.js rename to frontend/src/components/Sprite.js diff --git a/frontend/src/components/App/Toast.js b/frontend/src/components/Toast.js similarity index 100% rename from frontend/src/components/App/Toast.js rename to frontend/src/components/Toast.js diff --git a/frontend/src/components/App/UpperLeftUI.js b/frontend/src/components/UpperLeftUI.js similarity index 100% rename from frontend/src/components/App/UpperLeftUI.js rename to frontend/src/components/UpperLeftUI.js diff --git a/frontend/src/components/common/UpperOptions.js b/frontend/src/components/UpperOptions.js similarity index 98% rename from frontend/src/components/common/UpperOptions.js rename to frontend/src/components/UpperOptions.js index 5108eab3..26cde8bf 100644 --- a/frontend/src/components/common/UpperOptions.js +++ b/frontend/src/components/UpperOptions.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import FilterBox from '../common/FilterBox' +import FilterBox from './FilterBox' export default class UpperOptions extends Component { static propTypes = { diff --git a/frontend/src/components/App/UpperRightUI.js b/frontend/src/components/UpperRightUI.js similarity index 100% rename from frontend/src/components/App/UpperRightUI.js rename to frontend/src/components/UpperRightUI.js diff --git a/frontend/src/components/common/VisualizationControls.js b/frontend/src/components/VisualizationControls.js similarity index 100% rename from frontend/src/components/common/VisualizationControls.js rename to frontend/src/components/VisualizationControls.js diff --git a/frontend/src/components/App/index.js b/frontend/src/routes/App.js similarity index 94% rename from frontend/src/components/App/index.js rename to frontend/src/routes/App.js index 9a830255..79ad3335 100644 --- a/frontend/src/components/App/index.js +++ b/frontend/src/routes/App.js @@ -1,10 +1,10 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import MobileHeader from './MobileHeader' -import UpperLeftUI from './UpperLeftUI' -import UpperRightUI from './UpperRightUI' -import Toast from './Toast' +import MobileHeader from '../components/MobileHeader' +import UpperLeftUI from '../components/UpperLeftUI' +import UpperRightUI from '../components/UpperRightUI' +import Toast from '../components/Toast' class App extends Component { static propTypes = { diff --git a/frontend/src/components/Apps/index.js b/frontend/src/routes/Apps.js similarity index 87% rename from frontend/src/components/Apps/index.js rename to frontend/src/routes/Apps.js index 1fc5ffe3..94c7e32d 100644 --- a/frontend/src/components/Apps/index.js +++ b/frontend/src/routes/Apps.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import NavBar from '../App/Navbar' -import NavBarLink from '../App/NavBarLink' +import NavBar from '../components/Navbar' +import NavBarLink from '../components/NavBarLink' class Apps extends Component { render = () => { diff --git a/frontend/src/components/MapView/ImportDialogBox.js b/frontend/src/routes/MapView/ImportDialogBox.js similarity index 100% rename from frontend/src/components/MapView/ImportDialogBox.js rename to frontend/src/routes/MapView/ImportDialogBox.js diff --git a/frontend/src/components/MapView/Instructions.js b/frontend/src/routes/MapView/Instructions.js similarity index 100% rename from frontend/src/components/MapView/Instructions.js rename to frontend/src/routes/MapView/Instructions.js diff --git a/frontend/src/components/MapView/MapChat/Message.js b/frontend/src/routes/MapView/MapChat/Message.js similarity index 100% rename from frontend/src/components/MapView/MapChat/Message.js rename to frontend/src/routes/MapView/MapChat/Message.js diff --git a/frontend/src/components/MapView/MapChat/NewMessage.js b/frontend/src/routes/MapView/MapChat/NewMessage.js similarity index 100% rename from frontend/src/components/MapView/MapChat/NewMessage.js rename to frontend/src/routes/MapView/MapChat/NewMessage.js diff --git a/frontend/src/components/MapView/MapChat/Participant.js b/frontend/src/routes/MapView/MapChat/Participant.js similarity index 100% rename from frontend/src/components/MapView/MapChat/Participant.js rename to frontend/src/routes/MapView/MapChat/Participant.js diff --git a/frontend/src/components/MapView/MapChat/Unread.js b/frontend/src/routes/MapView/MapChat/Unread.js similarity index 100% rename from frontend/src/components/MapView/MapChat/Unread.js rename to frontend/src/routes/MapView/MapChat/Unread.js diff --git a/frontend/src/components/MapView/MapChat/index.js b/frontend/src/routes/MapView/MapChat/index.js similarity index 100% rename from frontend/src/components/MapView/MapChat/index.js rename to frontend/src/routes/MapView/MapChat/index.js diff --git a/frontend/src/components/MapView/MapInfoBox.js b/frontend/src/routes/MapView/MapInfoBox.js similarity index 100% rename from frontend/src/components/MapView/MapInfoBox.js rename to frontend/src/routes/MapView/MapInfoBox.js diff --git a/frontend/src/components/MapView/index.js b/frontend/src/routes/MapView/index.js similarity index 92% rename from frontend/src/components/MapView/index.js rename to frontend/src/routes/MapView/index.js index d2cc90fd..027b395d 100644 --- a/frontend/src/components/MapView/index.js +++ b/frontend/src/routes/MapView/index.js @@ -1,14 +1,14 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import ContextMenu from '../common/ContextMenu' -import DataVis from '../common/DataVis' -import UpperOptions from '../common/UpperOptions' -import InfoAndHelp from '../common/InfoAndHelp' +import ContextMenu from '../../components/ContextMenu' +import DataVis from '../../components/DataVis' +import UpperOptions from '../../components/UpperOptions' +import InfoAndHelp from '../../components/InfoAndHelp' import Instructions from './Instructions' -import VisualizationControls from '../common/VisualizationControls' +import VisualizationControls from '../../components/VisualizationControls' import MapChat from './MapChat' -import TopicCard from '../TopicCard' +import TopicCard from '../../components/TopicCard' export default class MapView extends Component { diff --git a/frontend/src/components/Maps/Header.js b/frontend/src/routes/Maps/Header.js similarity index 94% rename from frontend/src/components/Maps/Header.js rename to frontend/src/routes/Maps/Header.js index 770c0efb..931cb54f 100644 --- a/frontend/src/components/Maps/Header.js +++ b/frontend/src/routes/Maps/Header.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import NavBar from '../App/Navbar' -import NavBarLink from '../App/NavBarLink' +import NavBar from '../../components/Navbar' +import NavBarLink from '../../components/NavBarLink' class Header extends Component { render = () => { diff --git a/frontend/src/components/Maps/MapCard.js b/frontend/src/routes/Maps/MapCard.js similarity index 100% rename from frontend/src/components/Maps/MapCard.js rename to frontend/src/routes/Maps/MapCard.js diff --git a/frontend/src/components/Maps/MapperCard.js b/frontend/src/routes/Maps/MapperCard.js similarity index 100% rename from frontend/src/components/Maps/MapperCard.js rename to frontend/src/routes/Maps/MapperCard.js diff --git a/frontend/src/components/Maps/index.js b/frontend/src/routes/Maps/index.js similarity index 100% rename from frontend/src/components/Maps/index.js rename to frontend/src/routes/Maps/index.js diff --git a/frontend/src/components/Notifications/index.js b/frontend/src/routes/Notifications.js similarity index 80% rename from frontend/src/components/Notifications/index.js rename to frontend/src/routes/Notifications.js index a744e0c3..2814b33a 100644 --- a/frontend/src/components/Notifications/index.js +++ b/frontend/src/routes/Notifications.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' -import NavBar from '../App/Navbar' -import NavBarLink from '../App/NavBarLink' +import NavBar from '../components/Navbar' +import NavBarLink from '../components/NavBarLink' class Notifications extends Component { render = () => { diff --git a/frontend/src/components/TopicView/index.js b/frontend/src/routes/TopicView.js similarity index 89% rename from frontend/src/components/TopicView/index.js rename to frontend/src/routes/TopicView.js index 12d494b2..cc8e54ca 100644 --- a/frontend/src/components/TopicView/index.js +++ b/frontend/src/routes/TopicView.js @@ -1,12 +1,12 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import ContextMenu from '../common/ContextMenu' -import DataVis from '../common/DataVis' -import UpperOptions from '../common/UpperOptions' -import InfoAndHelp from '../common/InfoAndHelp' -import VisualizationControls from '../common/VisualizationControls' -import TopicCard from '../TopicCard' +import ContextMenu from '../components/ContextMenu' +import DataVis from '../components/DataVis' +import UpperOptions from '../components/UpperOptions' +import InfoAndHelp from '../components/InfoAndHelp' +import VisualizationControls from '../components/VisualizationControls' +import TopicCard from '../components/TopicCard' export default class TopicView extends Component { diff --git a/frontend/src/components/makeRoutes.js b/frontend/src/routes/makeRoutes.js similarity index 100% rename from frontend/src/components/makeRoutes.js rename to frontend/src/routes/makeRoutes.js