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 = { var linkContainerStyle = {
position: 'relative', position: 'relative',
}; };
var Link = React.createClass({ var Link = React.createClass({
getInitialState: function() { getInitialState: function() {
return { 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({ var DownloadLink = React.createClass({
propTypes: { propTypes: {
type: React.PropTypes.string, type: React.PropTypes.string,
@ -365,6 +376,6 @@ var subPageLogoStyle = {
var SubPageLogo = React.createClass({ var SubPageLogo = React.createClass({
render: function() { 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> <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> <p>Please <Link href="/?report" label="send us a bug report" />. Thanks!</p>
<section> <section>
<Link href="/" label="<< Return" /> <ReturnLink />
</section> </section>
</main> </main>
); );

View file

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

View file

@ -22,17 +22,17 @@ var ReportPage = React.createClass({
return ( return (
<main className="page"> <main className="page">
<SubPageLogo /> <SubPageLogo />
<h1>Report a bug</h1> <h1>Report an Issue</h1>
<section> <section>
<p>Please describe the problem you experienced and any information you think might be useful to us. Links to screenshots are great!</p> <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"/> <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>
<section> <section>
Developers, feel free to instead <Link href="https://github.com/lbryio/lbry/issues" label="submit an issue on GitHub"/>. Developers, feel free to instead <Link href="https://github.com/lbryio/lbry/issues" label="submit an issue on GitHub"/>.
</section> </section>
<section> <section>
<Link href="/?help" label="<< Return to Help"/> <ReturnLink href="/?help" label="Return to Help"/>
</section> </section>
</main> </main>
); );

View file

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

View file

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

View file

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