Skip to content

Commit

Permalink
Auth: Move SelfHostedInstructions and LostPassword to separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Oct 5, 2017
1 parent 6454b21 commit 0c8c7fb
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 52 deletions.
54 changes: 2 additions & 52 deletions client/auth/login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,58 +24,8 @@ import * as AuthActions from 'lib/oauth-store/actions';
import eventRecorder from 'me/event-recorder';
import WordPressLogo from 'components/wordpress-logo';
import AuthCodeButton from './auth-code-button';
import { addLocaleToWpcomUrl, getLocaleSlug } from 'lib/i18n-utils';

const LostPassword = localize( ( { translate } ) => {
const url = addLocaleToWpcomUrl(
'https://wordpress.com/wp-login.php?action=lostpassword',
getLocaleSlug()
);
return (
<p className="auth__lost-password">
<a href={ url } target="_blank" rel="noopener noreferrer">
{ translate( 'Lost your password?' ) }
</a>
</p>
);
} );

const SelfHostedInstructions = localize( ( { onClickClose, translate } ) => (
<div className="auth__self-hosted-instructions">
<a href="#" onClick={ onClickClose } className="auth__self-hosted-instructions-close">
<Gridicon icon="cross" size={ 24 } />
</a>

<h2>{ translate( 'Add self-hosted site' ) }</h2>
<p>
{ translate(
'By default when you sign into the WordPress.com app, you can edit blogs and sites hosted at WordPress.com'
) }
</p>
<p>
{ translate(
"If you'd like to edit your self-hosted WordPress blog or site, you can do that by following these instructions:"
) }
</p>

<ol>
<li>
<strong>{ translate( 'Install the Jetpack plugin.' ) }</strong>
<br />
<a href="http://jetpack.me/install/">
{ translate( 'Please follow these instructions to install Jetpack' ) }
</a>.
</li>
<li>{ translate( 'Connect Jetpack to WordPress.com.' ) }</li>
<li>
{ translate(
'Now you can sign in to the app using the WordPress.com account Jetpack is connected to, ' +
'and you can find your self-hosted site under the "My Sites" section.'
) }
</li>
</ol>
</div>
) );
import SelfHostedInstructions from './self-hosted-instructions';
import LostPassword from './lost-password';

export const Login = createReactClass( {
displayName: 'Auth',
Expand Down
26 changes: 26 additions & 0 deletions client/auth/lost-password.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* External dependencies
*/
import React from 'react';
import { localize } from 'i18n-calypso';

/**
* Internal dependencies
*/
import { addLocaleToWpcomUrl, getLocaleSlug } from 'lib/i18n-utils';

const LostPassword = ( { translate } ) => {
const url = addLocaleToWpcomUrl(
'https://wordpress.com/wp-login.php?action=lostpassword',
getLocaleSlug()
);
return (
<p className="auth__lost-password">
<a href={ url } target="_blank" rel="noopener noreferrer">
{ translate( 'Lost your password?' ) }
</a>
</p>
);
};

export default localize( LostPassword );
45 changes: 45 additions & 0 deletions client/auth/self-hosted-instructions.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* External dependencies
*/
import React from 'react';
import { localize } from 'i18n-calypso';
import Gridicon from 'gridicons';

const SelfHostedInstructions = ( { onClickClose, translate } ) => (
<div className="auth__self-hosted-instructions">
<a href="#" onClick={ onClickClose } className="auth__self-hosted-instructions-close">
<Gridicon icon="cross" size={ 24 } />
</a>

<h2>{ translate( 'Add self-hosted site' ) }</h2>
<p>
{ translate(
'By default when you sign into the WordPress.com app, you can edit blogs and sites hosted at WordPress.com'
) }
</p>
<p>
{ translate(
"If you'd like to edit your self-hosted WordPress blog or site, you can do that by following these instructions:"
) }
</p>

<ol>
<li>
<strong>{ translate( 'Install the Jetpack plugin.' ) }</strong>
<br />
<a href="http://jetpack.me/install/">
{ translate( 'Please follow these instructions to install Jetpack' ) }
</a>.
</li>
<li>{ translate( 'Connect Jetpack to WordPress.com.' ) }</li>
<li>
{ translate(
'Now you can sign in to the app using the WordPress.com account Jetpack is connected to, ' +
'and you can find your self-hosted site under the "My Sites" section.'
) }
</li>
</ol>
</div>
);

export default localize( SelfHostedInstructions );

0 comments on commit 0c8c7fb

Please sign in to comment.