diff --git a/web/src/components/Box/Box.postcss b/web/src/components/Box/Box.postcss index dc3bbbf1a..39fa1a810 100644 --- a/web/src/components/Box/Box.postcss +++ b/web/src/components/Box/Box.postcss @@ -96,6 +96,10 @@ align-self: flex-start; } +.padding { + padding: var(--gap); +} + .padding2X { padding: calc(var(--gap) * 2); } diff --git a/web/src/components/Box/Box.tsx b/web/src/components/Box/Box.tsx index 025ad7360..84860ca67 100644 --- a/web/src/components/Box/Box.tsx +++ b/web/src/components/Box/Box.tsx @@ -18,7 +18,7 @@ type BoxOwnProps = { selfStart?: boolean; wrap?: boolean; spacing?: boolean | '2x' | '3x' | '4x' | 'sm'; - padding?: '2x' | '3x'; + padding?: boolean | '2x' | '3x'; }; type Props = BoxOwnProps & @@ -69,8 +69,9 @@ export const Box: Element = React.forwardRef( col && spacing === '3x' && s.colSpacing3X, col && spacing === '4x' && s.colSpacing4X, col && spacing === 'sm' && s.colSpacingSm, + padding === true && s.padding, padding === '2x' && s.padding2X, - padding === '3x' && s.padding3X + padding === '3x' && s.padding3X, ); return React.createElement(as, { ...props, ref, className: boxClassName }); }, diff --git a/web/src/components/Label/Label.postcss b/web/src/components/Label/Label.postcss index 51090843d..98abf8bd7 100644 --- a/web/src/components/Label/Label.postcss +++ b/web/src/components/Label/Label.postcss @@ -1,5 +1,5 @@ .text2X { - font-size: 14px; + font-size: var(--font-size-bigger); letter-spacing: 0.1px; line-height: 22px; max-width: 184px; @@ -7,7 +7,7 @@ } .textSm { - font-size: 12px; + font-size: var(--font-size-smaller); } .primaryColor { @@ -37,3 +37,11 @@ .bold { font-weight: 500; } + +.ellipsis { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + flex: 1; + width: 0; +} diff --git a/web/src/components/Label/Label.tsx b/web/src/components/Label/Label.tsx index 8a6d8c7ce..aa1ed5337 100644 --- a/web/src/components/Label/Label.tsx +++ b/web/src/components/Label/Label.tsx @@ -11,6 +11,7 @@ interface Props { failedColor?: boolean; capitalize?: boolean; bold?: boolean; + ellipsis?: boolean; } export const Label: React.FC = ({ @@ -23,6 +24,7 @@ export const Label: React.FC = ({ failedColor, capitalize, bold, + ellipsis, }) => { const className = cn( size === '2x' && s.text2X, @@ -34,6 +36,7 @@ export const Label: React.FC = ({ failedColor && s.failedColor, capitalize && s.capitalize, bold && s.bold, + ellipsis && s.ellipsis, ); return {children}; }; diff --git a/web/src/components/Order/__snapshots__/Order.test.tsx.snap b/web/src/components/Order/__snapshots__/Order.test.tsx.snap index 279c1dd40..b03f4b148 100644 --- a/web/src/components/Order/__snapshots__/Order.test.tsx.snap +++ b/web/src/components/Order/__snapshots__/Order.test.tsx.snap @@ -2,7 +2,7 @@ exports[`Order should match snapshot 1`] = `
{ if (width < splitBorder) { return ( -
+ -
+ ); } return ( -
+
{ currentTabIndex={this.state.index} />
-
+ ); } diff --git a/web/src/components/OrderForm/Input.postcss b/web/src/components/OrderForm/Input.postcss new file mode 100644 index 000000000..f444a3be6 --- /dev/null +++ b/web/src/components/OrderForm/Input.postcss @@ -0,0 +1,5 @@ +.input { + border: 1px solid var(--input-border-color); + border-radius: 4px; + height: 38px; +} diff --git a/web/src/components/OrderForm/index.tsx b/web/src/components/OrderForm/index.tsx index 0710a62c9..bbc52f8dc 100644 --- a/web/src/components/OrderForm/index.tsx +++ b/web/src/components/OrderForm/index.tsx @@ -17,6 +17,10 @@ import { OrderInput } from '../OrderInput'; import { PercentageButton } from '../PercentageButton'; import { getTriggerSign } from 'src/containers/OpenOrders/helpers'; import { CurrencyTicker } from 'src/components/CurrencyTicker/CurrencyTicker'; +import { Box } from '../Box/Box'; +import { Label } from '../Label/Label'; + +import s from './Input.postcss'; type OnSubmitCallback = (order: OrderProps) => void; type DropdownElem = number | string | React.ReactNode; @@ -123,9 +127,6 @@ interface OrderFormState { side: string; } -const handleSetValue = (value: string | number | undefined, defaultValue: string) => - value || defaultValue; - export class OrderForm extends React.PureComponent { constructor(props: OrderFormProps) { super(props); @@ -301,20 +302,17 @@ export class OrderForm extends React.PureComponent -
- -
- ≈ - - {handleSetValue(Decimal.format(safePrice, currentMarketBidPrecision, ','), '0')} - -
-
-
+ + +
-
+ + ); default: break; diff --git a/web/src/containers/Order/Order.pcss b/web/src/containers/Order/Order.pcss index 03c1f368f..038a76372 100644 --- a/web/src/containers/Order/Order.pcss +++ b/web/src/containers/Order/Order.pcss @@ -22,7 +22,6 @@ .cr-order { height: 100%; width: 100%; - padding: 12px; .cr-tab-panel__navigation-container { background: var(--body-background-color); diff --git a/web/src/index.pcss b/web/src/index.pcss index ccf3d340e..e1894d501 100644 --- a/web/src/index.pcss +++ b/web/src/index.pcss @@ -6,8 +6,8 @@ --font-family: 'Montserrat', helvetica, sans-serif; --font-weight: normal; --font-size: 12px !important; - --font-size-smaller: calc(var(--font-size) * 0.9); - --font-size-bigger: calc(var(--font-size) * 1.1); + --font-size-smaller: calc(var(--font-size) * 0.8); + --font-size-bigger: calc(var(--font-size) * 1.2); --line-height: 1.2; /* layout */ diff --git a/web/src/mobile/components/TradingTabs/CreateOrder/index.tsx b/web/src/mobile/components/TradingTabs/CreateOrder/index.tsx index b4abfa373..f39c59b0b 100644 --- a/web/src/mobile/components/TradingTabs/CreateOrder/index.tsx +++ b/web/src/mobile/components/TradingTabs/CreateOrder/index.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { useSelector } from 'react-redux'; +import { Box } from 'src/components/Box'; import { OpenOrders } from '../../'; import { OrderBook, OrderComponent } from '../../../../containers'; import { selectUserLoggedIn } from '../../../../modules'; @@ -9,10 +10,10 @@ const CreateOrderComponent = (props) => { return (
-
+ -
+ {userLoggedIn ? : null}
); diff --git a/web/src/mobile/styles/components/CreateOrder.pcss b/web/src/mobile/styles/components/CreateOrder.pcss index 27c0e12a4..767e75974 100644 --- a/web/src/mobile/styles/components/CreateOrder.pcss +++ b/web/src/mobile/styles/components/CreateOrder.pcss @@ -4,7 +4,6 @@ display: flex; flex-direction: column; justify-content: flex-start; - margin-bottom: 4px; width: 100%; .cr-locked { @@ -12,14 +11,9 @@ } &__row-double { - align-items: flex-start; background: var(--body-background-color); - display: flex; - flex-direction: row; height: max-content; max-height: 400px; - justify-content: space-between; - width: 100%; } .pg-mobile-orders { @@ -34,7 +28,6 @@ flex-direction: column; height: 100%; justify-content: center; - padding: 12px; width: 50%; } @@ -93,7 +86,6 @@ position: sticky; top: 0; width: 100%; - width: calc(50vw - 24px); tr { align-items: center; diff --git a/web/src/mobile/styles/components/CurrentMarketInfo.pcss b/web/src/mobile/styles/components/CurrentMarketInfo.pcss index 33c1758d9..50c658fde 100644 --- a/web/src/mobile/styles/components/CurrentMarketInfo.pcss +++ b/web/src/mobile/styles/components/CurrentMarketInfo.pcss @@ -44,6 +44,7 @@ font-weight: bold; letter-spacing: 0.5px; line-height: 22px; + white-space: nowrap; } &__chevron { diff --git a/web/src/mobile/styles/components/OpenOrders.pcss b/web/src/mobile/styles/components/OpenOrders.pcss index e40c22eb5..cc7e07a98 100644 --- a/web/src/mobile/styles/components/OpenOrders.pcss +++ b/web/src/mobile/styles/components/OpenOrders.pcss @@ -67,7 +67,6 @@ .no-data { align-items: flex-start; - color: var(--table-text-color); display: flex; flex-direction: row; font-size: 14px; diff --git a/web/src/screens/SetupScreen/SetupScreen.pcss b/web/src/screens/SetupScreen/SetupScreen.pcss index da6188f52..d3e7f38ec 100644 --- a/web/src/screens/SetupScreen/SetupScreen.pcss +++ b/web/src/screens/SetupScreen/SetupScreen.pcss @@ -134,7 +134,6 @@ color: var(--setup-markets-button-color); font-size: 14px; font-weight: bold; - padding: 12px; letter-spacing: 0.04em; width: 75px; diff --git a/web/webpack.config.js b/web/webpack.config.js index 349f81585..615a00b52 100644 --- a/web/webpack.config.js +++ b/web/webpack.config.js @@ -243,6 +243,7 @@ module.exports = { target: `wss://${process.env.PROXY_HOST}`, changeOrigin: true, ws: true, + headers: { Connection: 'keep-alive' }, onProxyReqWs: (proxyReq, _, socket) => { proxyReq.removeHeader('origin'); proxyReq.setHeader('origin', `https://${process.env.PROXY_HOST}`);