mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
Merge pull request #2334 from chrisgarrity/feature/rename-preview
Rename /preview to /projects
This commit is contained in:
commit
ac6a870a3f
3 changed files with 8 additions and 8 deletions
|
@ -198,11 +198,11 @@
|
|||
"title": "Microworlds"
|
||||
},
|
||||
{
|
||||
"name": "preview",
|
||||
"pattern": "^/preview(/editor|(/\\d+(/editor|/fullscreen)?)?)?/?(\\?.*)?$",
|
||||
"routeAlias": "/preview/?$",
|
||||
"name": "projects",
|
||||
"pattern": "^/projects(/editor|(/\\d+(/editor|/fullscreen)?)?)?/?(\\?.*)?$",
|
||||
"routeAlias": "/projects/?$",
|
||||
"view": "preview/preview",
|
||||
"title": "Scratch 3.0 Preview"
|
||||
"title": "Scratch Project"
|
||||
},
|
||||
{
|
||||
"name": "3faq",
|
||||
|
|
|
@ -66,7 +66,7 @@ class Preview extends React.Component {
|
|||
]);
|
||||
const pathname = window.location.pathname.toLowerCase();
|
||||
const parts = pathname.split('/').filter(Boolean);
|
||||
// parts[0]: 'preview'
|
||||
// parts[0]: 'projects'
|
||||
// parts[1]: either :id or 'editor'
|
||||
// parts[2]: undefined if no :id, otherwise either 'editor' or 'fullscreen'
|
||||
|
||||
|
@ -267,7 +267,7 @@ class Preview extends React.Component {
|
|||
if (!this.props.playerMode) modePath = 'editor/';
|
||||
// fullscreen overrides editor
|
||||
if (this.props.fullScreen) modePath = 'fullscreen/';
|
||||
const newPath = `/preview/${idPath}${modePath}`;
|
||||
const newPath = `/projects/${idPath}${modePath}`;
|
||||
if (push) {
|
||||
history.pushState(
|
||||
{},
|
||||
|
@ -782,7 +782,7 @@ GUI.setAppElement(document.getElementById('app'));
|
|||
const initGuiState = guiInitialState => {
|
||||
const pathname = window.location.pathname.toLowerCase();
|
||||
const parts = pathname.split('/').filter(Boolean);
|
||||
// parts[0]: 'preview'
|
||||
// parts[0]: 'projects'
|
||||
// parts[1]: either :id or 'editor'
|
||||
// parts[2]: undefined if no :id, otherwise either 'editor' or 'fullscreen'
|
||||
if (parts.indexOf('editor') === -1) {
|
||||
|
|
|
@ -25,7 +25,7 @@ const RemixCredit = props => {
|
|||
),
|
||||
projectLink: (
|
||||
<a
|
||||
href={`/preview/${projectInfo.id}`}
|
||||
href={`/projects/${projectInfo.id}`}
|
||||
title={projectInfo.title}
|
||||
>
|
||||
{projectInfo.title}
|
||||
|
|
Loading…
Reference in a new issue