Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

chore: 🔥 updated migration content #466

Merged
merged 5 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
11 changes: 7 additions & 4 deletions src/components/Banner/fixed-dbot-banner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ const FixedDbotBanner = () => (
<span>
<strong>{translate('Important: ')}</strong>
</span>
<span>{translate('Binary Bot will be discontinued soon. ')}</span>
<a className='fixed-banner__visit-deriv-bot' href='#' onClick={visitDerivBot}>
{translate('Upgrade to Deriv Bot')}
</a>
<span>{translate('Binary Bot will be discontinued on')} </span>
<strong>
<span>{translate('31 August 2024.')} </span>
<a className='fixed-banner__visit-deriv-bot' href='#' onClick={visitDerivBot}>
{translate('Upgrade to Deriv Bot')}
</a>
</strong>
<span>{translate(' to continue trading.')}</span>
</div>
</div>
Expand Down
22 changes: 14 additions & 8 deletions src/components/Banner/move-to-dbot-banner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { visitDerivBot } from './redirect-to-dbot';
import './move-to-dbot-banner.scss';

const updateLastPopupTime = () => {
localStorage.setItem('last_deriv_redirect_popup_time', new Date().toString());
localStorage.setItem('migration_popup_timer', new Date().toString());
};

const daysBetween = (date1, date2) => {
Expand All @@ -18,15 +18,15 @@ const daysBetween = (date1, date2) => {
};

const shouldShowPopup = () => {
const last_deriv_redirect_popup_time = localStorage.getItem('last_deriv_redirect_popup_time');
const migration_popup_timer = localStorage.getItem('migration_popup_timer');

if (!last_deriv_redirect_popup_time) {
if (!migration_popup_timer) {
updateLastPopupTime();
return true;
}

const allowed_delay = 1; // One week in days
const last_popup_date = new Date(last_deriv_redirect_popup_time);
const last_popup_date = new Date(migration_popup_timer);
const current_date = new Date();

if (daysBetween(last_popup_date, current_date) >= allowed_delay) {
Expand All @@ -39,7 +39,7 @@ const shouldShowPopup = () => {

const MoveToDbotBanner = () => {
const container_class = 'mv-dbot-banner';
const [open_modal, setOpenModal] = useState(false);
const [open_modal, setOpenModal] = useState(true);

useEffect(() => {
try {
Expand Down Expand Up @@ -72,14 +72,20 @@ const MoveToDbotBanner = () => {
<div className={`${container_class}__icon-container`}>
<img alt='move to deriv' src='/public/images/upgrade-to-deriv-bot.svg' />
</div>
<div className={`${container_class}__title`}>{translate('Binary bot is retiring soon')} </div>
<div className={`${container_class}__title`}>
{translate('Binary bot is retiring on 31 August 2024')}{' '}
sandeep-deriv marked this conversation as resolved.
Show resolved Hide resolved
</div>
<div className={`${container_class}__content`}>
<p>{translate('Binary bot will be discontinued soon.')}</p>
<p>
{translate(
'Import your existing strategies (XML files) to Deriv Bot today and enjoy a faster, more efficient trading experience with advanced features.'
'Follow these steps to keep trading with your favourite strategies on Deriv Bot:'
)}
</p>
<p>{translate('1. Download your Binary Bot strategy in XML format.')}</p>
<p>{translate('2. Switch to Deriv Bot and import your strategy.')}</p>
<p>{translate('3. Run your updated strategy to check its performance.')}</p>
<p>{translate('4. Save the updated strategy for quicker re-imports.')}</p>
<p>{translate('Upgrade today and experience seamless trading on Deriv Bot.')}</p>
</div>
</div>
</DerivAppModal>
Expand Down
Loading