From a2967353b0e906bede52993cc4e71cfe4812cf9b Mon Sep 17 00:00:00 2001 From: Stephen Sprinkle Date: Thu, 20 Oct 2016 15:33:56 -0600 Subject: [PATCH] utilization of path aliases in all relevant components --- docs/conventions.md | 5 +++-- src/modules/app/components/header.jsx | 5 +++-- src/modules/common/components/tab-navigation.jsx | 1 + .../create-market/components/create-market-form-4.jsx | 3 ++- src/modules/market/components/market-basics.jsx | 1 + src/modules/market/components/market-open-orders.jsx | 5 +++-- src/modules/market/components/market-preview.jsx | 1 + src/modules/markets/components/markets-filter-sort.jsx | 1 + src/modules/markets/components/markets-view.jsx | 3 ++- src/modules/portfolio/components/portfolio-page.jsx | 4 +++- src/modules/portfolio/components/portfolio-view.jsx | 4 +++- 11 files changed, 23 insertions(+), 10 deletions(-) diff --git a/docs/conventions.md b/docs/conventions.md index e57eb955..e9795d7a 100644 --- a/docs/conventions.md +++ b/docs/conventions.md @@ -15,10 +15,12 @@ To help ensure this, the following conventions have been employed: * Do leave comments for functionality that may be non-obvious * Dependence on other methods, complex mutations/filters, etc. * Font Awesome characters are used directly in the components -- in order to render these inside your text editors/IDEs, reference the [typography](../src/modules/common/less/typography.less) stylesheet. -* Import paths for `assets`, `modules`, `utils`, and `src` are aliased, so avoid the use of relative paths. +* Import paths for `assets`, `modules`, and `utils` are aliased, so avoid relative paths. + * Always traverse from the aliases. * Null component states (ex: 'no markets', 'no tags', etc.) should always come first in the component. * Conditional display should occur as far down the component tree as possible. * Props that are being passed to a component should be explicit from both ends +* TODO -- convention re: import order ### Other Conventions Not all conventions are detailed above, but rather just the main points. @@ -28,7 +30,6 @@ For a full review of the breadth of the conventions employed, reference: * `.editorconfig` - Editor focused rules to keep coding styles consistent * Optional and primarily for convenience, but the linting enforces many of these conventions - ## Styles All styles should be contextual such that styling rules are only directly applied to the immediately relevant component(s), with the ultimate goal always being consistency and maintainability. diff --git a/src/modules/app/components/header.jsx b/src/modules/app/components/header.jsx index b31b8486..b5f71ac1 100644 --- a/src/modules/app/components/header.jsx +++ b/src/modules/app/components/header.jsx @@ -1,11 +1,12 @@ import React from 'react'; import classnames from 'classnames'; +import Link from 'modules/link/components/link'; +import AugurLogo from 'modules/common/components/augur-logo'; + import { ACCOUNT, MARKETS, TRANSACTIONS, MY_POSITIONS, MY_MARKETS, MY_REPORTS } from 'modules/app/constants/views'; import { FAVORITES, PENDING_REPORTS } from 'modules/markets/constants/markets-headers'; import { AUTH_TYPES } from 'modules/auth/constants/auth-types'; -import Link from 'modules/link/components/link'; -import AugurLogo from 'modules/common/components/augur-logo'; const Header = p => (
diff --git a/src/modules/common/components/tab-navigation.jsx b/src/modules/common/components/tab-navigation.jsx index 1365663c..3d232f5b 100644 --- a/src/modules/common/components/tab-navigation.jsx +++ b/src/modules/common/components/tab-navigation.jsx @@ -1,6 +1,7 @@ import React from 'react'; import ReactTooltip from 'react-tooltip'; import classnames from 'classnames'; + import Link from 'modules/link/components/link'; import ValueDenomination from 'modules/common/components/value-denomination'; diff --git a/src/modules/create-market/components/create-market-form-4.jsx b/src/modules/create-market/components/create-market-form-4.jsx index 78a22a80..dcc9817b 100644 --- a/src/modules/create-market/components/create-market-form-4.jsx +++ b/src/modules/create-market/components/create-market-form-4.jsx @@ -1,11 +1,12 @@ import React from 'react'; import classNames from 'classnames'; -import getValue from 'utils/get-value'; import FormButtons from 'modules/create-market/components/create-market-form-buttons'; import Input from 'modules/common/components/input'; import Checkbox from 'modules/common/components/checkbox'; +import getValue from 'utils/get-value'; + const CreateMarketForm4 = p => (
diff --git a/src/modules/market/components/market-basics.jsx b/src/modules/market/components/market-basics.jsx index 94b39dac..659486ff 100644 --- a/src/modules/market/components/market-basics.jsx +++ b/src/modules/market/components/market-basics.jsx @@ -1,6 +1,7 @@ import React from 'react'; import ReactTooltip from 'react-tooltip'; import classnames from 'classnames'; + import ValueDenomination from 'modules/common/components/value-denomination'; import ValueDate from 'modules/common/components/value-date'; import Link from 'modules/link/components/link'; diff --git a/src/modules/market/components/market-open-orders.jsx b/src/modules/market/components/market-open-orders.jsx index 686c0ae9..5679eea7 100644 --- a/src/modules/market/components/market-open-orders.jsx +++ b/src/modules/market/components/market-open-orders.jsx @@ -1,11 +1,12 @@ import React from 'react'; import MarketOpenOrdersGroup from 'modules/market/components/market-open-orders-group'; - -import { SCALAR } from 'modules/markets/constants/market-types'; +import ValueDenomination from 'modules/common/components/value-denomination'; import getValue from 'utils/get-value'; +import { SCALAR } from 'modules/markets/constants/market-types'; + const MarketOpenOrders = (p) => { return (
diff --git a/src/modules/market/components/market-preview.jsx b/src/modules/market/components/market-preview.jsx index a8ddd9b8..6f8d4386 100644 --- a/src/modules/market/components/market-preview.jsx +++ b/src/modules/market/components/market-preview.jsx @@ -1,5 +1,6 @@ import React, { PropTypes } from 'react'; import classnames from 'classnames'; + import MarketBasics from 'modules/market/components/market-basics'; import MarketPreviewOutcomes from 'modules/market/components/market-preview-outcomes'; import Link from 'modules/link/components/link'; diff --git a/src/modules/markets/components/markets-filter-sort.jsx b/src/modules/markets/components/markets-filter-sort.jsx index ec3f10b2..f550f2fe 100644 --- a/src/modules/markets/components/markets-filter-sort.jsx +++ b/src/modules/markets/components/markets-filter-sort.jsx @@ -1,4 +1,5 @@ import React from 'react'; + import Dropdown from 'modules/common/components/dropdown'; import MarketsSearch from 'modules/markets/components/markets-search'; diff --git a/src/modules/markets/components/markets-view.jsx b/src/modules/markets/components/markets-view.jsx index be338e1d..120c1834 100644 --- a/src/modules/markets/components/markets-view.jsx +++ b/src/modules/markets/components/markets-view.jsx @@ -1,7 +1,8 @@ import React, { PropTypes } from 'react'; + import MarketsHeaders from 'modules/markets/components/markets-headers'; import MarketsList from 'modules/markets/components/markets-list'; -import Branch from 'modules/markets/components/branch'; +import Branch from 'modules/branch/components/branch'; const MarketsView = p => (
diff --git a/src/modules/portfolio/components/portfolio-page.jsx b/src/modules/portfolio/components/portfolio-page.jsx index 32c5f274..fc3bc6c3 100644 --- a/src/modules/portfolio/components/portfolio-page.jsx +++ b/src/modules/portfolio/components/portfolio-page.jsx @@ -1,10 +1,12 @@ import React, { PropTypes } from 'react'; + import TabNavigation from 'modules/common/components/tab-navigation'; -import { MY_POSITIONS, MY_MARKETS, MY_REPORTS } from 'modules/app/constants/views'; import Positions from 'modules/portfolio/components/positions'; import Markets from 'modules/portfolio/components/markets'; import Reports from 'modules/portfolio/components/reports'; +import { MY_POSITIONS, MY_MARKETS, MY_REPORTS } from 'modules/app/constants/views'; + const PortfolioPage = (p) => { let node; diff --git a/src/modules/portfolio/components/portfolio-view.jsx b/src/modules/portfolio/components/portfolio-view.jsx index 59fdc086..ffbc26f1 100644 --- a/src/modules/portfolio/components/portfolio-view.jsx +++ b/src/modules/portfolio/components/portfolio-view.jsx @@ -1,10 +1,12 @@ import React, { PropTypes } from 'react'; + import TabNavigation from 'modules/common/components/tab-navigation'; -import { MY_POSITIONS, MY_MARKETS, MY_REPORTS } from 'modules/app/constants/views'; import Positions from 'modules/portfolio/components/positions'; import Markets from 'modules/portfolio/components/markets'; import Reports from 'modules/portfolio/components/reports'; +import { MY_POSITIONS, MY_MARKETS, MY_REPORTS } from 'modules/app/constants/views'; + const PortfolioView = (p) => { let node;