Skip to content

Commit

Permalink
hide 'Make your own app' from embed view for young students
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsbailey committed Sep 8, 2017
1 parent 088d634 commit 538bd29
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions apps/src/StudioApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2819,6 +2819,9 @@ StudioApp.prototype.setPageConstants = function (config, appSpecificConstants) {
inputOutputTable: config.level.inputOutputTable,
is13Plus: config.is13Plus,
isSignedIn: config.isSignedIn,
// The user is signed in, under 13, and does not have a teacher that has
// accepted the terms of service.
isTooYoung: !!config.isTooYoung,
textToSpeechEnabled: config.textToSpeechEnabled,
isK1: config.level.isK1,
appType: config.app,
Expand Down
7 changes: 4 additions & 3 deletions apps/src/applab/applab.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ function shouldRenderFooter() {
return studioApp().share;
}

Applab.makeFooterMenuItems = function (isIframeEmbed) {
Applab.makeFooterMenuItems = function (isIframeEmbed, isTooYoung) {
const footerMenuItems = [
window.location.search.indexOf('nosource') < 0 && {
text: i18n.t('footer.how_it_works'),
link: project.getProjectUrl('/view'),
newWindow: true,
},
isIframeEmbed && !dom.isMobile() && {
isIframeEmbed && !dom.isMobile() && !isTooYoung && {
text: applabMsg.makeMyOwnApp(),
link: '/projects/applab/new',
},
Expand Down Expand Up @@ -199,8 +199,9 @@ function renderFooterInSharedGame() {
divApplab.parentNode.insertBefore(footerDiv, divApplab.nextSibling);

const isIframeEmbed = getStore().getState().pageConstants.isIframeEmbed;
const isTooYoung = getStore().getState().pageConstants.isTooYoung;

const menuItems = Applab.makeFooterMenuItems(isIframeEmbed);
const menuItems = Applab.makeFooterMenuItems(isIframeEmbed, isTooYoung);

ReactDOM.render(
<SmallFooter
Expand Down
1 change: 1 addition & 0 deletions apps/src/redux/pageConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ var ALLOWED_KEYS = new Set([
'nonResponsiveVisualizationColumnWidth',
'is13Plus',
'isSignedIn',
'isTooYoung',
'isK1',
'textToSpeechEnabled',
'documentationUrl',
Expand Down

0 comments on commit 538bd29

Please sign in to comment.