Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Configure/Configure.js
/* eslint-disable react-hooks/exhaustive-deps */ | /* eslint-disable react-hooks/exhaustive-deps */ | ||||
import React, { useState, useEffect } from 'react'; | import React, { useState, useEffect } from 'react'; | ||||
import styled from 'styled-components'; | import styled from 'styled-components'; | ||||
import { Collapse, Form, Input, Modal, Spin, Alert } from 'antd'; | import { Collapse, Form, Input, Modal, Spin, Alert } from 'antd'; | ||||
import { | import { | ||||
PlusSquareOutlined, | PlusSquareOutlined, | ||||
WalletFilled, | WalletFilled, | ||||
WalletOutlined, | |||||
ImportOutlined, | ImportOutlined, | ||||
CopyOutlined, | |||||
LockOutlined, | LockOutlined, | ||||
} from '@ant-design/icons'; | } from '@ant-design/icons'; | ||||
import { WalletContext } from '@utils/context'; | import { WalletContext } from '@utils/context'; | ||||
import { StyledCollapse } from '@components/Common/StyledCollapse'; | import { StyledCollapse } from '@components/Common/StyledCollapse'; | ||||
import PrimaryButton, { | import PrimaryButton, { | ||||
SecondaryButton, | SecondaryButton, | ||||
SmartButton, | SmartButton, | ||||
} from '@components/Common/PrimaryButton'; | } from '@components/Common/PrimaryButton'; | ||||
import { CashLoader, CashLoadingIcon } from '@components/Common/CustomIcons'; | import { | ||||
CashLoader, | |||||
CashLoadingIcon, | |||||
ThemedCopyOutlined, | |||||
ThemedWalletOutlined, | |||||
} from '@components/Common/CustomIcons'; | |||||
import { ReactComponent as Trashcan } from '@assets/trashcan.svg'; | import { ReactComponent as Trashcan } from '@assets/trashcan.svg'; | ||||
import { ReactComponent as Edit } from '@assets/edit.svg'; | import { ReactComponent as Edit } from '@assets/edit.svg'; | ||||
import { Event } from '@utils/GoogleAnalytics'; | import { Event } from '@utils/GoogleAnalytics'; | ||||
const { Panel } = Collapse; | const { Panel } = Collapse; | ||||
const SettingsLink = styled.a` | const SettingsLink = styled.a` | ||||
text-decoration: underline; | text-decoration: underline; | ||||
▲ Show 20 Lines • Show All 405 Lines • ▼ Show 20 Lines | return ( | ||||
value={confirmationOfWalletToBeDeleted} | value={confirmationOfWalletToBeDeleted} | ||||
onChange={e => handleWalletToDeleteInput(e)} | onChange={e => handleWalletToDeleteInput(e)} | ||||
/> | /> | ||||
</Form.Item> | </Form.Item> | ||||
</Form> | </Form> | ||||
</Modal> | </Modal> | ||||
)} | )} | ||||
<h2> | <h2> | ||||
<CopyOutlined /> Backup your wallet | <ThemedCopyOutlined /> Backup your wallet | ||||
</h2> | </h2> | ||||
<Alert | <Alert | ||||
style={{ marginBottom: '12px' }} | style={{ marginBottom: '12px' }} | ||||
description="Your seed phrase is the only way to restore your wallet. Write it down. Keep it safe." | description="Your seed phrase is the only way to restore your wallet. Write it down. Keep it safe." | ||||
type="warning" | type="warning" | ||||
showIcon | showIcon | ||||
/> | /> | ||||
{wallet && wallet.mnemonic && ( | {wallet && wallet.mnemonic && ( | ||||
<StyledCollapse> | <StyledCollapse> | ||||
<Panel header="Click to reveal seed phrase" key="1"> | <Panel header="Click to reveal seed phrase" key="1"> | ||||
<p> | <p> | ||||
{wallet && wallet.mnemonic | {wallet && wallet.mnemonic | ||||
? wallet.mnemonic | ? wallet.mnemonic | ||||
: ''} | : ''} | ||||
</p> | </p> | ||||
</Panel> | </Panel> | ||||
</StyledCollapse> | </StyledCollapse> | ||||
)} | )} | ||||
<StyledSpacer /> | <StyledSpacer /> | ||||
<h2> | <h2> | ||||
<WalletOutlined /> Manage Wallets | <ThemedWalletOutlined /> Manage Wallets | ||||
</h2> | </h2> | ||||
{apiError ? ( | {apiError ? ( | ||||
<> | <> | ||||
<CashLoader /> | <CashLoader /> | ||||
<p style={{ color: 'red' }}> | <p style={{ color: 'red' }}> | ||||
<b>An error occured on our end. Reconnecting...</b> | <b>An error occured on our end. Reconnecting...</b> | ||||
</p> | </p> | ||||
</> | </> | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |