Skip to content

Commit

Permalink
utilization of path aliases in all relevant components
Browse files Browse the repository at this point in the history
  • Loading branch information
stephensprinkle-zz committed Nov 7, 2016
1 parent 506dfad commit a296735
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 10 deletions.
5 changes: 3 additions & 2 deletions docs/conventions.md
Expand Up @@ -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.
Expand All @@ -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.

Expand Down
5 changes: 3 additions & 2 deletions 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 => (
<header className="site-header" >
Expand Down
1 change: 1 addition & 0 deletions 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';

Expand Down
@@ -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 => (
<div className="step-4">
<div className="fee">
Expand Down
1 change: 1 addition & 0 deletions 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';
Expand Down
5 changes: 3 additions & 2 deletions 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 (
<article className="market-open-orders">
Expand Down
1 change: 1 addition & 0 deletions 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';
Expand Down
1 change: 1 addition & 0 deletions 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';

Expand Down
3 changes: 2 additions & 1 deletion 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 => (
<section id="markets_view">
Expand Down
4 changes: 3 additions & 1 deletion 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;

Expand Down
4 changes: 3 additions & 1 deletion 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;

Expand Down

0 comments on commit a296735

Please sign in to comment.