This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into nazanin/app_2_components_tests_elements
- Loading branch information
Showing
96 changed files
with
2,106 additions
and
1,610 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/images/pages/binary_in_numbers/charts/chart-active-trading-clients.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
src/images/pages/binary_in_numbers/charts/chart-client-withdrawals.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
src/images/pages/binary_in_numbers/charts/chart-num-transactions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/javascript/app_2/Modules/Trading/Components/Form/DatePicker/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default from './trading_date_picker.jsx'; |
114 changes: 114 additions & 0 deletions
114
src/javascript/app_2/Modules/Trading/Components/Form/DatePicker/trading_date_picker.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import PropTypes from 'prop-types'; | ||
import { PropTypes as MobxPropTypes } from 'mobx-react'; | ||
import React from 'react'; | ||
import { connect } from 'Stores/connect'; | ||
import { | ||
isTimeValid, | ||
setTime, | ||
toMoment } from 'Utils/Date'; | ||
import DatePicker from 'App/Components/Form/DatePicker'; | ||
|
||
const TradingDatePicker = ({ | ||
duration_min_max, | ||
duration_units_list, | ||
validation_errors, | ||
expiry_date, | ||
expiry_type, | ||
is_24_hours_contract, | ||
mode, | ||
name, | ||
onChange, | ||
server_time, | ||
start_time, | ||
start_date, | ||
symbol, | ||
}) => { | ||
let max_date_duration, | ||
min_date_expiry, | ||
has_today_btn, | ||
is_read_only; | ||
const moment_contract_start_date_time = | ||
setTime(toMoment(start_date || server_time), (isTimeValid(start_time) ? start_time : server_time.format('HH:mm'))); | ||
|
||
const max_daily_duration = duration_min_max.daily ? duration_min_max.daily.max : 365 * 24 * 3600; | ||
|
||
if (is_24_hours_contract) { | ||
min_date_expiry = moment_contract_start_date_time.clone().startOf('day'); | ||
max_date_duration = moment_contract_start_date_time.clone().add( | ||
start_date ? 24 * 3600 : (max_daily_duration), 'second'); | ||
} else { | ||
min_date_expiry = moment_contract_start_date_time.clone().startOf('day'); | ||
max_date_duration = moment_contract_start_date_time.clone().add(max_daily_duration, 'second'); | ||
|
||
} | ||
if (expiry_type === 'duration') { | ||
min_date_expiry.add(1, 'day'); | ||
has_today_btn = false; | ||
is_read_only = false; | ||
} else { | ||
has_today_btn = true; | ||
is_read_only = true; | ||
} | ||
|
||
return ( | ||
<DatePicker | ||
alignment='left' | ||
disable_year_selector | ||
disable_trading_events | ||
error_messages={validation_errors.duration || []} | ||
has_today_btn={has_today_btn} | ||
is_nativepicker={false} | ||
is_read_only={is_read_only} | ||
label={duration_units_list.length === 1 ? duration_units_list[0].text : null} | ||
mode={mode} | ||
name={name} | ||
onChange={onChange} | ||
min_date={min_date_expiry} | ||
max_date={max_date_duration} | ||
start_date={start_date} | ||
underlying={symbol} | ||
value={expiry_date} | ||
/> | ||
); | ||
}; | ||
|
||
TradingDatePicker.propTypes = { | ||
duration: PropTypes.oneOfType([ | ||
PropTypes.string, | ||
PropTypes.number, | ||
]), | ||
duration_min_max : PropTypes.object, | ||
duration_units_list: MobxPropTypes.arrayOrObservableArray, | ||
expiry_date : PropTypes.oneOfType([ | ||
PropTypes.string, | ||
PropTypes.number, | ||
]), | ||
expiry_type : PropTypes.string, | ||
is_24_hours_contract: PropTypes.bool, | ||
mode : PropTypes.string, | ||
name : PropTypes.string, | ||
onChange : PropTypes.func, | ||
server_time : PropTypes.object, | ||
start_date : PropTypes.oneOfType([ | ||
PropTypes.number, | ||
PropTypes.string, | ||
]), | ||
start_time : PropTypes.string, | ||
symbol : PropTypes.string, | ||
validation_errors: PropTypes.object, | ||
}; | ||
|
||
export default connect( | ||
({ modules, common }) => ({ | ||
duration_min_max : modules.trade.duration_min_max, | ||
duration_units_list: modules.trade.duration_units_list, | ||
expiry_date : modules.trade.expiry_date, | ||
expiry_type : modules.trade.expiry_type, | ||
onChange : modules.trade.onChange, | ||
server_time : common.server_time, | ||
start_date : modules.trade.start_date, | ||
start_time : modules.trade.start_time, | ||
symbol : modules.trade.symbol, | ||
validation_errors : modules.trade.validation_errors, | ||
}) | ||
)(TradingDatePicker); |
1 change: 1 addition & 0 deletions
1
src/javascript/app_2/Modules/Trading/Components/Form/TimePicker/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default from './trading_time_picker.jsx'; |
Oops, something went wrong.