From 61560b87f722b2fc4576b83101c6b2e31cf11363 Mon Sep 17 00:00:00 2001 From: "Mr.tang" <1074461480@qq.com> Date: Sat, 24 Feb 2018 00:31:41 +0800 Subject: [PATCH] Fixes #554 (#559) * update title * update titles * delete unnecessary line --- client/modules/IDE/components/About.jsx | 4 ++++ client/modules/IDE/components/AssetList.jsx | 15 +++++++++++++++ client/modules/IDE/components/Feedback.jsx | 5 ++++- .../IDE/components/KeyboardShortcutModal.jsx | 1 - client/modules/IDE/components/Preferences.jsx | 4 ++++ client/modules/IDE/components/SketchList.jsx | 11 +++++++++++ client/modules/IDE/pages/IDEView.jsx | 2 +- client/modules/User/pages/AccountView.jsx | 4 ++++ .../modules/User/pages/EmailVerificationView.jsx | 4 ++++ client/modules/User/pages/LoginView.jsx | 4 ++++ client/modules/User/pages/NewPasswordView.jsx | 4 ++++ client/modules/User/pages/ResetPasswordView.jsx | 4 ++++ client/modules/User/pages/SignupView.jsx | 4 ++++ 13 files changed, 63 insertions(+), 3 deletions(-) diff --git a/client/modules/IDE/components/About.jsx b/client/modules/IDE/components/About.jsx index 13eb343b..281e0d99 100644 --- a/client/modules/IDE/components/About.jsx +++ b/client/modules/IDE/components/About.jsx @@ -1,5 +1,6 @@ import React from 'react'; import InlineSVG from 'react-inlinesvg'; +import { Helmet } from 'react-helmet'; const squareLogoUrl = require('../../../images/p5js-square-logo.svg'); const playUrl = require('../../../images/play.svg'); @@ -8,6 +9,9 @@ const asteriskUrl = require('../../../images/p5-asterisk.svg'); function About(props) { return (
+ + p5.js Web Editor | About +
{/* Video button to hello p5 video page */} diff --git a/client/modules/IDE/components/AssetList.jsx b/client/modules/IDE/components/AssetList.jsx index 57452d49..0584ae02 100644 --- a/client/modules/IDE/components/AssetList.jsx +++ b/client/modules/IDE/components/AssetList.jsx @@ -3,6 +3,8 @@ import React from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { Link } from 'react-router'; +import { Helmet } from 'react-helmet'; + import prettyBytes from 'pretty-bytes'; import * as AssetActions from '../actions/assets'; @@ -14,9 +16,19 @@ class AssetList extends React.Component { 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() { return (
+ + {this.getAssetsTitle()} + {this.props.assets.length === 0 &&

No uploaded assets.

} @@ -47,6 +59,9 @@ class AssetList extends React.Component { } AssetList.propTypes = { + user: PropTypes.shape({ + username: PropTypes.string + }).isRequired, username: PropTypes.string.isRequired, assets: PropTypes.arrayOf(PropTypes.shape({ key: PropTypes.string.isRequired, diff --git a/client/modules/IDE/components/Feedback.jsx b/client/modules/IDE/components/Feedback.jsx index a2c6d06b..a88fbe38 100644 --- a/client/modules/IDE/components/Feedback.jsx +++ b/client/modules/IDE/components/Feedback.jsx @@ -1,11 +1,14 @@ import React from 'react'; import InlineSVG from 'react-inlinesvg'; - +import { Helmet } from 'react-helmet'; import githubLogoUrl from '../../../images/github.svg'; function Feedback(props) { return (
+ + p5.js Web Editor | Feedback +

Via Github Issues diff --git a/client/modules/IDE/components/KeyboardShortcutModal.jsx b/client/modules/IDE/components/KeyboardShortcutModal.jsx index 8b542efc..74d91692 100644 --- a/client/modules/IDE/components/KeyboardShortcutModal.jsx +++ b/client/modules/IDE/components/KeyboardShortcutModal.jsx @@ -1,5 +1,4 @@ import React from 'react'; - import { metaKeyName, } from '../../../utils/metaKey'; diff --git a/client/modules/IDE/components/Preferences.jsx b/client/modules/IDE/components/Preferences.jsx index 08f9f529..b179ffa8 100644 --- a/client/modules/IDE/components/Preferences.jsx +++ b/client/modules/IDE/components/Preferences.jsx @@ -1,6 +1,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import InlineSVG from 'react-inlinesvg'; +import { Helmet } from 'react-helmet'; import { Tab, Tabs, TabList, TabPanel } from 'react-tabs'; // import { bindActionCreators } from 'redux'; // import { connect } from 'react-redux'; @@ -51,6 +52,9 @@ class Preferences extends React.Component { return (
+ + p5.js Web Editor | Preferences +
diff --git a/client/modules/IDE/components/SketchList.jsx b/client/modules/IDE/components/SketchList.jsx index 8dce130d..26bbfa32 100644 --- a/client/modules/IDE/components/SketchList.jsx +++ b/client/modules/IDE/components/SketchList.jsx @@ -5,6 +5,7 @@ import { bindActionCreators } from 'redux'; import moment from 'moment'; import { Link, browserHistory } from 'react-router'; import InlineSVG from 'react-inlinesvg'; +import { Helmet } from 'react-helmet'; import * as SketchActions from '../actions/projects'; import * as ProjectActions from '../actions/project'; import * as ToastActions from '../actions/toast'; @@ -17,10 +18,20 @@ class SketchList extends React.Component { 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() { const username = this.props.username !== undefined ? this.props.username : this.props.user.username; return (
+ + {this.getSketchesTitle()} + { this.props.sketches.length === 0 &&

No sketches.

} diff --git a/client/modules/IDE/pages/IDEView.jsx b/client/modules/IDE/pages/IDEView.jsx index 66547bd7..0f0ebf83 100644 --- a/client/modules/IDE/pages/IDEView.jsx +++ b/client/modules/IDE/pages/IDEView.jsx @@ -200,7 +200,7 @@ class IDEView extends React.Component { return (
- {this.props.project.name} + p5.js Web Editor | {this.props.project.name} {this.props.toast.isVisible && }