turn return link into a component

This commit is contained in:
Jeremy Kauffman 2016-08-07 14:00:56 -04:00 committed by Alex Liebowitz
parent 78f1fde34b
commit 24a7d5588e
7 changed files with 20 additions and 9 deletions

View file

@ -55,6 +55,7 @@ var ToolTip = React.createClass({
var linkContainerStyle = {
position: 'relative',
};
var Link = React.createClass({
getInitialState: function() {
return {
@ -100,6 +101,16 @@ var Link = React.createClass({
}
});
var ReturnLink = React.createClass({
render: function() {
return <div style={ { padding: '24px 0' } }><Link
href={this.props.href ? this.props.href : '/'}
icon="icon-chevron-left"
label={this.props.label ? this.props.label : 'Return'}
/></div>;
}
});
var DownloadLink = React.createClass({
propTypes: {
type: React.PropTypes.string,
@ -365,6 +376,6 @@ var subPageLogoStyle = {
var SubPageLogo = React.createClass({
render: function() {
return <img src="img/lbry-dark-1600x528.png" style={subPageLogoStyle} />;
return <a href="/"><img src="img/lbry-dark-1600x528.png" style={subPageLogoStyle} /></a>;
}
});

View file

@ -26,7 +26,7 @@ var HelpPage = React.createClass({
<h3>None of this applies to me, or it didn't work.</h3>
<p>Please <Link href="/?report" label="send us a bug report" />. Thanks!</p>
<section>
<Link href="/" label="<< Return" />
<ReturnLink />
</section>
</main>
);

View file

@ -191,7 +191,7 @@ var MyFilesPage = React.createClass({
{content}
</section>
<section>
<Link href="/" label="<< Return" />
<ReturnLink />
</section>
</main>
);

View file

@ -22,17 +22,17 @@ var ReportPage = React.createClass({
return (
<main className="page">
<SubPageLogo />
<h1>Report a bug</h1>
<h1>Report an Issue</h1>
<section>
<p>Please describe the problem you experienced and any information you think might be useful to us. Links to screenshots are great!</p>
<textarea ref={(t) => this._messageArea = t} cols="50" rows="10" name="message" type="text"/>
<div><button onClick={this.submitMessage} className={this.state.submitting ? 'disabled' : ''}>{this.state.submitting ? 'Submitting...' : 'Submit bug report'}</button></div>
<div><button onClick={this.submitMessage} className={'button-block button-primary ' + (this.state.submitting ? 'disabled' : '')}>{this.state.submitting ? 'Submitting...' : 'Submit Report'}</button></div>
</section>
<section>
Developers, feel free to instead <Link href="https://github.com/lbryio/lbry/issues" label="submit an issue on GitHub"/>.
</section>
<section>
<Link href="/?help" label="<< Return to Help"/>
<ReturnLink href="/?help" label="Return to Help"/>
</section>
</main>
);

View file

@ -119,7 +119,7 @@ var SettingsPage = React.createClass({
</section>
<section>
<Link href="/" label="<< Return"/>
<ReturnLink />
</section>
</main>
);

View file

@ -144,7 +144,7 @@ var DetailPage = React.createClass({
<SubPageLogo />
<FormatsSection name={name} claimInfo={claimInfo} amount={amount} />
<section>
<Link href="/" label="<< Return" />
<ReturnLink />
</section>
</main>);
}

View file

@ -105,7 +105,7 @@ var WalletPage = React.createClass({
<NewAddressSection />
<SendToAddressSection />
<section>
<Link href="/" label="<< Return" />
<ReturnLink />
</section>
</main>
);