mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
Replace uses of /preview
in URLs
This commit is contained in:
parent
494bc3e48d
commit
c4403c5d8d
2 changed files with 4 additions and 4 deletions
|
@ -63,7 +63,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'
|
||||
|
||||
|
@ -264,7 +264,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(
|
||||
{},
|
||||
|
@ -745,7 +745,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) {
|
||||
|
|
|
@ -24,7 +24,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