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

PI-1033 more under stable message to users #115

Merged
merged 5 commits into from
Mar 31, 2017
Merged
Changes from 1 commit
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
34 changes: 28 additions & 6 deletions src/containers/WaitForSettings/WaitForSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,31 @@ import { getPluginSettingsForZoneId } from '../../selectors/pluginSettings';
import { FormattedMessage, injectIntl } from 'react-intl';
import { getZoneAnalyticsForZoneId } from '../../selectors/zoneAnalytics';
import { getAllZoneSettingsForZoneId } from '../../selectors/zoneSettings';
import { CLOUDFLARE_ADD_SITE_PAGE } from '../../constants/UrlPaths.js';
import { isDNSPageEnabled } from '../../selectors/config';
import { push } from 'react-router-redux';
import { Link } from 'react-router';
import {
CLOUDFLARE_ADD_SITE_PAGE,
DOMAINS_OVERVIEW_PAGE
} from '../../constants/UrlPaths.js';

class WaitForSettings extends Component {
handleClick(path) {
let { dispatch } = this.props;
dispatch(push(path));
}

render() {
let {
activeZone,
zoneSettings,
zonePluginSettings,
zoneAnalytics
zoneAnalytics,
settings,
pluginSettings,
analytics,
config
} = this.props;
let { settings, pluginSettings, analytics } = this.props;
const { formatMessage } = this.props.intl;

let isSettingsLoaded = true;
Expand Down Expand Up @@ -51,9 +65,16 @@ class WaitForSettings extends Component {
isPluginSettingsLoaded &&
isAnalyticsLoaded;

let link = (
<a href={CLOUDFLARE_ADD_SITE_PAGE} target="_blank">Cloudflare</a>
var link = (
<Link href={CLOUDFLARE_ADD_SITE_PAGE} target="_blank">Cloudflare</Link>
);
if (isDNSPageEnabled(config)) {
link = (
<Link onClick={() => this.handleClick(DOMAINS_OVERVIEW_PAGE)}>
<FormattedMessage id="container.dnsManagementPage.title" />
</Link>
);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to do inline if case thing but prettier was complaining and couldn't figure out why. Then did this instead of ignore-prettier


return (
<div>
Expand Down Expand Up @@ -85,7 +106,8 @@ function mapStateToProps(state) {
activeZone: state.activeZone,
zoneSettings: state.zoneSettings,
zonePluginSettings: state.pluginSettings,
zoneAnalytics: state.zoneAnalytics
zoneAnalytics: state.zoneAnalytics,
config: state.config
};
}
export default injectIntl(connect(mapStateToProps)(WaitForSettings));