Update Knowledge-Base Links (#533)

This commit is contained in:
James Prado 2017-12-06 18:04:57 -05:00 committed by Daniel Ternyak
parent 413fe47113
commit 0759ccd23f
12 changed files with 99 additions and 151 deletions

View File

@ -1,29 +1,23 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { knowledgeBaseURL } from 'config/data';
import './Promos.scss';
const promos = [
{
isExternal: true,
color: '#6e9a3e',
href:
'https://myetherwallet.groovehq.com/knowledge_base/topics/protecting-yourself-and-your-funds',
href: `${knowledgeBaseURL}/security/securing-your-ethereum`,
texts: [<h6 key="1">Learn more about protecting your funds.</h6>],
images: [
require('assets/images/logo-ledger.svg'),
require('assets/images/logo-trezor.svg')
]
images: [require('assets/images/logo-ledger.svg'), require('assets/images/logo-trezor.svg')]
},
{
isExternal: true,
color: '#2b71b1',
href:
'https://buy.coinbase.com?code=a6e1bd98-6464-5552-84dd-b27f0388ac7d&address=0xA7DeFf12461661212734dB35AdE9aE7d987D648c&crypto_currency=ETH&currency=USD',
texts: [
<p key="1">Its now easier to get more ETH</p>,
<h5 key="2">Buy ETH with USD</h5>
],
texts: [<p key="1">Its now easier to get more ETH</p>, <h5 key="2">Buy ETH with USD</h5>],
images: [require('assets/images/logo-coinbase.svg')]
},
{
@ -87,9 +81,7 @@ export default class Promos extends React.Component<{}, State> {
{promos.map((_, index) => {
return (
<button
className={`Promos-nav-btn ${index === activePromo
? 'is-active'
: ''}`}
className={`Promos-nav-btn ${index === activePromo ? 'is-active' : ''}`}
key={index}
onClick={this.navigateToPromo(index)}
/>

View File

@ -5,7 +5,8 @@ import {
trezorReferralURL,
bitboxReferralURL,
donationAddressMap,
VERSION
VERSION,
knowledgeBaseURL
} from 'config/data';
import React from 'react';
import translate from 'translations';
@ -139,9 +140,7 @@ export default class Footer extends React.Component<Props, State> {
</NewTabLink>
</p>
<p className="Footer-about-text">{translate('FOOTER_1')}</p>
<NewTabLink href="https://myetherwallet.github.io/knowledge-base">
Knowledge Base
</NewTabLink>
<NewTabLink href={knowledgeBaseURL}>Knowledge Base</NewTabLink>
<NewTabLink href="https://www.myetherwallet.com/helpers.html">
Helpers & ENS Debugging
</NewTabLink>
@ -157,7 +156,7 @@ export default class Footer extends React.Component<Props, State> {
>
<p>
<b>Be safe & secure: </b>
<NewTabLink href="https://myetherwallet.groovehq.com/knowledge_base/topics/protecting-yourself-and-your-funds">
<NewTabLink href={`${knowledgeBaseURL}/security/securing-your-ethereum`}>
We highly recommend that you read our guide on How to Prevent Loss & Theft for
some recommendations on how to be proactive about your security.
</NewTabLink>

View File

@ -1,4 +1,4 @@
import { gasPriceDefaults } from 'config/data';
import { gasPriceDefaults, knowledgeBaseURL } from 'config/data';
import throttle from 'lodash/throttle';
import React, { Component } from 'react';
import DropdownShell from 'components/ui/DropdownShell';
@ -59,11 +59,7 @@ export default class GasPriceDropdown extends Component<Props, {}> {
<code>21 GWEI</code>.
</p>
<p>
{/* TODO: maybe not hardcode a link? :) */}
<a
href="https://myetherwallet.groovehq.com/knowledge_base/topics/what-is-gas"
target="_blank"
>
<a href={`${knowledgeBaseURL}/gas/what-is-gas-ethereum`} target="_blank">
Read more
</a>
</p>

View File

@ -1,5 +1,6 @@
import React, { Component } from 'react';
import NavigationLink from './NavigationLink';
import { knowledgeBaseURL } from 'config/data';
import './Navigation.scss';
@ -43,7 +44,7 @@ const tabs = [
},
{
name: 'NAV_Help',
to: 'https://myetherwallet.groovehq.com/help_center',
to: `${knowledgeBaseURL}`,
external: true
}
];
@ -89,10 +90,7 @@ export default class Navigation extends Component<Props, State> {
style={borderStyle}
>
{this.state.showLeftArrow && (
<a
aria-hidden="true"
className="Navigation-arrow Navigation-arrow--left"
>
<a aria-hidden="true" className="Navigation-arrow Navigation-arrow--left">
&#171;
</a>
)}
@ -106,10 +104,7 @@ export default class Navigation extends Component<Props, State> {
</div>
{this.state.showRightArrow && (
<a
aria-hidden="true"
className="Navigation-arrow Navigation-arrow-right"
>
<a aria-hidden="true" className="Navigation-arrow Navigation-arrow-right">
&#187;
</a>
)}

View File

@ -23,6 +23,7 @@ import ViewOnlyDecrypt from './ViewOnly';
import { AppState } from 'reducers';
import Web3Decrypt from './Web3';
import Help from 'components/ui/Help';
import { knowledgeBaseURL } from 'config/data';
const WALLETS = {
web3: {
@ -30,8 +31,7 @@ const WALLETS = {
component: Web3Decrypt,
initialParams: {},
unlock: unlockWeb3,
helpLink:
'https://myetherwallet.github.io/knowledge-base/migration/moving-from-private-key-to-metamask.html'
helpLink: `${knowledgeBaseURL}/migration/moving-from-private-key-to-metamask`
},
'ledger-nano-s': {
lid: 'x_Ledger',
@ -56,16 +56,18 @@ const WALLETS = {
password: ''
},
unlock: unlockKeystore,
helpLink:
'https://myetherwallet.github.io/knowledge-base/private-keys-passwords/difference-beween-private-key-and-keystore-file.html'
helpLink: `${
knowledgeBaseURL
}/private-keys-passwords/difference-beween-private-key-and-keystore-file.html`
},
'mnemonic-phrase': {
lid: 'x_Mnemonic',
component: MnemonicDecrypt,
initialParams: {},
unlock: unlockMnemonic,
helpLink:
'https://myetherwallet.github.io/knowledge-base/private-keys-passwords/difference-beween-private-key-and-keystore-file.html'
helpLink: `${
knowledgeBaseURL
}/private-keys-passwords/difference-beween-private-key-and-keystore-file.html`
},
'private-key': {
lid: 'x_PrivKey2',
@ -75,8 +77,9 @@ const WALLETS = {
password: ''
},
unlock: unlockPrivateKey,
helpLink:
'https://myetherwallet.github.io/knowledge-base/private-keys-passwords/difference-beween-private-key-and-keystore-file.html'
helpLink: `${
knowledgeBaseURL
}/private-keys-passwords/difference-beween-private-key-and-keystore-file.html`
},
'view-only': {
lid: 'View with Address Only',
@ -91,9 +94,7 @@ type UnlockParams = {} | PrivateKeyValue;
interface Props {
// FIXME
dispatch: Dispatch<
UnlockKeystoreAction | UnlockMnemonicAction | UnlockPrivateKeyAction
>;
dispatch: Dispatch<UnlockKeystoreAction | UnlockMnemonicAction | UnlockPrivateKeyAction>;
offline: boolean;
allowReadOnly?: boolean;
}
@ -118,19 +119,13 @@ export class WalletDecrypt extends Component<Props, State> {
}
return (
<selectedWallet.component
value={value}
onChange={this.onChange}
onUnlock={this.onUnlock}
/>
<selectedWallet.component value={value} onChange={this.onChange} onUnlock={this.onUnlock} />
);
}
public isOnlineRequiredWalletAndOffline(selectedWalletKey) {
const onlineRequiredWallets = ['trezor', 'ledger-nano-s'];
return (
this.props.offline && onlineRequiredWallets.includes(selectedWalletKey)
);
return this.props.offline && onlineRequiredWallets.includes(selectedWalletKey);
}
public buildWalletOptions() {
@ -160,9 +155,7 @@ export class WalletDecrypt extends Component<Props, State> {
});
}
public handleDecryptionChoiceChange = (
event: React.SyntheticEvent<HTMLInputElement>
) => {
public handleDecryptionChoiceChange = (event: React.SyntheticEvent<HTMLInputElement>) => {
const wallet = WALLETS[(event.target as HTMLInputElement).value];
if (!wallet) {
@ -213,13 +206,8 @@ export class WalletDecrypt extends Component<Props, State> {
public onUnlock = (payload: any) => {
// some components (TrezorDecrypt) don't take an onChange prop, and thus this.state.value will remain unpopulated.
// in this case, we can expect the payload to contain the unlocked wallet info.
const unlockValue =
this.state.value && !isEmpty(this.state.value)
? this.state.value
: payload;
this.props.dispatch(
WALLETS[this.state.selectedWalletKey].unlock(unlockValue)
);
const unlockValue = this.state.value && !isEmpty(this.state.value) ? this.state.value : payload;
this.props.dispatch(WALLETS[this.state.selectedWalletKey].unlock(unlockValue));
};
}

View File

@ -42,6 +42,7 @@ export const gasPriceDefaults = {
gasPriceMaxGwei: 60
};
export const knowledgeBaseURL = 'https://myetherwallet.github.io/knowledge-base';
export const bityReferralURL = 'https://bity.com/af/jshkb37v';
export const ledgerReferralURL = 'https://www.ledgerwallet.com/r/fa4b?path=/products/';
export const trezorReferralURL = 'https://trezor.io/?a=myetherwallet.com';

View File

@ -1,6 +1,7 @@
import { NewTabLink } from 'components/ui';
import React from 'react';
import GeneralInfoNode from './GeneralInfoNode';
import { knowledgeBaseURL } from 'config/data';
import { InfoNode } from './types';
const generalInfoNodes: InfoNode[] = [
@ -9,13 +10,12 @@ const generalInfoNodes: InfoNode[] = [
headerContent: '1. Preparation',
innerList: [
<li key="ensPrep-1">
Decide which account you wish to own the name & ensure you have multiple
backups of that account.
Decide which account you wish to own the name & ensure you have multiple backups of that
account.
</li>,
<li key="ensPrep-2">
Decide the maximum amount of ETH you are willing to pay for the name
(your <u>Bid Amount</u>). Ensure that account has enough to cover your
bid + 0.01 ETH for gas.
Decide the maximum amount of ETH you are willing to pay for the name (your <u>Bid Amount</u>).
Ensure that account has enough to cover your bid + 0.01 ETH for gas.
</li>
]
},
@ -25,12 +25,11 @@ const generalInfoNodes: InfoNode[] = [
innerList: [
<li key="ensAuct-1">Bidding period lasts 3 days (72 hours).</li>,
<li key="ensAuct-2">
You will enter the <u>name</u>, <u>Actual Bid Amount</u>,{' '}
<u>Bid Mask</u>, which is protected by a <u>Secret Phrase</u>
You will enter the <u>name</u>, <u>Actual Bid Amount</u>, <u>Bid Mask</u>, which is
protected by a <u>Secret Phrase</u>
</li>,
<li key="ensAuct-3">
This places your bid, but this information is kept secret until you
reveal it.
This places your bid, but this information is kept secret until you reveal it.
</li>
]
},
@ -39,18 +38,14 @@ const generalInfoNodes: InfoNode[] = [
headerContent: '3. Reveal your Bid',
innerList: [
<li key="ensReveal-1">
<strong>
If you do not reveal your bid, you will not be refunded.
</strong>
<strong>If you do not reveal your bid, you will not be refunded.</strong>
</li>,
<li key="ensReveal-2"> Reveal Period lasts 2 days (48 hours). </li>,
<li key="ensReveal-3">
You will unlock your account, enter the <u>Bid Amount</u>, and the{' '}
<u>Secret Phrase</u>.
You will unlock your account, enter the <u>Bid Amount</u>, and the <u>Secret Phrase</u>.
</li>,
<li key="ensReveal-4">
In the event that two parties bid exactly the same amount, the first bid
revealed will win.
In the event that two parties bid exactly the same amount, the first bid revealed will win.
</li>
]
},
@ -59,13 +54,12 @@ const generalInfoNodes: InfoNode[] = [
headerContent: '4. Finalize the Auction',
innerList: [
<li key="ensFinalize-1">
Once the auction has ended (after 5 days / 120 hours), the winner needs
to finalize the auction in order to claim their new name.
Once the auction has ended (after 5 days / 120 hours), the winner needs to finalize the
auction in order to claim their new name.
</li>,
<li key="ensFinalize-2">
The winner will be refunded the difference between their bid and the
next-highest bid. If you are the only bidder, you will refunded all but
0.01 ETH.
The winner will be refunded the difference between their bid and the next-highest bid. If
you are the only bidder, you will refunded all but 0.01 ETH.
</li>
]
},
@ -75,10 +69,7 @@ const generalInfoNodes: InfoNode[] = [
innerList: [
<li key="ensMore-1">
The auction for this registrar is a blind auction, and is described in
<NewTabLink
content=" EIP162"
href="https://github.com/ethereum/EIPs/issues/162"
/>
<NewTabLink content=" EIP162" href="https://github.com/ethereum/EIPs/issues/162" />
. Basically, no one can see *anything* during the auction.
</li>,
<li key="ensMore-2">
@ -97,32 +88,29 @@ const generalInfoNodes: InfoNode[] = [
}
];
const GeneralInfoList = () =>
const GeneralInfoList = () => (
<section>
{generalInfoNodes.map((data: InfoNode) =>
<GeneralInfoNode key={data.name} {...data} />
)}
</section>;
{generalInfoNodes.map((data: InfoNode) => <GeneralInfoNode key={data.name} {...data} />)}
</section>
);
export const GeneralInfoPanel = () =>
export const GeneralInfoPanel = () => (
<article className="block">
<div className="cont-md">
<h4> What is the process like? </h4>
<GeneralInfoList />
<h6>
<NewTabLink
content="Help Center: ENS"
href="https://myetherwallet.groovehq.com/knowledge_base/categories/ens"
/>
<NewTabLink content="Help Center: ENS" href={`${knowledgeBaseURL}/ens`} />
&nbsp;&middot;&nbsp;
<NewTabLink
content="Debugging a [BAD INSTRUCTION] Reveal"
href="https://myetherwallet.groovehq.com/knowledge_base/topics/debugging-a-bad-instruction-reveal"
href={`${knowledgeBaseURL}/ens/ens-debugging-a-bad-instruction-reveal`}
/>
</h6>
<p>
Please try the above before relying on support for reveal issues as we
are severely backlogged on support tickets. We're so sorry. :(
Please try the above before relying on support for reveal issues as we are severely
backlogged on support tickets. We're so sorry. :(
</p>
</div>
</article>;
</article>
);

View File

@ -7,7 +7,7 @@ import translate from 'translations';
import { makeBlob } from 'utils/blob';
import './DownloadWallet.scss';
import Template from './Template';
import { N_FACTOR } from 'config/data';
import { N_FACTOR, knowledgeBaseURL } from 'config/data';
interface Props {
wallet: IFullWallet;
@ -58,16 +58,15 @@ export default class DownloadWallet extends Component<Props, State> {
<div className="DlWallet-warning">
<p>
<strong>Do not lose it!</strong> It cannot be recovered if you lose
it.
<strong>Do not lose it!</strong> It cannot be recovered if you lose it.
</p>
<p>
<strong>Do not share it!</strong> Your funds will be stolen if you
use this file on a malicious/phishing site.
<strong>Do not share it!</strong> Your funds will be stolen if you use this file on a
malicious/phishing site.
</p>
<p>
<strong>Make a backup!</strong> Secure it like the millions of
dollars it may one day be worth.
<strong>Make a backup!</strong> Secure it like the millions of dollars it may one day be
worth.
</p>
</div>
@ -88,11 +87,7 @@ export default class DownloadWallet extends Component<Props, State> {
<ul>
<li>{translate('GEN_Help_9')}</li>
<li> {translate('GEN_Help_10')}</li>
<input
value={filename}
className="form-control input-sm"
disabled={true}
/>
<input value={filename} className="form-control input-sm" disabled={true} />
</ul>
<h4>{translate('GEN_Help_11')}</h4>
@ -103,12 +98,16 @@ export default class DownloadWallet extends Component<Props, State> {
<h4>{translate('GEN_Help_4')}</h4>
<ul>
<li>
<NewTabLink href="https://myetherwallet.groovehq.com/knowledge_base/topics/how-do-i-save-slash-backup-my-wallet">
<NewTabLink href={`${knowledgeBaseURL}/getting-started/backing-up-your-new-wallet`}>
<strong>{translate('GEN_Help_13')}</strong>
</NewTabLink>
</li>
<li>
<NewTabLink href="https://myetherwallet.groovehq.com/knowledge_base/topics/what-are-the-different-formats-of-a-private-key">
<NewTabLink
href={`${
knowledgeBaseURL
}/private-keys-passwords/difference-beween-private-key-and-keystore-file`}
>
<strong>{translate('GEN_Help_14')}</strong>
</NewTabLink>
</li>
@ -120,15 +119,12 @@ export default class DownloadWallet extends Component<Props, State> {
}
public getBlob = () =>
(this.state.keystore &&
makeBlob('text/json;charset=UTF-8', this.state.keystore)) ||
undefined;
(this.state.keystore && makeBlob('text/json;charset=UTF-8', this.state.keystore)) || undefined;
private markDownloaded = () =>
this.state.keystore && this.setState({ hasDownloadedWallet: true });
private handleContinue = () =>
this.state.hasDownloadedWallet && this.props.continueToPaper();
private handleContinue = () => this.state.hasDownloadedWallet && this.props.continueToPaper();
private setWallet(wallet: IFullWallet, password: string) {
const keystore = wallet.toV3(password, { n: N_FACTOR });

View File

@ -5,6 +5,7 @@ import translate from 'translations';
import './EnterPassword.scss';
import PasswordInput from './PasswordInput';
import Template from './Template';
import { knowledgeBaseURL } from 'config/data';
// VALIDATORS
const minLength = min => value => value && value.length >= min;
@ -67,10 +68,7 @@ export default class EnterPassword extends Component<Props, State> {
<ul>
<li>
<span>{translate('GEN_Help_1')}</span>
<Link to="/send-transaction">
{' '}
Ledger or TREZOR or Digital Bitbox
</Link>
<Link to="/send-transaction"> Ledger or TREZOR or Digital Bitbox</Link>
<span> {translate('GEN_Help_2')}</span>
<span> {translate('GEN_Help_3')}</span>
</li>
@ -99,7 +97,7 @@ export default class EnterPassword extends Component<Props, State> {
<li>
<strong>
<a
href="https://myetherwallet.groovehq.com/knowledge_base/topics/how-do-i-create-a-new-wallet"
href={`${knowledgeBaseURL}/getting-started/creating-a-new-wallet-on-myetherwallet`}
target="_blank"
rel="noopener"
>
@ -110,7 +108,7 @@ export default class EnterPassword extends Component<Props, State> {
<li>
<strong>
<a
href="https://myetherwallet.groovehq.com/knowledge_base/categories/getting-started-443"
href={`${knowledgeBaseURL}/getting-started/getting-started-new`}
target="_blank"
rel="noopener"
>

View File

@ -7,6 +7,7 @@ import translate from 'translations';
import { stripHexPrefix } from 'libs/values';
import './PaperWallet.scss';
import Template from './Template';
import { knowledgeBaseURL } from 'config/data';
const content = (wallet: IFullWallet) => (
<div className="GenPaper">
@ -33,12 +34,12 @@ const content = (wallet: IFullWallet) => (
<strong>Do not lose it!</strong> It cannot be recovered if you lose it.
</p>
<p>
<strong>Do not share it!</strong> Your funds will be stolen if you use
this file on a malicious/phishing site.
<strong>Do not share it!</strong> Your funds will be stolen if you use this file on a
malicious/phishing site.
</p>
<p>
<strong>Make a backup!</strong> Secure it like the millions of dollars
it may one day be worth.
<strong>Make a backup!</strong> Secure it like the millions of dollars it may one day be
worth.
</p>
</div>
@ -54,17 +55,21 @@ const help = (
<h4>{translate('GEN_Help_4')}</h4>
<ul>
<li>
<NewTabLink href="https://myetherwallet.groovehq.com/knowledge_base/topics/how-do-i-save-slash-backup-my-wallet">
<NewTabLink href={`${knowledgeBaseURL}/getting-started/backing-up-your-new-wallet`}>
<strong>{translate('HELP_2a_Title')}</strong>
</NewTabLink>
</li>
<li>
<NewTabLink href="https://myetherwallet.groovehq.com/knowledge_base/topics/protecting-yourself-and-your-funds">
<NewTabLink href={`${knowledgeBaseURL}/security/securing-your-ethereum`}>
<strong>{translate('GEN_Help_15')}</strong>
</NewTabLink>
</li>
<li>
<NewTabLink href="https://myetherwallet.groovehq.com/knowledge_base/topics/what-are-the-different-formats-of-a-private-key">
<NewTabLink
href={`${
knowledgeBaseURL
}/private-keys-passwords/difference-beween-private-key-and-keystore-file`}
>
<strong>{translate('GEN_Help_16')}</strong>
</NewTabLink>
</li>
@ -75,7 +80,7 @@ const help = (
<li>{translate('GEN_Help_18')}</li>
<li>{translate('GEN_Help_19')}</li>
<li>
<NewTabLink href="https://myetherwallet.groovehq.com/knowledge_base/topics/how-do-i-safely-slash-offline-slash-cold-storage-with-myetherwallet">
<NewTabLink href={`${knowledgeBaseURL}/offline/ethereum-cold-storage-with-myetherwallet`}>
{translate('GEN_Help_20')}
</NewTabLink>
</li>

View File

@ -1,6 +1,7 @@
import React from 'react';
import translate from 'translations';
import TabSection from 'containers/TabSection';
import { knowledgeBaseURL } from 'config/data';
const Help = () => (
<TabSection>
@ -17,20 +18,14 @@ const Help = () => (
href="https://www.reddit.com/r/ethereum/comments/47nkoi/psa_check_your_ethaddressorg_wallets_and_any/d0eo45o"
target="_blank"
>
<span className="text-danger">
{translate('HELP_Warning')}
</span>
<span className="text-danger">{translate('HELP_Warning')}</span>
</a>
</h3>
</li>
<li>
<h3>
This page is deprecated. Please check out our more
up-to-date and searchable{' '}
<a
href="https://myetherwallet.groovehq.com/help_center"
target="_blank"
>
This page is deprecated. Please check out our more up-to-date and searchable{' '}
<a href={knowledgeBaseURL} target="_blank">
Knowledge Base.{' '}
</a>
</h3>

View File

@ -1,5 +1,6 @@
import React from 'react';
import Help from 'components/ui/Help';
import { knowledgeBaseURL } from 'config/data';
import { isPositiveInteger } from 'utils/helpers';
interface PublicProps {
@ -28,15 +29,9 @@ export default class NonceField extends React.Component<PublicProps, {}> {
<div className="row form-group">
<div className="col-xs-11">
<label>Nonce</label>
<Help
link={
'https://myetherwallet.github.io/knowledge-base/transactions/what-is-nonce.html'
}
/>
<Help link={`${knowledgeBaseURL}/transactions/what-is-nonce.html`} />
<input
className={`form-control ${
isValidNonce(strValue) ? 'is-valid' : 'is-invalid'
}`}
className={`form-control ${isValidNonce(strValue) ? 'is-valid' : 'is-invalid'}`}
type="number"
value={strValue}
placeholder={placeholder}