Skip to content

Commit

Permalink
fix: eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
rupato-deriv committed Jul 2, 2024
1 parent 8d00cf9 commit 94bd51f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"scripts": {
"start": "vite",
"start:dev": "vite-live-preview --reload --port=8444",
"start:dev": "vite-live-preview --reload --port=8443",
"build": "vite build",
"preview": "vite preview",
"test:lint": "prettier --log-level silent --write . && eslint \"./src/**/*.?(js|jsx|ts|tsx)\"",
Expand Down Expand Up @@ -119,4 +119,4 @@
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^1.6.0"
}
}
}
8 changes: 4 additions & 4 deletions src/components/shared_ui/dialog/dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
/* eslint-disable simple-import-sort/imports */
import React from 'react';
import ReactDOM from 'react-dom';
import { CSSTransition } from 'react-transition-group';
import classNames from 'classnames';

// import Icon from '../icon/icon';
// import Button from '../button/button';
import Text from '../text';
// import { useOnClickOutside } from '../../hooks';

type TDialog = {
cancel_button_text?: string;
Expand Down Expand Up @@ -149,6 +146,7 @@ const Dialog = ({
{has_close_icon && (
<div onClick={handleClose} className='dc-dialog__header--close'>
<img src='icons/ic-cross.svg' />
{/* TODO: need to fix this component by importing the Icon in shared UI */}
{/* <Icon icon='IcCross' /> */}
</div>
)}
Expand All @@ -163,6 +161,7 @@ const Dialog = ({
)}
<div className='dc-dialog__footer'>
{!!onCancel && (
//TODO: need to fix this component by importing the button in shared UI
// <Button
// className='dc-dialog__button'
// has_effect
Expand All @@ -176,6 +175,7 @@ const Dialog = ({
</button>
)}
{!!confirm_button_text && (
//TODO: need to fix this component by importing the button in shared UI
// <Button
// className='dc-dialog__button'
// has_effect
Expand Down
3 changes: 1 addition & 2 deletions src/external/bot-skeleton/utils/date-time-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
export const timeSince = timestamp => {
const now = new Date();
const secondPast = (now.getTime() - timestamp) / 1000;

// TODO: kept commented so we can apply localize function after translations fixed
//console.log(secondPast)
if (secondPast < 60) {

return `${parseInt(secondPast)}s ago`;
//return localize('{{secondPast}}s ago', { secondPast: parseInt(secondPast) });
}
Expand Down
10 changes: 4 additions & 6 deletions src/pages/dashboard/common/delete-dialog/delete-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/* eslint-disable simple-import-sort/imports */
import localForage from 'localforage';
import LZString from 'lz-string';
import { observer } from 'mobx-react-lite';

import { Text } from '@deriv-com/ui';

import { TStrategy } from 'Types';

import { NOTIFICATION_TYPE } from '@/components/bot-notification/bot-notification-utils';
import { getSavedWorkspaces } from '@/external/bot-skeleton';
import { useStore } from '@/hooks/useStore';
Expand Down Expand Up @@ -66,15 +64,15 @@ const DeleteDialog = observer(() => {
return (
<div>
<Dialog
title="Delete bot"
title='Delete bot'
is_visible={is_delete_modal_open}
confirm_button_text="Yes, delete"
confirm_button_text='Yes, delete'
onConfirm={() => {
removeBotStrategy(selected_strategy_id);
onToggleDeleteDialog(false);
setOpenSettings(NOTIFICATION_TYPE.BOT_DELETE);
}}
cancel_button_text="No"
cancel_button_text='No'
onCancel={() => {
onToggleDeleteDialog(false);
}}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/dashboard/common/info-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const InfoPanel = observer(() => {

const handleClose = () => {
setInfoPanelVisibility(false);
localStorage.removeItem('dbot_should_show_info');
localStorage.setItem('dbot_should_show_info', JSON.stringify(Date.now()));
};

const renderInfo = () => (
Expand Down
8 changes: 4 additions & 4 deletions src/pages/main/main.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-disable simple-import-sort/imports */
import React, { useEffect } from 'react';
import classNames from 'classnames';
import { observer } from 'mobx-react-lite';

import { Dialog } from '@deriv-com/ui';

import DesktopWrapper from '@/components/shared_ui/desktop-wrapper';
import MobileWrapper from '@/components/shared_ui/mobile-wrapper';
import Tabs from '@/components/shared_ui/tabs/tabs';
Expand All @@ -15,7 +14,6 @@ import { api_base } from '@/external/bot-skeleton/services/api/api-base';
import { isDbotRTL } from '@/external/bot-skeleton/utils/workspace';
import { useStore } from '@/hooks/useStore';
import { Localize, localize } from '@/utils/tmp/dummy';

import RunPanel from '../../components/run-panel';
import Chart from '../chart';
import ChartModal from '../chart/chart-modal';
Expand All @@ -41,8 +39,9 @@ const AppWrapper = observer(() => {
const { cancel_button_text, ok_button_text, title, message } = dialog_options as { [key: string]: string };
const { clear } = summary_card;
const { DASHBOARD, BOT_BUILDER } = DBOT_TABS;
// TODO: need to check this
// const { ui } = useStore();
// const { url_hashed_values, is_mobile } = ui;
// const { url_hashed_values, is_mobile } = ui;
//const hash = ['dashboard', 'bot_builder', 'chart', 'tutorial'];

//let tab_value: number | string = active_tab;
Expand Down Expand Up @@ -73,6 +72,7 @@ const AppWrapper = observer(() => {
setTourDialogVisibility(false);
}

// TODO: need to check this
// if (init_render.current) {
// //setActiveTab(Number(active_hash_tab));
// if (is_mobile) handleTabChange(Number(active_hash_tab));
Expand Down

0 comments on commit 94bd51f

Please sign in to comment.