Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Translations #5418

Merged
merged 28 commits into from
May 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
aad12e7
purchase-button : add fade in animation
gohanko Apr 29, 2019
ec69162
purchase-button: refactor animation
gohanko Apr 29, 2019
6b5faf2
Merge branch 'master' of github.com:binary-com/binary-static into pur…
gohanko Apr 29, 2019
ce74e9b
add fade animation to purchase button
gohanko Apr 29, 2019
2521c2d
purchase.jsx : refactor code
gohanko Apr 30, 2019
dadc4bf
purchase.jsx : refactor code
gohanko Apr 30, 2019
c5409db
Merge branch 'master' of github.com:binary-com/binary-static into pur…
gohanko Apr 30, 2019
5d33a31
contract-info: refactor minor stuff
gohanko Apr 30, 2019
40b17cc
Added new animation to purchase button
gohanko Apr 30, 2019
1b02ff7
fix button bobbing
gohanko Apr 30, 2019
7e9c4c6
fix only show slide when first load
gohanko Apr 30, 2019
9a4ef91
is_param_change -> should_fade
gohanko Apr 30, 2019
427fda5
mobile fixes
Apr 30, 2019
e9ccb9d
refactor
gohanko Apr 30, 2019
7c58a05
update 50c
Apr 30, 2019
7f6fcd0
fix linting issue
gohanko Apr 30, 2019
a88ab7c
update cta url
May 1, 2019
26cc1e1
merged master
May 1, 2019
3dd9a33
fix wrong basis name issue
gohanko May 2, 2019
f77b99f
update branch
May 2, 2019
8b0e48b
update cta url
May 2, 2019
b045f27
update binarygrid app version url
May 2, 2019
4d9b950
Merge pull request #5417 from binary-com/translations
oskar-binary May 2, 2019
6d9afb3
Merge branch 'master' into purchase_animation
ashkanx May 2, 2019
eac1aab
Merge pull request #5402 from ahkuma/purchase_animation
ashkanx May 2, 2019
e447480
Merge branch 'master' into grid-lp
negarn May 3, 2019
d0217cf
Merge pull request #5406 from sashcy/grid-lp
negarn May 3, 2019
0f7f726
Update translations
negarn May 3, 2019
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
2 changes: 1 addition & 1 deletion src/javascript/_autogenerated/it.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,26 @@ const PurchaseButton = ({
is_disabled,
is_high_low,
is_loading,
should_fade,
onClickPurchase,
type,
}) => {
const getIconType = () => {
if (is_loading) return '';
if (!should_fade && is_loading) return '';
return (is_high_low) ? `${type.toLowerCase()}_barrier` : type.toLowerCase();
};

return (
<Button
is_disabled={is_contract_mode || is_disabled}
id={`purchase_${type}`}
className={classNames(
'btn-purchase',
{ 'btn-purchase--disabled': (is_contract_mode || is_disabled) && !is_loading },
{ 'btn-purchase--animated': is_loading })}
{
'btn-purchase--disabled' : (is_contract_mode || is_disabled) && !is_loading,
'btn-purchase--animated--slide': is_loading && !should_fade,
'btn-purchase--animated--fade' : is_loading && should_fade,
})}
has_effect
onClick={() => { onClickPurchase(info.id, info.stake, type); }}
>
Expand All @@ -40,14 +45,14 @@ const PurchaseButton = ({
</div>
<div className='btn-purchase__text_wrapper'>
<span className='btn-purchase__text'>
{!is_loading && localize('[_1]', getContractTypeDisplay(type, is_high_low))}
{(!should_fade && is_loading) ? '' : localize('[_1]', getContractTypeDisplay(type, is_high_low))}
</span>
</div>
</div>
<div className='btn-purchase__effect-detail' />
<div className='btn-purchase__info btn-purchase__info--right'>
<div className='btn-purchase__text_wrapper'>
<span className='btn-purchase__text'>{is_loading || is_disabled ? '' : info.returns}</span>
<span className='btn-purchase__text'>{!(is_loading || is_disabled) ? info.returns : ''}</span>
</div>
</div>
</React.Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import PurchaseButton from 'Modules/Trading/Components/Elements/purchase-button.
class PurchaseFieldset extends React.PureComponent {
state = {
show_tooltip: false,
should_fade : false,
}

onMouseEnter = () => {
this.setState({ show_tooltip: true });
componentDidMount() {
this.setState({ should_fade: true });
}

onMouseLeave = () => {
this.setState({ show_tooltip: false });
}
onMouseEnter = () => this.setState({ show_tooltip: true });
onMouseLeave = () => this.setState({ show_tooltip: false });

render() {
const {
Expand Down Expand Up @@ -50,6 +50,7 @@ class PurchaseFieldset extends React.PureComponent {
is_high_low={is_high_low}
is_loading={is_loading}
onClickPurchase={onClickPurchase}
should_fade={this.state.should_fade}
type={type}
/>
);
Expand All @@ -68,6 +69,7 @@ class PurchaseFieldset extends React.PureComponent {
proposal_info={info}
has_increased={info.has_increased}
is_loading={is_loading}
should_fade={this.state.should_fade}
is_visible={!is_contract_mode}
/>
<div
Expand Down
Original file line number Diff line number Diff line change
@@ -1,56 +1,71 @@
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import { localize } from '_common/localize';
import Money from 'App/Components/Elements/money.jsx';
import Tooltip from 'App/Components/Elements/tooltip.jsx';
import { IconPriceMove } from 'Assets/Trading/icon-price-move.jsx';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import { getLocalizedBasis } from 'Stores/Modules/Trading/Constants/contract';
import { localize } from '_common/localize';
import Money from 'App/Components/Elements/money.jsx';
import Tooltip from 'App/Components/Elements/tooltip.jsx';
import { IconPriceMove } from 'Assets/Trading/icon-price-move.jsx';

const ContractInfo = ({
basis,
currency,
has_increased,
is_loading,
should_fade,
is_visible,
proposal_info,
}) => {
const is_loaded_with_error = proposal_info.has_error || !proposal_info.id;
const localized_basis = getLocalizedBasis();
const basisOrPayout = () => {
switch (basis) {
case 'stake':
return localized_basis.payout;
case 'payout':
return localized_basis.stake;
default:
return basis;
}
};

const has_error_or_not_loaded = proposal_info.has_error || !proposal_info.id;
return (
<React.Fragment>
{is_loading ?
<div className='trade-container__loader'>
<div className='trade-container__loader--loading' />
<div className='trade-container__price'>
<div className={classNames(
'trade-container__price-info',
{
'trade-container__price-info--disabled': has_error_or_not_loaded,
'trade-container__price-info--slide' : is_loading && !should_fade,
'trade-container__price-info--fade' : is_loading && should_fade,
})}
>
<div className='trade-container__price-info-basis'>
{has_error_or_not_loaded
? basisOrPayout()
: localize('[_1]', proposal_info.obj_contract_basis.text)
}
</div>
:
<div className='trade-container__price'>
<div className={classNames('trade-container__price-info', { 'trade-container__price-info--disabled': is_loaded_with_error })}>
<div className='trade-container__price-info-basis'>{is_loaded_with_error ? basis : localize('[_1]', proposal_info.obj_contract_basis.text)}</div>
<div className='trade-container__price-info-value'>
{is_loaded_with_error ?
''
:
<Money amount={proposal_info.obj_contract_basis.value} className='trade-container__price-info-currency' currency={currency} />
}
</div>
{is_visible &&
<div className='trade-container__price-info-movement'>
{!is_loaded_with_error && has_increased !== null && <IconPriceMove type={has_increased ? 'profit' : 'loss'} />}
</div>
}
</div>
<span>
<Tooltip
alignment='left'
className={classNames('trade-container__price-tooltip', { 'trade-container__price-tooltip--disabled': is_loaded_with_error })}
classNameIcon='trade-container__price-tooltip-i'
icon='info'
message={is_loaded_with_error ? '' : proposal_info.message}
/>
</span>
<div className='trade-container__price-info-value'>
{!has_error_or_not_loaded &&
<Money amount={proposal_info.obj_contract_basis.value} className='trade-container__price-info-currency' currency={currency} />
}
</div>
}
</React.Fragment>
{is_visible &&
<div className='trade-container__price-info-movement'>
{(!has_error_or_not_loaded && has_increased !== null) &&
<IconPriceMove type={has_increased ? 'profit' : 'loss'} />
}
</div>
}
</div>
<Tooltip
alignment='left'
className={classNames('trade-container__price-tooltip', { 'trade-container__price-tooltip--disabled': has_error_or_not_loaded })}
classNameIcon='trade-container__price-tooltip-i'
icon='info'
message={has_error_or_not_loaded ? '' : proposal_info.message}
/>
</div>
);
};
ContractInfo.propTypes = {
Expand Down
38 changes: 21 additions & 17 deletions src/javascript/app_2/Modules/Trading/Containers/purchase.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ const Purchase = ({
trade_types,
validation_errors,
}) => {
const is_high_low = /high_low/.test(contract_type.toLowerCase());
const isLoading = info => {
const has_validation_error = Object.values(validation_errors).some(e => e.length);
return !has_validation_error && !info.has_error && !info.id;
};

const components = [];
Object.keys(trade_types).map((type, index) => {
const info = proposal_info[type] || {};
const is_disabled = !is_purchase_enabled
|| !is_trade_enabled
|| !info.id
|| !is_client_allowed_to_visit;
const is_high_low = /high_low/.test(contract_type.toLowerCase());
const is_validation_error = Object.values(validation_errors).some(e => e.length);
const is_loading = !is_validation_error && !info.has_error && !info.id;
const is_proposal_error = info.has_error && !info.has_error_details;
const info = proposal_info[type] || {};
const is_disabled = !is_purchase_enabled || !is_trade_enabled || !info.id || !is_client_allowed_to_visit;
const is_proposal_error = info.has_error && !info.has_error_details;

const purchase_fieldset = (
<PurchaseFieldset
Expand All @@ -43,7 +43,7 @@ const Purchase = ({
is_contract_mode={is_contract_mode}
is_disabled={is_disabled}
is_high_low={is_high_low}
is_loading={is_loading}
is_loading={isLoading(info)}
// is_purchase_confirm_on={is_purchase_confirm_on}
is_proposal_error={is_proposal_error}
// is_purchase_locked={is_purchase_locked}
Expand All @@ -53,13 +53,17 @@ const Purchase = ({
type={type}
/>
);
const contract_type_position = getContractTypePosition(type);
if (contract_type_position === 'top') {
components.unshift(purchase_fieldset);
} else if (contract_type_position === 'bottom') {
components.push(purchase_fieldset);
} else {
components.push(purchase_fieldset);

switch (getContractTypePosition(type)) {
case 'top':
components.unshift(purchase_fieldset);
break;
case 'bottom':
components.push(purchase_fieldset);
break;
default:
components.push(purchase_fieldset);
break;
}
});

Expand Down
39 changes: 26 additions & 13 deletions src/sass/app_2/modules/trading.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@keyframes data--loading {
@keyframes slide {
0% {
transform: translateX(-100%);
}
Expand All @@ -16,7 +16,7 @@
&--loading {
width: inherit;
height: inherit;
animation: data--loading 1s cubic-bezier(1, 0, 0.5, 0) infinite;
animation: slide 1s cubic-bezier(1, 0, 0.5, 0) infinite;
background-image: linear-gradient(to left, rgba(255, 255, 255, 0), $COLOR_WHITE 10%, rgba(255, 255, 255, 0));
opacity: 0.32;
}
Expand Down Expand Up @@ -67,16 +67,6 @@
}
}
}
&__loader {
width: 92px;
height: 8px;
margin: 3.5px 0;
@extend .loader;

&--loading {
@extend .loader--loading;
}
}
&__error {
justify-content: center;
align-items: center;
Expand Down Expand Up @@ -144,6 +134,19 @@
}
}
}
&--slide {
width: 92px;
height: 8px;
margin: 6.5px 0;
@extend .loader;

.trade-container__price-info-basis {
@extend .loader--loading;
}
}
&--fade &-value {
opacity: 0;
}
&-value {
font-size: 1.4em;
font-weight: 700;
Expand All @@ -154,6 +157,8 @@
@include themify($themes) {
color: themed('text_color');
}
opacity: 1;
transition: 0.3s;
}
&-basis {
margin-left: 0;
Expand Down Expand Up @@ -411,6 +416,11 @@
float: right;
justify-content: right;
background-color: transparent;

.btn-purchase__text {
opacity: 1;
transition: 0.3s;
}
}
&__effect-detail {
width: 0;
Expand Down Expand Up @@ -469,7 +479,7 @@
}
}
}
&--animated {
&--animated--slide {
.btn-purchase__icon_wrapper, .btn-purchase__text_wrapper {
@extend .loader;
}
Expand All @@ -489,6 +499,9 @@
}
}
}
&--animated--fade &__info--right &__text {
opacity: 0;
}
&__shadow-wrapper:hover:after {
opacity: 0;
}
Expand Down
9 changes: 8 additions & 1 deletion src/sass/landing_pages/grid_lp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
}
.header-sub {
font-size: 24px;
line-height: 50px;
line-height: 36px;
font-weight: bold;
}
.home-header-content {
Expand Down Expand Up @@ -219,6 +219,13 @@
display: block;
}

@media (max-width: 480px) {
.block-xs {
display: block;
margin-top: 10px;
}
}

@media only screen and (max-width: 1024px) {
.binary-grid-landing {
.home--header {
Expand Down
Loading