Skip to content

Commit

Permalink
Merge pull request #10663 from AugurProject/start-common-fnc-file
Browse files Browse the repository at this point in the history
start common fnc file
  • Loading branch information
bconfortin authored Feb 16, 2021
2 parents 3001c93 + b1446f4 commit a193ff5
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 38 deletions.
18 changes: 18 additions & 0 deletions packages/augur-simplified/src/modules/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,21 @@ export const DEFAULT_MARKET_VIEW_SETTINGS = {

export const CREATE = 'create';

export const DefaultMarketOutcomes = [
{
id: 0,
name: 'Invalid',
price: '$0.00',
isInvalid: true,
},
{
id: 1,
name: 'No',
price: '$0.25',
},
{
id: 2,
name: 'yes',
price: '$0.75',
},
];
6 changes: 2 additions & 4 deletions packages/augur-simplified/src/modules/market/market-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ import {
PositionsLiquidityViewSwitcher,
TransactionsTable,
} from '../common/tables';
import TradingForm, {
DefaultMarketOutcomes,
} from './trading-form';
import TradingForm from './trading-form';
import { useAppStatusStore } from '../stores/app-status';
import { USDC, YES_NO, BUY, MARKET_ID_PARAM_NAME, ETH } from '../constants';
import { USDC, YES_NO, BUY, MARKET_ID_PARAM_NAME, ETH, DefaultMarketOutcomes } from '../constants';
import parseQuery from '../routes/helpers/parse-query';
import { AmmExchange, MarketInfo } from '../types';
import { formatDai } from '../../utils/format-number';
Expand Down
19 changes: 0 additions & 19 deletions packages/augur-simplified/src/modules/market/trading-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,6 @@ import { useCanEnterCashPosition, useCanExitCashPosition } from '../stores/utils
const AVG_PRICE_TIP =
'The difference between the market price and estimated price due to trade size.';

export const DefaultMarketOutcomes = [
{
id: 0,
name: 'Invalid',
price: '$0.00',
isInvalid: true,
},
{
id: 1,
name: 'No',
price: '$0.25',
},
{
id: 2,
name: 'yes',
price: '$0.75',
},
];

interface InfoNumber {
label: string;
value: string;
Expand Down
16 changes: 1 addition & 15 deletions packages/augur-simplified/src/modules/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,7 @@ import {
marketStatusItems,
sortByItems,
} from '../constants';

export function isMobileBrowser(): boolean {
return (
navigator.userAgent.indexOf('Android') > -1 ||
navigator.userAgent.indexOf('webOS') > -1 ||
navigator.userAgent.indexOf('Windows Phone') > -1
);
}

export function isMobileBrowserTall(): boolean {
return (
navigator.userAgent.indexOf('iPhone') > -1 ||
navigator.userAgent.indexOf('iPad') > -1
);
}
import { isMobileBrowser, isMobileBrowserTall } from '../../utils/common-functions';

interface SideBarHeaderProps {
header?: string;
Expand Down
1 change: 1 addition & 0 deletions packages/augur-simplified/src/modules/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,7 @@ export interface LiquidityBreakdown {
yesShares: string;
noShares: string;
lpTokens?: string;
cashAmount?: string;
}
export interface AddLiquidityBreakdown extends LiquidityBreakdown {
lpTokens: string;
Expand Down
14 changes: 14 additions & 0 deletions packages/augur-simplified/src/utils/common-functions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export function isMobileBrowser(): boolean {
return (
navigator.userAgent.indexOf('Android') > -1 ||
navigator.userAgent.indexOf('webOS') > -1 ||
navigator.userAgent.indexOf('Windows Phone') > -1
);
}

export function isMobileBrowserTall(): boolean {
return (
navigator.userAgent.indexOf('iPhone') > -1 ||
navigator.userAgent.indexOf('iPad') > -1
);
}

0 comments on commit a193ff5

Please sign in to comment.