Skip to content

Commit

Permalink
fix: Higher/Lower Trade type contracts Rise/Fall is shown (#7346)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-deriv committed Jan 20, 2023
1 parent f3af598 commit aaca77c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/reports/src/Components/market-symbol-icon-row.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { getMarketName, getTradeTypeName } from '../Helpers/market-underlying';
const MarketSymbolIconRow = ({ icon, payload, show_description, should_show_multiplier = true }) => {
const should_show_category_icon = typeof payload.shortcode === 'string';
const info_from_shortcode = extractInfoFromShortcode(payload.shortcode);
const is_high_low = isHighLow({ shortcode_info: info_from_shortcode });

if (should_show_category_icon && info_from_shortcode) {
return (
Expand Down Expand Up @@ -37,13 +38,13 @@ const MarketSymbolIconRow = ({ icon, payload, show_description, should_show_mult
classNameTarget='category-type-icon__popover'
classNameBubble='category-type-icon__popover-bubble'
alignment='top'
message={getTradeTypeName(info_from_shortcode.category)}
message={getTradeTypeName(info_from_shortcode.category, is_high_low)}
is_bubble_hover_enabled
disable_target_icon
>
<IconTradeTypes
type={
isHighLow({ shortcode_info: info_from_shortcode })
is_high_low
? `${info_from_shortcode.category.toLowerCase()}_barrier`
: info_from_shortcode.category.toLowerCase()
}
Expand Down
3 changes: 2 additions & 1 deletion packages/reports/src/Helpers/market-underlying.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export const getMarketInformation = shortcode => {

export const getMarketName = underlying => (underlying ? getMarketNamesMap()[underlying.toUpperCase()] : null);

export const getTradeTypeName = category => (category ? getContractConfig()[category.toUpperCase()].name : null);
export const getTradeTypeName = (category, is_high_low = false) =>
category ? getContractConfig(is_high_low)[category.toUpperCase()].name : null;

export const getContractDurationType = (longcode, shortcode) => {
if (/^MULTUP|MULTDOWN/.test(shortcode)) return '';
Expand Down

0 comments on commit aaca77c

Please sign in to comment.