Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #4564

Merged
merged 3 commits into from
Jun 21, 2021
Merged

Cleanup #4564

Show file tree
Hide file tree
Changes from all 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
6 changes: 1 addition & 5 deletions src/front/shared/components/Header/Logo/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { links, constants } from 'helpers'
import CSSModules from 'react-css-modules'
import styles from './Logo.scss'

import { localisedUrl } from 'helpers/locale'
import ThemeTooltip from '../../ui/Tooltip/ThemeTooltip'

import logoBlack from 'shared/images/logo/logo-black.svg'
Expand Down Expand Up @@ -53,10 +52,7 @@ class Logo extends Component<any, {}> {

const imgAlt = window.location.hostname

const goToUrl = isCustomLogoLink ?
customLogoLink
:
localisedUrl(locale, links.home);
const goToUrl = isCustomLogoLink ? customLogoLink : links.home

return (
<div styleName="logoWrapper">
Expand Down
30 changes: 0 additions & 30 deletions src/front/shared/helpers/bepToken.ts

This file was deleted.

3 changes: 1 addition & 2 deletions src/front/shared/helpers/cache.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import getUnixTimeStamp from './getUnixTimeStamp'

import getUnixTimeStamp from 'common/utils/getUnixTimeStamp'

const cacheStorage = {}

Expand Down
4 changes: 0 additions & 4 deletions src/front/shared/helpers/getUnixTimeStamp.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/front/shared/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import eth from './eth'
import bnb from './bnb'
import matic from './matic'
import ethToken from './ethToken'
import bepToken from './bepToken'
import * as user from './user'
import web3 from './web3'
import links from './links'
Expand All @@ -25,7 +24,6 @@ import transactions from './transactions'

import { migrate } from './migrations/'

import getUnixTimeStamp from './getUnixTimeStamp'
import { cacheStorageGet, cacheStorageSet } from './cache'

import apiLooper from './apiLooper'
Expand Down Expand Up @@ -55,7 +53,6 @@ export default {
ghost,
next,
ethToken,
bepToken,
getCurrencyKey,
handleGoTrade,
transactions,
Expand All @@ -69,7 +66,6 @@ export {
ghost,
next,
ethToken,
bepToken,
user,
web3,
utils,
Expand All @@ -87,7 +83,6 @@ export {
externalConfig,

feedback,
getUnixTimeStamp,
cacheStorageGet,
cacheStorageSet,

Expand Down
1 change: 0 additions & 1 deletion src/front/shared/helpers/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const linksManager = {
atomicSwap: '/atomic-swaps',
turboSwap: '/turbo-swaps',
feed: '/feed',
aboutUs: '/aboutUs',
test: 'https://testnet.swaponline.io',
main: 'https://swaponline.io/',
wallet: '/wallet',
Expand Down
3 changes: 1 addition & 2 deletions src/front/shared/helpers/lsDataCache.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import getUnixTimeStamp from './getUnixTimeStamp'

import getUnixTimeStamp from 'common/utils/getUnixTimeStamp'

const localStorage = window.localStorage

Expand Down
7 changes: 1 addition & 6 deletions src/front/shared/helpers/seo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const seo = {
medium: 'https://medium.com/@swaponline',
twitter: 'https://twitter.com/SwapOnlineTeam',
facebook: 'https://www.facebook.com/SwapOnlineTeam',
telegram: 'https://t.me/swaponlineint',
telegram: 'https://t.me/swaponline',
email: '[email protected]',
mainUrl: 'https://swaponline.io',
logo: 'https://screenshots.wpmix.net/chrome_2019-03-28_18-55-506746c4c5-44e6-4bb5-89cb-52ce8fabcedf.png',
Expand Down Expand Up @@ -55,11 +55,6 @@ const seo = {
title: 'Transactions',
description: 'Transactions',
},
{
uri: '/aboutus',
title: 'About Us',
description: 'About Us',
},
{
uri: '/swap',
title: 'Swap',
Expand Down
4 changes: 0 additions & 4 deletions src/front/shared/localisation/en.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
[
{
"id": "menu.aboutus",
"message": "About Us"
},
{
"id": "menu.exchange",
"message": "Exchange",
Expand Down
4 changes: 0 additions & 4 deletions src/front/shared/localisation/es.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
[
{
"id": "menu.aboutus",
"message": "Quienes Somos"
},
{
"id": "menu.exchange",
"message": "Intercambio",
Expand Down
4 changes: 0 additions & 4 deletions src/front/shared/localisation/pl.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
[
{
"id": "menu.aboutus",
"message": "O nas"
},
{
"id": "menu.exchange",
"message": "Giełda",
Expand Down
4 changes: 0 additions & 4 deletions src/front/shared/localisation/ru.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
[
{
"id": "menu.aboutus",
"message": "О Нас"
},
{
"id": "menu.exchange",
"message": "Обмен",
Expand Down
17 changes: 0 additions & 17 deletions src/front/shared/pages/About/About.tsx

This file was deleted.

10 changes: 2 additions & 8 deletions src/front/shared/pages/CreateWallet/CreateWallet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,14 @@
height: 40px;
opacity: 0.7;
transform: scale(0.6) translate(10px, -3px);
right: 15px;
right: 20px;
position: absolute;
top: 10px;
top: 15px;
z-index: 9999;

div {
overflow: visible;
}

@media all and (max-width: 480px) {
position: fixed;
right: 1em;
top: 0.5em;
}
}

.isExist {
Expand Down
1 change: 0 additions & 1 deletion src/front/shared/pages/CreateWallet/Steps/SecondStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { isMobile } from 'react-device-detect'

import actions from 'redux/actions'
import { constants } from 'helpers'
import ethToken from 'helpers/ethToken'
import feedback from 'shared/helpers/feedback'
import Explanation from '../Explanation'
import icons from '../images'
Expand Down
1 change: 1 addition & 0 deletions src/front/shared/pages/CreateWallet/Steps/StepsWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export default class StepsWrapper extends Component<any, any> {
currencies={currenciesForSecondStep}
setError={setError}
handleClick={this.handleClick}
btcData={btcData}
forcedCurrencyData
/>
: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import actions from 'redux/actions'
import styles from './Row.scss'
import config from 'app-config'

import helpers, { links, constants, ethToken } from 'helpers'
import helpers, { links, constants } from 'helpers'
import { IPairFees } from 'helpers/getPairFees'
import PAIR_TYPES from 'helpers/constants/PAIR_TYPES'
import { localisedUrl } from 'helpers/locale'
Expand Down
6 changes: 5 additions & 1 deletion src/front/shared/redux/actions/backupManager.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import constants from 'helpers/constants'
import getUnixTimeStamp from 'helpers/getUnixTimeStamp'
import getUnixTimeStamp from 'common/utils/getUnixTimeStamp'
import config from 'helpers/externalConfig'
import backupUserData from 'plugins/backupUserData'


const backupFields = [
constants.privateKeyNames.btcMnemonic,
constants.privateKeyNames.ethMnemonic,
constants.privateKeyNames.bnbMnemonic,
constants.privateKeyNames.maticMnemonic,
constants.privateKeyNames.eth,
constants.privateKeyNames.bnb,
constants.privateKeyNames.matic,
constants.privateKeyNames.btc,
constants.privateKeyNames.btcMultisig,
constants.privateKeyNames.btcMultisigOtherOwnerKey,
Expand Down
6 changes: 2 additions & 4 deletions src/front/shared/redux/actions/btc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ const login = (

//@ts-ignore: strictNullChecks
const accData = getWalletByWords(mnemonic)
console.log('Btc. Generated wallet from random 12 words')
console.log(accData)

privateKey = accData.WIF
localStorage.setItem(constants.privateKeyNames.btcMnemonic, privateKey)
}
Expand All @@ -170,7 +169,6 @@ const login = (
window.getBtcAddress = () => data.address
window.getBtcData = () => data

console.info('Logged in with Bitcoin', data)
reducers.user.setAuthData({ name: 'btcData', data })
if (!sweepToMnemonicReady) {
// Auth with our mnemonic account
Expand All @@ -192,7 +190,7 @@ const login = (
...auth(mnemonicKeys.btc),
isMnemonic: true,
}
console.info('Logged in with Bitcoin Mnemonic', mnemonicData)

reducers.user.addWallet({
name: 'btcMnemonicData',
data: {
Expand Down
1 change: 0 additions & 1 deletion src/front/shared/redux/actions/btcmultisig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ const createWallet = (privateKey, otherOwnerPublicKey) => {
window.getBtcMultisigData = () => data
window.getBtcMultisigAddress = () => data.address

console.info('Logged in with BitcoinMultisig', data)
reducers.user.setAuthData({ name: 'btcMultisigData', data })
}

Expand Down
6 changes: 2 additions & 4 deletions src/front/shared/redux/actions/ghost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ const login = (

//@ts-ignore: strictNullChecks
const accData = getWalletByWords(mnemonic)
console.log('Ghost. Generated wallet from random 12 words')
console.log(accData)

privateKey = accData.WIF
localStorage.setItem(constants.privateKeyNames.ghostMnemonic, privateKey)
}
Expand All @@ -173,7 +172,6 @@ const login = (
window.getGhostAddress = () => data.address
window.getGhostData = () => data

console.info('Logged in with Ghost', data)
reducers.user.setAuthData({ name: 'ghostData', data })
if (!sweepToMnemonicReady) {
// Auth with our mnemonic account
Expand All @@ -195,7 +193,7 @@ const login = (
...auth(mnemonicKeys.ghost),
isMnemonic: true,
}
console.info('Logged in with Ghost Mnemonic', mnemonicData)

reducers.user.addWallet({
name: 'ghostMnemonicData',
data: {
Expand Down
6 changes: 2 additions & 4 deletions src/front/shared/redux/actions/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ const login = (

//@ts-ignore: strictNullChecks
const accData = getWalletByWords(mnemonic)
console.log('Next. Generated wallet from random 12 words')
console.log(accData)

privateKey = accData.WIF
localStorage.setItem(constants.privateKeyNames.nextMnemonic, privateKey)
}
Expand All @@ -171,7 +170,6 @@ const login = (
window.getNextAddress = () => data.address
window.getNextData = () => data

console.info('Logged in with Next', data)
reducers.user.setAuthData({
name: 'nextData',
data,
Expand All @@ -194,7 +192,7 @@ const login = (
...auth(mnemonicKeys.next),
isMnemonic: true,
}
console.info('Logged in with Next Mnemonic', mnemonicData)

reducers.user.addWallet({
name: 'nextMnemonicData',
data: {
Expand Down
1 change: 0 additions & 1 deletion src/front/shared/redux/actions/usdt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const login = (privateKey) => {
publicKey,
}

console.info('Logged in with USDT', data)
reducers.user.setAuthData({ name: 'usdtData', data })
}

Expand Down
2 changes: 0 additions & 2 deletions src/front/shared/redux/actions/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ const sign_btc_pin = async (btcPrivateKey) => {
btcPinPublicKeys.push(btcPinMnemonicKey[0])
}

console.log('sign to btc pin', btcPinPublicKeys)
const _btcMultisigPinPrivateKey = actions.btcmultisig.login_PIN(btcPrivateKey, btcPinPublicKeys)
}

Expand All @@ -105,7 +104,6 @@ const sign = async () => {
ghost: localStorage.getItem(constants.privateKeyNames.ghostMnemonic),
next: localStorage.getItem(constants.privateKeyNames.nextMnemonic),
}
console.log('actions user - sign', mnemonicKeys, mnemonic)

if (mnemonic !== `-`) {
//@ts-ignore
Expand Down
2 changes: 0 additions & 2 deletions src/front/shared/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import TurboSwap from 'pages/TurboSwap/TurboSwap'
import History from 'pages/History/History'
import CreateWallet from 'pages/CreateWallet/CreateWallet'
import NotFound from 'pages/NotFound/NotFound'
import About from 'pages/About/About'
import Wallet from 'pages/Wallet/Wallet'
import Currency from 'pages/Currency/Currency'
import Exchange from 'pages/Exchange/Exchange'
Expand Down Expand Up @@ -52,7 +51,6 @@ const routes = (
<Route path={`${links.exchange}`} component={Exchange} />

<Route path={`${links.localStorage}`} component={LocalStorage} />
<Route path={`${links.aboutUs}`} component={About} />

<Route path={`${links.send}/:currency/:address/:amount`} component={Wallet} />
<Route path={`${links.wallet}`} component={Wallet} />
Expand Down