Skip to content

Commit

Permalink
Merge pull request #1425 from CityOfZion/feature/fixes-donation-routing
Browse files Browse the repository at this point in the history
Feature/fixes donation routing
  • Loading branch information
comountainclimber committed Sep 22, 2018
2 parents 2511bde + da2aa8c commit 60d84dd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
6 changes: 3 additions & 3 deletions app/components/Send/SendPanel/ZeroAssets/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

import React from 'react'
import { NavLink } from 'react-router-dom'
import { Link } from 'react-router-dom'

import { ROUTES } from '../../../../core/constants'
import TextInput from '../../../Inputs/TextInput'
Expand All @@ -15,9 +15,9 @@ const ZeroAssets = ({ address }: { address: string }) => (
<p>
You’ll need to <b>transfer compatible NEP-5 assets</b> to this wallet
using{' '}
<NavLink id="wallet-manager" exact to={ROUTES.RECEIVE}>
<Link id="receive-link" to={ROUTES.RECEIVE}>
<span> Receive </span>
</NavLink>{' '}
</Link>{' '}
or your public address:
</p>
<div className={styles.address}>
Expand Down
6 changes: 3 additions & 3 deletions app/containers/Send/Send.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Props = {
currencyCode: string,
address: string,
shouldRenderHeaderBar: boolean,
match: Object
location: Object
}

type State = {
Expand Down Expand Up @@ -67,8 +67,8 @@ export default class Send extends React.Component<Props, State> {

return { sendRowDetails: newState }
})
if (this.props.match) {
const { address } = this.props.match.params
if (this.props.location && this.props.location.state) {
const { address } = this.props.location.state
if (address) {
this.updateRowField(0, 'address', address)
}
Expand Down
21 changes: 13 additions & 8 deletions app/containers/Settings/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import {
EXPLORERS,
CURRENCIES,
ROUTES,
MODAL_TYPES
MODAL_TYPES,
COZ_DONATIONS_ADDRESS,
DISCORD_INVITE_LINK
} from '../../core/constants'
import themes from '../../themes'
import styles from './Settings.scss'
Expand All @@ -42,9 +44,6 @@ type State = {
explorer: string
}

const discordInviteLink = 'https://discordapp.com/invite/R8v48YA'
const CozKey = 'Adr3XjZ5QDzVJrWvzmsTTchpLRRGSzgS5A'

export default class Settings extends Component<Props, State> {
saveWalletRecovery = () => {
const { showSuccessNotification, showErrorNotification } = this.props
Expand Down Expand Up @@ -243,8 +242,14 @@ export default class Settings extends Component<Props, State> {
}

renderDontions = () => (
<Link to={`/send/${CozKey}`} className={styles.settingsDonations}>
Created by CoZ. Donations: {CozKey}
<Link
to={{
pathname: ROUTES.SEND,
state: { address: COZ_DONATIONS_ADDRESS }
}}
className={styles.settingsDonations}
>
Created by CoZ. Donations: {COZ_DONATIONS_ADDRESS}
</Link>
)

Expand All @@ -255,7 +260,7 @@ export default class Settings extends Component<Props, State> {
</Tooltip>
)

openDiscordLink = () => shell.openExternal(discordInviteLink)
openDiscordLink = () => shell.openExternal(DISCORD_INVITE_LINK)

renderHeader = () => (
<div className={styles.settingsPanelHeader}>
Expand All @@ -264,7 +269,7 @@ export default class Settings extends Component<Props, State> {
</div>
<div className={styles.settingsPanelHeaderItem}>
Community Support:{' '}
<a onClick={this.openDiscordLink}>{discordInviteLink}</a>
<a onClick={this.openDiscordLink}>{DISCORD_INVITE_LINK}</a>
</div>
</div>
)
Expand Down
3 changes: 3 additions & 0 deletions app/core/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import nodes from './nodes.json'
export const NEON_WALLET_RELEASE_LINK =
'https://github.com/CityOfZion/neon-wallet/releases'

export const DISCORD_INVITE_LINK = 'https://discordapp.com/invite/R8v48YA'
export const COZ_DONATIONS_ADDRESS = 'Adr3XjZ5QDzVJrWvzmsTTchpLRRGSzgS5A'

export const ASSETS = {
NEO: 'NEO',
GAS: 'GAS'
Expand Down

0 comments on commit 60d84dd

Please sign in to comment.