Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start common fnc file #10663

Merged
merged 1 commit into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
);
}