* update title

* update titles

* delete unnecessary line
This commit is contained in:
Mr.tang 2018-02-24 00:31:41 +08:00 committed by Cassie Tarakajian
parent 24b0be629f
commit 61560b87f7
13 changed files with 63 additions and 3 deletions

View file

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import InlineSVG from 'react-inlinesvg'; import InlineSVG from 'react-inlinesvg';
import { Helmet } from 'react-helmet';
const squareLogoUrl = require('../../../images/p5js-square-logo.svg'); const squareLogoUrl = require('../../../images/p5js-square-logo.svg');
const playUrl = require('../../../images/play.svg'); const playUrl = require('../../../images/play.svg');
@ -8,6 +9,9 @@ const asteriskUrl = require('../../../images/p5-asterisk.svg');
function About(props) { function About(props) {
return ( return (
<div className="about__content"> <div className="about__content">
<Helmet>
<title>p5.js Web Editor | About</title>
</Helmet>
<div className="about__content-column"> <div className="about__content-column">
<InlineSVG className="about__logo" src={squareLogoUrl} alt="p5js Square Logo" /> <InlineSVG className="about__logo" src={squareLogoUrl} alt="p5js Square Logo" />
{/* Video button to hello p5 video page */} {/* Video button to hello p5 video page */}

View file

@ -3,6 +3,8 @@ import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { Link } from 'react-router'; import { Link } from 'react-router';
import { Helmet } from 'react-helmet';
import prettyBytes from 'pretty-bytes'; import prettyBytes from 'pretty-bytes';
import * as AssetActions from '../actions/assets'; import * as AssetActions from '../actions/assets';
@ -14,9 +16,19 @@ class AssetList extends React.Component {
this.props.getAssets(this.props.username); this.props.getAssets(this.props.username);
} }
getAssetsTitle() {
if (this.props.username === this.props.user.username) {
return 'p5.js Web Editor | My assets';
}
return `p5.js Web Editor | ${this.props.username}'s assets`;
}
render() { render() {
return ( return (
<div className="asset-table-container"> <div className="asset-table-container">
<Helmet>
<title>{this.getAssetsTitle()}</title>
</Helmet>
{this.props.assets.length === 0 && {this.props.assets.length === 0 &&
<p className="asset-table__empty">No uploaded assets.</p> <p className="asset-table__empty">No uploaded assets.</p>
} }
@ -47,6 +59,9 @@ class AssetList extends React.Component {
} }
AssetList.propTypes = { AssetList.propTypes = {
user: PropTypes.shape({
username: PropTypes.string
}).isRequired,
username: PropTypes.string.isRequired, username: PropTypes.string.isRequired,
assets: PropTypes.arrayOf(PropTypes.shape({ assets: PropTypes.arrayOf(PropTypes.shape({
key: PropTypes.string.isRequired, key: PropTypes.string.isRequired,

View file

@ -1,11 +1,14 @@
import React from 'react'; import React from 'react';
import InlineSVG from 'react-inlinesvg'; import InlineSVG from 'react-inlinesvg';
import { Helmet } from 'react-helmet';
import githubLogoUrl from '../../../images/github.svg'; import githubLogoUrl from '../../../images/github.svg';
function Feedback(props) { function Feedback(props) {
return ( return (
<div className="feedback__content"> <div className="feedback__content">
<Helmet>
<title>p5.js Web Editor | Feedback</title>
</Helmet>
<div className="feedback__content-pane"> <div className="feedback__content-pane">
<h2 className="feedback__content-pane-header"> <h2 className="feedback__content-pane-header">
Via Github Issues Via Github Issues

View file

@ -1,5 +1,4 @@
import React from 'react'; import React from 'react';
import { import {
metaKeyName, metaKeyName,
} from '../../../utils/metaKey'; } from '../../../utils/metaKey';

View file

@ -1,6 +1,7 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import InlineSVG from 'react-inlinesvg'; import InlineSVG from 'react-inlinesvg';
import { Helmet } from 'react-helmet';
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs'; import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
// import { bindActionCreators } from 'redux'; // import { bindActionCreators } from 'redux';
// import { connect } from 'react-redux'; // import { connect } from 'react-redux';
@ -51,6 +52,9 @@ class Preferences extends React.Component {
return ( return (
<section className="preferences" tabIndex="0" title="preference-menu"> <section className="preferences" tabIndex="0" title="preference-menu">
<Helmet>
<title>p5.js Web Editor | Preferences</title>
</Helmet>
<Tabs> <Tabs>
<TabList> <TabList>
<div className="preference__subheadings"> <div className="preference__subheadings">

View file

@ -5,6 +5,7 @@ import { bindActionCreators } from 'redux';
import moment from 'moment'; import moment from 'moment';
import { Link, browserHistory } from 'react-router'; import { Link, browserHistory } from 'react-router';
import InlineSVG from 'react-inlinesvg'; import InlineSVG from 'react-inlinesvg';
import { Helmet } from 'react-helmet';
import * as SketchActions from '../actions/projects'; import * as SketchActions from '../actions/projects';
import * as ProjectActions from '../actions/project'; import * as ProjectActions from '../actions/project';
import * as ToastActions from '../actions/toast'; import * as ToastActions from '../actions/toast';
@ -17,10 +18,20 @@ class SketchList extends React.Component {
this.props.getProjects(this.props.username); this.props.getProjects(this.props.username);
} }
getSketchesTitle() {
if (this.props.username === this.props.user.username) {
return 'p5.js Web Editor | My sketches';
}
return `p5.js Web Editor | ${this.props.username}'s sketches`;
}
render() { render() {
const username = this.props.username !== undefined ? this.props.username : this.props.user.username; const username = this.props.username !== undefined ? this.props.username : this.props.user.username;
return ( return (
<div className="sketches-table-container"> <div className="sketches-table-container">
<Helmet>
<title>{this.getSketchesTitle()}</title>
</Helmet>
{ this.props.sketches.length === 0 && { this.props.sketches.length === 0 &&
<p className="sketches-table__empty">No sketches.</p> <p className="sketches-table__empty">No sketches.</p>
} }

View file

@ -200,7 +200,7 @@ class IDEView extends React.Component {
return ( return (
<div className="ide"> <div className="ide">
<Helmet> <Helmet>
<title>{this.props.project.name}</title> <title>p5.js Web Editor | {this.props.project.name}</title>
</Helmet> </Helmet>
{this.props.toast.isVisible && <Toast />} {this.props.toast.isVisible && <Toast />}
<Nav <Nav

View file

@ -5,6 +5,7 @@ import { bindActionCreators } from 'redux';
import { browserHistory } from 'react-router'; import { browserHistory } from 'react-router';
import InlineSVG from 'react-inlinesvg'; import InlineSVG from 'react-inlinesvg';
import axios from 'axios'; import axios from 'axios';
import { Helmet } from 'react-helmet';
import { updateSettings, initiateVerification } from '../actions'; import { updateSettings, initiateVerification } from '../actions';
import AccountForm from '../components/AccountForm'; import AccountForm from '../components/AccountForm';
import { validateSettings } from '../../../utils/reduxFormUtils'; import { validateSettings } from '../../../utils/reduxFormUtils';
@ -32,6 +33,9 @@ class AccountView extends React.Component {
render() { render() {
return ( return (
<div className="form-container"> <div className="form-container">
<Helmet>
<title>p5.js Web Editor | Account</title>
</Helmet>
<div className="form-container__header"> <div className="form-container__header">
<button className="form-container__logo-button" onClick={this.gotoHomePage}> <button className="form-container__logo-button" onClick={this.gotoHomePage}>
<InlineSVG src={logoUrl} alt="p5js Logo" /> <InlineSVG src={logoUrl} alt="p5js Logo" />

View file

@ -5,6 +5,7 @@ import { bindActionCreators } from 'redux';
import { browserHistory } from 'react-router'; import { browserHistory } from 'react-router';
import InlineSVG from 'react-inlinesvg'; import InlineSVG from 'react-inlinesvg';
import get from 'lodash/get'; import get from 'lodash/get';
import { Helmet } from 'react-helmet';
import { verifyEmailConfirmation } from '../actions'; import { verifyEmailConfirmation } from '../actions';
const exitUrl = require('../../../images/exit.svg'); const exitUrl = require('../../../images/exit.svg');
@ -69,6 +70,9 @@ class EmailVerificationView extends React.Component {
return ( return (
<div className="form-container"> <div className="form-container">
<Helmet>
<title>p5.js Web Editor | Email Verification</title>
</Helmet>
<div className="form-container__header"> <div className="form-container__header">
<button className="form-container__logo-button" onClick={this.gotoHomePage}> <button className="form-container__logo-button" onClick={this.gotoHomePage}>
<InlineSVG src={logoUrl} alt="p5js Logo" /> <InlineSVG src={logoUrl} alt="p5js Logo" />

View file

@ -3,6 +3,7 @@ import React from 'react';
import { reduxForm } from 'redux-form'; import { reduxForm } from 'redux-form';
import { Link, browserHistory } from 'react-router'; import { Link, browserHistory } from 'react-router';
import InlineSVG from 'react-inlinesvg'; import InlineSVG from 'react-inlinesvg';
import { Helmet } from 'react-helmet';
import { validateAndLoginUser } from '../actions'; import { validateAndLoginUser } from '../actions';
import LoginForm from '../components/LoginForm'; import LoginForm from '../components/LoginForm';
import { validateLogin } from '../../../utils/reduxFormUtils'; import { validateLogin } from '../../../utils/reduxFormUtils';
@ -34,6 +35,9 @@ class LoginView extends React.Component {
} }
return ( return (
<div className="form-container"> <div className="form-container">
<Helmet>
<title>p5.js Web Editor | Login</title>
</Helmet>
<div className="form-container__header"> <div className="form-container__header">
<button className="form-container__logo-button" onClick={this.gotoHomePage}> <button className="form-container__logo-button" onClick={this.gotoHomePage}>
<InlineSVG src={logoUrl} alt="p5js Logo" /> <InlineSVG src={logoUrl} alt="p5js Logo" />

View file

@ -5,6 +5,7 @@ import classNames from 'classnames';
import { browserHistory } from 'react-router'; import { browserHistory } from 'react-router';
import InlineSVG from 'react-inlinesvg'; import InlineSVG from 'react-inlinesvg';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { Helmet } from 'react-helmet';
import NewPasswordForm from '../components/NewPasswordForm'; import NewPasswordForm from '../components/NewPasswordForm';
import * as UserActions from '../actions'; import * as UserActions from '../actions';
@ -34,6 +35,9 @@ class NewPasswordView extends React.Component {
}); });
return ( return (
<div className={newPasswordClass}> <div className={newPasswordClass}>
<Helmet>
<title>p5.js Web Editor | New Password</title>
</Helmet>
<div className="form-container__header"> <div className="form-container__header">
<button className="form-container__logo-button" onClick={this.gotoHomePage}> <button className="form-container__logo-button" onClick={this.gotoHomePage}>
<InlineSVG src={logoUrl} alt="p5js Logo" /> <InlineSVG src={logoUrl} alt="p5js Logo" />

View file

@ -5,6 +5,7 @@ import classNames from 'classnames';
import InlineSVG from 'react-inlinesvg'; import InlineSVG from 'react-inlinesvg';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { reduxForm } from 'redux-form'; import { reduxForm } from 'redux-form';
import { Helmet } from 'react-helmet';
import * as UserActions from '../actions'; import * as UserActions from '../actions';
import ResetPasswordForm from '../components/ResetPasswordForm'; import ResetPasswordForm from '../components/ResetPasswordForm';
@ -33,6 +34,9 @@ class ResetPasswordView extends React.Component {
}); });
return ( return (
<div className={resetPasswordClass}> <div className={resetPasswordClass}>
<Helmet>
<title>p5.js Web Editor | Reset Password</title>
</Helmet>
<div className="form-container__header"> <div className="form-container__header">
<button className="form-container__logo-button" onClick={this.gotoHomePage}> <button className="form-container__logo-button" onClick={this.gotoHomePage}>
<InlineSVG src={logoUrl} alt="p5js Logo" /> <InlineSVG src={logoUrl} alt="p5js Logo" />

View file

@ -3,6 +3,7 @@ import React from 'react';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import axios from 'axios'; import axios from 'axios';
import { Link, browserHistory } from 'react-router'; import { Link, browserHistory } from 'react-router';
import { Helmet } from 'react-helmet';
import InlineSVG from 'react-inlinesvg'; import InlineSVG from 'react-inlinesvg';
import { reduxForm } from 'redux-form'; import { reduxForm } from 'redux-form';
import * as UserActions from '../actions'; import * as UserActions from '../actions';
@ -34,6 +35,9 @@ class SignupView extends React.Component {
} }
return ( return (
<div className="form-container"> <div className="form-container">
<Helmet>
<title>p5.js Web Editor | Signup</title>
</Helmet>
<div className="form-container__header"> <div className="form-container__header">
<button className="form-container__logo-button" onClick={this.gotoHomePage}> <button className="form-container__logo-button" onClick={this.gotoHomePage}>
<InlineSVG src={logoUrl} alt="p5js Logo" /> <InlineSVG src={logoUrl} alt="p5js Logo" />