Skip to content

Commit

Permalink
chore: implemented quill in bottom tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-deriv committed Jun 20, 2024
1 parent 76acf5e commit 57c3c09
Show file tree
Hide file tree
Showing 13 changed files with 423 additions and 49 deletions.
2 changes: 1 addition & 1 deletion build/cssmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ module.exports = {
files: [
{
src: [
`${global.node_modules_paths.quill}/dist/assets/style.css`,
`${global.dist}/css/common.css`,
`${global.node_modules_paths.binary_style}/binary.css`,
`${global.node_modules_paths.binary_style}/binary.more.css`,
],
dest: `${global.dist}/css/common.min.css`,
},
{ src: `${global.dist}/css/reset.css`, dest: `${global.dist}/css/reset.min.css` },
{ src: `${global.dist}/css/app.css`, dest: `${global.dist}/css/app.min.css` },
{ src: `${global.dist}/css/static.css`, dest: `${global.dist}/css/static.min.css` },
],
Expand Down
2 changes: 1 addition & 1 deletion build/postcss.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = function (grunt) {
],
},
dist: {
src: `${global.dist}/css/{app,common,static}.css`,
src: `${global.dist}/css/{app,common,static,reset}.css`,
},
};
};
2 changes: 1 addition & 1 deletion scripts/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports.sections_config = {
'': { // '' is the default section when no 'section' specified in pages.js (to avoid adding 'app' as section for all)
path : '',
js_files : ['vendor', 'binary'],
css_files: ['common.min', 'app.min', 'static.min'],
css_files: ['common.min', 'app.min', 'static.min','reset.min'],
has_pjax : true,
},
};
Expand Down
8 changes: 6 additions & 2 deletions scripts/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ const Crypto = require('crypto');
const fs = require('fs');
const Path = require('path');
const Url = require('url');
const common = require('./common');
const js_translation = require('./js_translation');
const { Console } = require('console');

Check failure on line 35 in scripts/render.js

View workflow job for this annotation

GitHub Actions / Build and Test

'Console' is assigned a value but never used

Check failure on line 35 in scripts/render.js

View workflow job for this annotation

GitHub Actions / build_and_deploy_preview_link

'Console' is assigned a value but never used
const Gettext = require('./gettext');
const js_translation = require('./js_translation');
const common = require('./common');

program
.version('0.2.2')
Expand Down Expand Up @@ -336,6 +337,9 @@ const getFilteredPages = () => {
});
}

console.log('Section');
console.log(sections);

context_builder = await createContextBuilder(sections);

await Promise.all(
Expand Down
380 changes: 380 additions & 0 deletions src/javascript/app/pages/bottom/tabs.jsx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/javascript/app/pages/trade/analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const TradingAnalysis = (() => {

TabSelector.slideSelector(tab_selector_id, el_to_show);
if (el_mobile_tab_header) {
el_mobile_tab_header.innerHTML = el_to_show.firstChild.innerHTML;
// el_mobile_tab_header.innerHTML = el_to_show.firstChild.innerHTML;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/javascript/app/pages/trade/charts/webtrader_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const WebtraderChart = (() => {

const setChart = () => {
const new_underlying = getElementById('underlying').value;
if ($('#tab_graph').hasClass('active') &&
if (
(!chart || chart.data().instrumentCode !== new_underlying)
) {
cleanupChart();
Expand Down
4 changes: 4 additions & 0 deletions src/javascript/app/pages/trade/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const Symbols = require('./symbols');
const Tick = require('./tick');
const contractsElement = require('./contracts.jsx');
const marketsElement = require('./markets.jsx');
const TabsElement = require('../bottom/tabs.jsx');
const formatMoney = require('../../common/currency').formatMoney;
const ActiveSymbols = require('../../common/active_symbols');
const elementInnerHtml = require('../../../_common/common_functions').elementInnerHtml;
Expand Down Expand Up @@ -58,6 +59,9 @@ const commonTrading = (() => {

const displayMarkets = () => {
marketsElement.init();

// All other Quill refactored components
TabsElement.init();
};

/*
Expand Down
7 changes: 2 additions & 5 deletions src/sass/_common/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,6 @@ button {
vertical-align: top;
}

button:focus, input[type='submit']:focus {
background: $COLOR_GREEN;
outline: none;
}

button::-moz-focus-inner, input[type='submit']::-moz-focus-inner {
border: 0;
}
Expand Down Expand Up @@ -1119,3 +1114,5 @@ label + input {
font-weight: bold !important;
}
}


19 changes: 19 additions & 0 deletions src/sass/_common/reskin.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.quill {
&-container {
&-centered {
width: 100%;
display: flex;
justify-content: center;
}
}
}

.tab-explanation {
h3 {
font-weight: 700;
}
}

.explanation-container {
margin-block-end: 50px;
}
1 change: 1 addition & 0 deletions src/sass/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
@import '_common/external/grid'; /* grid layout system */
@import '_common/external/mmenu/jquery.mmenu.all';
@import '_common/external/third-party';
@import '_common/reskin.scss'
5 changes: 5 additions & 0 deletions src/sass/reset.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

/* Style Resets */
button {
background: initial;
}
38 changes: 1 addition & 37 deletions src/templates/app/trade/analysis.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,7 @@ const ArrowsMobile = ({ direction, parent }) => (

const Analysis = ({ no_graph }) => (
<div id='trading_bottom_content'>
<TabContainer className='gr-padding-30 gr-parent full-width' theme='light'>
<div className='gr-row'>
<ArrowsMobile parent='trade_analysis' direction='left' />
<strong id='tab_mobile_header' className='align-self-center gr-hide gr-show-m' />
<ArrowsMobile parent='trade_analysis' direction='right' />
</div>
<TabsSubtabs
id='trade_analysis'
className='gr-padding-20 gr-parent tab-selector-wrapper'
items={[
{ id: 'tab_graph', disabled: no_graph, text: it.L('Chart') },
{ id: 'tab_explanation', text: it.L('Explanation') },
{ id: 'tab_last_digit', className: 'invisible', text: it.L('Last Digit Stats') },
{ id: 'trade_analysis_selector', className: 'tab-selector' },
]}
/>
<div className='tab-content'>
<TabContentContainer id='analysis_content'>
{ !no_graph &&
<TabContent id='tab_graph'>
<p className='error-msg' id='chart-error' />
<div id='trade_live_chart'>
<div id='webtrader_chart' />
</div>
</TabContent>
}

<TabContent id='tab_explanation' className='selectedTab'>
<Explanation />
</TabContent>

<TabContent id='tab_last_digit'>
<LastDigit />
</TabContent>
</TabContentContainer>
</div>
</TabContainer>
<div id='trading_bottom_content_tabs' />
</div>
);

Expand Down

0 comments on commit 57c3c09

Please sign in to comment.