diff --git a/src/javascript/app/App/Components/Animations/fade-wrapper.jsx b/src/javascript/app/App/Components/Animations/fade-wrapper.jsx new file mode 100644 index 000000000000..e5fa852ec159 --- /dev/null +++ b/src/javascript/app/App/Components/Animations/fade-wrapper.jsx @@ -0,0 +1,38 @@ +import PropTypes from 'prop-types'; +import React from 'react'; +import posed, +{ PoseGroup } from 'react-pose'; + +const FadeDiv = posed.div({ + enter: { + opacity : 1, + transition: { duration: 300 }, + }, + exit: { + opacity : 0, + transition: { duration: 300 }, + }, +}); + +const FadeWrapper = ({ + children, + className, + keyname, + is_visible, +}) => ( + + {is_visible && + + {children} + + } + +); + +FadeWrapper.propTypes = { + children : PropTypes.node, + is_visible: PropTypes.bool, + keyname : PropTypes.string, +}; + +export { FadeWrapper }; diff --git a/src/javascript/app/App/Components/Animations/index.js b/src/javascript/app/App/Components/Animations/index.js new file mode 100644 index 000000000000..cbfa65f94278 --- /dev/null +++ b/src/javascript/app/App/Components/Animations/index.js @@ -0,0 +1 @@ +export * from './fade-wrapper.jsx'; diff --git a/src/javascript/app/App/Components/Elements/ContractDrawer/contract-drawer.jsx b/src/javascript/app/App/Components/Elements/ContractDrawer/contract-drawer.jsx index 05dc6dbfef97..5ec870f27479 100644 --- a/src/javascript/app/App/Components/Elements/ContractDrawer/contract-drawer.jsx +++ b/src/javascript/app/App/Components/Elements/ContractDrawer/contract-drawer.jsx @@ -2,34 +2,64 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { withRouter } from 'react-router'; -import Localize from 'App/Components/Elements/localize.jsx'; import { Icon, IconBack } from 'Assets/Common'; -import routes from 'Constants/routes'; +import Localize from 'App/Components/Elements/localize.jsx'; +import { UnderlyingIcon } from 'App/Components/Elements/underlying-icon.jsx'; +import ContractAudit from 'App/Components/Elements/PositionsDrawer/result-details.jsx'; +import ContractTypeCell from 'App/Components/Elements/PositionsDrawer/contract-type-cell.jsx'; import ProfitLossCardContent from 'Modules/Reports/Components/profit-loss-card-content.jsx'; -import MarketSymbolIconRow from 'Modules/Reports/Components/market-symbol-icon-row.jsx'; import ContractCardBody from './contract-card-body.jsx'; import ContractCardFooter from './contract-card-footer.jsx'; import ContractCardHeader from './contract-card-header.jsx'; import ContractCard from './contract-card.jsx'; -import ContractAudit from '../ContractAudit/contract-audit.jsx'; +import { + getDurationPeriod, + getDurationTime, + getDurationUnitText } from '../../../../Stores/Modules/Portfolio/Helpers/details'; +import { + getEndTime, + isUserSold } from '../../../../Stores/Modules/Contract/Helpers/logic'; import Money from '../money.jsx'; class ContractDrawer extends Component { + state = { + is_shade_on: false, + } + + handleShade = (shade) => { + this.setState({ is_shade_on: shade }); + } + getBodyContent () { const { buy_price, currency, + exit_tick, + is_sold, payout, profit, } = this.props.contract_info; + const { contract_info } = this.props; + const exit_spot = isUserSold(contract_info) ? '-' : exit_tick; return ( - + - +
+
+ + + {contract_info.display_name} + +
+
+ +
+
- +
); } render() { + if (!this.props.contract_info) return null; const body_content = this.getBodyContent(); return (
this.props.history.push(routes.reports)} + onClick={() => this.props.history.goBack()} >

diff --git a/src/javascript/app/App/Components/Elements/PositionsDrawer/positions-drawer.jsx b/src/javascript/app/App/Components/Elements/PositionsDrawer/positions-drawer.jsx index 0978e3627144..586142e334cb 100644 --- a/src/javascript/app/App/Components/Elements/PositionsDrawer/positions-drawer.jsx +++ b/src/javascript/app/App/Components/Elements/PositionsDrawer/positions-drawer.jsx @@ -81,7 +81,7 @@ class PositionsDrawer extends React.Component { })} >
- {localize('Positions')} + {localize('Open Positions')}
( - }> + }> { getRoutesConfig().map((route, idx) => ( diff --git a/src/javascript/app/App/Containers/Layout/footer.jsx b/src/javascript/app/App/Containers/Layout/footer.jsx index 0b9d200443ce..429f5826ab0f 100644 --- a/src/javascript/app/App/Containers/Layout/footer.jsx +++ b/src/javascript/app/App/Containers/Layout/footer.jsx @@ -21,6 +21,7 @@ const Footer = ({ is_loading, is_logged_in, is_positions_drawer_on, + is_route_blurred, is_settings_dialog_on, location, showFullBlur, @@ -29,7 +30,7 @@ const Footer = ({ toggleSettingsDialog, }) => (