mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 09:35:56 -05:00
refactor: [UEPR-44] Removed unnecessary ids
This commit is contained in:
parent
be4e3074bb
commit
5b282b155b
1 changed files with 15 additions and 33 deletions
|
@ -101,39 +101,21 @@ const projects = {
|
||||||
makeMusic: '10012676'
|
makeMusic: '10012676'
|
||||||
};
|
};
|
||||||
|
|
||||||
const tutorialIds = {
|
const tutorials = {
|
||||||
clicker: {
|
clicker: 'Make-A-Game',
|
||||||
id: 'Make-A-Game',
|
pong: 'pong',
|
||||||
urlId: 'clicker-game'
|
animateCharacter: 'Animate-A-Character',
|
||||||
},
|
makeItFly: 'make-it-fly',
|
||||||
pong: {
|
recordSound: 'record-a-sound',
|
||||||
id: 'pong',
|
makeMusic: 'Make-Music'
|
||||||
urlId: 'pong'
|
|
||||||
},
|
|
||||||
animateCharacter: {
|
|
||||||
id: 'Animate-A-Character',
|
|
||||||
urlId: 'animate-a-character'
|
|
||||||
},
|
|
||||||
makeItFly: {
|
|
||||||
id: 'make-it-fly',
|
|
||||||
urlId: 'make-it-fly'
|
|
||||||
},
|
|
||||||
recordSound: {
|
|
||||||
id: 'record-a-sound',
|
|
||||||
urlId: 'record-a-sound'
|
|
||||||
},
|
|
||||||
makeMusic: {
|
|
||||||
id: 'Make-Music',
|
|
||||||
urlId: 'music'
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const redirectToProject = projectId => {
|
const redirectToProject = projectId => {
|
||||||
location.href = `/projects/${projectId}?showJourney=true`;
|
location.href = `/projects/${projectId}?showJourney=true`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const openTutorial = (onActivateDeck, tutorial, driverObj) => {
|
const openTutorial = (onActivateDeck, tutorialId, driverObj) => {
|
||||||
onActivateDeck(tutorial.id);
|
onActivateDeck(tutorialId);
|
||||||
driverObj.destroy();
|
driverObj.destroy();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -279,7 +261,7 @@ const EditorJourney = ({onActivateDeck, setCanViewTutorialsHighlight}) => {
|
||||||
{
|
{
|
||||||
imgSrc: '/images/onboarding-journeys/Tutorials-Icon.png',
|
imgSrc: '/images/onboarding-journeys/Tutorials-Icon.png',
|
||||||
text: intl.formatMessage(messages.tutorialTitle),
|
text: intl.formatMessage(messages.tutorialTitle),
|
||||||
handleOnClick: () => openTutorial(onActivateDeck, tutorialIds.clicker, driverObj)
|
handleOnClick: () => openTutorial(onActivateDeck, tutorials.clicker, driverObj)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imgSrc: '/images/onboarding-journeys/Starter-Projects-Icon.png',
|
imgSrc: '/images/onboarding-journeys/Starter-Projects-Icon.png',
|
||||||
|
@ -307,7 +289,7 @@ const EditorJourney = ({onActivateDeck, setCanViewTutorialsHighlight}) => {
|
||||||
{
|
{
|
||||||
imgSrc: '/images/onboarding-journeys/Tutorials-Icon.png',
|
imgSrc: '/images/onboarding-journeys/Tutorials-Icon.png',
|
||||||
text: intl.formatMessage(messages.tutorialTitle),
|
text: intl.formatMessage(messages.tutorialTitle),
|
||||||
handleOnClick: () => openTutorial(onActivateDeck, tutorialIds.pong, driverObj)
|
handleOnClick: () => openTutorial(onActivateDeck, tutorials.pong, driverObj)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imgSrc: '/images/onboarding-journeys/Starter-Projects-Icon.png',
|
imgSrc: '/images/onboarding-journeys/Starter-Projects-Icon.png',
|
||||||
|
@ -336,7 +318,7 @@ const EditorJourney = ({onActivateDeck, setCanViewTutorialsHighlight}) => {
|
||||||
imgSrc: '/images/onboarding-journeys/Tutorials-Icon.png',
|
imgSrc: '/images/onboarding-journeys/Tutorials-Icon.png',
|
||||||
text: intl.formatMessage(messages.tutorialTitle),
|
text: intl.formatMessage(messages.tutorialTitle),
|
||||||
handleOnClick: () =>
|
handleOnClick: () =>
|
||||||
openTutorial(onActivateDeck, tutorialIds.animateCharacter, driverObj)
|
openTutorial(onActivateDeck, tutorials.animateCharacter, driverObj)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imgSrc: '/images/onboarding-journeys/Starter-Projects-Icon.png',
|
imgSrc: '/images/onboarding-journeys/Starter-Projects-Icon.png',
|
||||||
|
@ -364,7 +346,7 @@ const EditorJourney = ({onActivateDeck, setCanViewTutorialsHighlight}) => {
|
||||||
{
|
{
|
||||||
imgSrc: '/images/onboarding-journeys/Tutorials-Icon.png',
|
imgSrc: '/images/onboarding-journeys/Tutorials-Icon.png',
|
||||||
text: intl.formatMessage(messages.tutorialTitle),
|
text: intl.formatMessage(messages.tutorialTitle),
|
||||||
handleOnClick: () => openTutorial(onActivateDeck, tutorialIds.makeItFly, driverObj)
|
handleOnClick: () => openTutorial(onActivateDeck, tutorials.makeItFly, driverObj)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imgSrc: '/images/onboarding-journeys/Starter-Projects-Icon.png',
|
imgSrc: '/images/onboarding-journeys/Starter-Projects-Icon.png',
|
||||||
|
@ -392,7 +374,7 @@ const EditorJourney = ({onActivateDeck, setCanViewTutorialsHighlight}) => {
|
||||||
{
|
{
|
||||||
imgSrc: '/images/onboarding-journeys/Tutorials-Icon.png',
|
imgSrc: '/images/onboarding-journeys/Tutorials-Icon.png',
|
||||||
text: intl.formatMessage(messages.tutorialTitle),
|
text: intl.formatMessage(messages.tutorialTitle),
|
||||||
handleOnClick: () => openTutorial(onActivateDeck, tutorialIds.recordSound, driverObj)
|
handleOnClick: () => openTutorial(onActivateDeck, tutorials.recordSound, driverObj)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imgSrc: '/images/onboarding-journeys/Starter-Projects-Icon.png',
|
imgSrc: '/images/onboarding-journeys/Starter-Projects-Icon.png',
|
||||||
|
@ -420,7 +402,7 @@ const EditorJourney = ({onActivateDeck, setCanViewTutorialsHighlight}) => {
|
||||||
{
|
{
|
||||||
imgSrc: '/images/onboarding-journeys/Tutorials-Icon.png',
|
imgSrc: '/images/onboarding-journeys/Tutorials-Icon.png',
|
||||||
text: intl.formatMessage(messages.tutorialTitle),
|
text: intl.formatMessage(messages.tutorialTitle),
|
||||||
handleOnClick: () => openTutorial(onActivateDeck, tutorialIds.makeMusic, driverObj)
|
handleOnClick: () => openTutorial(onActivateDeck, tutorials.makeMusic, driverObj)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imgSrc: '/images/onboarding-journeys/Starter-Projects-Icon.png',
|
imgSrc: '/images/onboarding-journeys/Starter-Projects-Icon.png',
|
||||||
|
|
Loading…
Reference in a new issue