Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show Applab tutorial for students younger than 13 years #19293

Merged
merged 4 commits into from
Nov 20, 2017

Conversation

Erin007
Copy link
Contributor

@Erin007 Erin007 commented Nov 18, 2017

On /congrats when a signed-in student completes an Hour of Code, and we know they are younger than 13, we show them age-appropriate options, rather than promote the Applab tutorial.

Students younger than 13 who complete Minecraft will now see:
screen shot 2017-11-17 at 8 27 50 pm

pre2017 v. 2017 will still be customized in the last card.

Students younger than 13 who complete any other tutorial will now see:
screen shot 2017-11-17 at 8 19 15 pm

This change required passing userAge as a prop through the Congrats component and making a new MinecraftMarketing card (pictured above).

@Erin007
Copy link
Contributor Author

Erin007 commented Nov 18, 2017

cc: @tanyaparker

const desktop = (responsive.isResponsiveCategoryActive('lg') || responsive.isResponsiveCategoryActive('md'));

const headingStyle = desktop ? styles.heading : styles.mobileHeading;

var specificCardSet;
switch (true) {
case completedTutorialType === 'pre2017Minecraft' && isEnglish && under13:
specificCardSet = 'youngerThan13pre2017MinecraftCards';
break;
case completedTutorialType === 'pre2017Minecraft' && isEnglish:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you could be explicit about !under13 but that might not be necessary.

@caleybrock
Copy link
Contributor

If this is the image they approved then 👍 but the Minecraft image feels bolder/sharper with the gray bar like the graphic they have in previous years.

)
},
{
name: 'Other tutorial, English, student under 13',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 thank you for keeping all these cases clear in storybook

@@ -1,6 +1,8 @@
:ruby
require 'cdo/user_helpers'
congrats_data = {current_user: current_user}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is age not included in the current_user object?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

birthday is, but not age. Also, I learned from Poorva recently that birthday isn't really birthday, it's the date you made an account and the year of your birth calculated from the age associated with the account info at sign up. I just used the same helper that is used in the project gallery to determine age from birthday.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 good to know

@caleybrock
Copy link
Contributor

I think this will be a really positive change for users 💯

@Erin007 Erin007 merged commit 9482281 into staging Nov 20, 2017
@Erin007 Erin007 deleted the no-applab-for-under-thirteen branch November 20, 2017 17:46
@tanyaparker
Copy link
Contributor

fyi @poorvasingal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants