From 5da297f0de8612480a1327c7692796a670812a2e Mon Sep 17 00:00:00 2001 From: tomlum Date: Tue, 30 Nov 2021 16:09:24 -0500 Subject: [PATCH] progress on onboarding --- src/routes.json | 7 ++ src/views/scratcher-onboarding/l10n.json | 0 .../scratcher-onboarding.jsx | 90 +++++++++++++++++++ .../scratcher-onboarding.scss | 56 ++++++++++++ 4 files changed, 153 insertions(+) create mode 100644 src/views/scratcher-onboarding/l10n.json create mode 100644 src/views/scratcher-onboarding/scratcher-onboarding.jsx create mode 100644 src/views/scratcher-onboarding/scratcher-onboarding.scss diff --git a/src/routes.json b/src/routes.json index 714ee1b86..5111e4b1b 100644 --- a/src/routes.json +++ b/src/routes.json @@ -239,6 +239,13 @@ "view": "scratch_1.4/scratch_1.4", "title": "Scratch 1.4" }, + { + "name": "scratcher-onboarding", + "pattern": "^/scratcher-onboarding/?$", + "routeAlias": "/scratcher-onboarding", + "view": "scratcher-onboarding/scratcher-onboarding", + "title": "Congratulations!" + }, { "name": "download-scratch2", "pattern": "^/download/scratch2/?(\\?.*)?$", diff --git a/src/views/scratcher-onboarding/l10n.json b/src/views/scratcher-onboarding/l10n.json new file mode 100644 index 000000000..e69de29bb diff --git a/src/views/scratcher-onboarding/scratcher-onboarding.jsx b/src/views/scratcher-onboarding/scratcher-onboarding.jsx new file mode 100644 index 000000000..55cd1aa6b --- /dev/null +++ b/src/views/scratcher-onboarding/scratcher-onboarding.jsx @@ -0,0 +1,90 @@ +import React, {useState} from 'react'; +const FormattedMessage = require('react-intl').FormattedMessage; +const render = require('../../lib/render.jsx'); + +const Button = require('../../components/forms/button.jsx'); +const Page = require('../../components/page/www/page.jsx'); +const Video = require('../../components/video/video.jsx'); + +require('./scratcher-onboarding.scss'); + +const OnboardingNavigation = ({page, totalPages}) => { + const dots = []; + + for (let i = 1; i < totalPages; i++){ + dots.push(
); + } + + return ( +
+ {dots} +
+ ); +}; + +const ScratcherOnboarding = ({name}) => { + const [page, setPage] = useState(1); + const totalPages = 9; + + const NextPage = () => { + setPage(Math.min(page + 1, totalPages)); + }; + const BackPage = () => { + setPage(Math.max(page - 1, 1)); + }; + + if (page === 1){ + return ( +
+
+ test +
+
+

Congratulations {name}! You have shown that you are ready to become a Scratcher.

+
+ Scratch is a friendly and welcoming community for everyone, where people create, share, and learn together. We welcome people of all ages, races, ethnicities, religions, abilities, sexual orientations, and gender identities. + The next few pages will take you through the community guidelines and explain what this means. +
+ { /* eslint-disable react/jsx-no-bind */ } + +
+
+ ); + } else if (page < 8) { + + return ( +
+
+ test +
+
+

Congratulations {name}! You have shown that you are ready to become a Scratcher.

+
+ Scratch is a friendly and welcoming community for everyone, where people create, share, and learn together. We welcome people of all ages, races, ethnicities, religions, abilities, sexual orientations, and gender identities. + The next few pages will take you through the community guidelines and explain what this means. +
+
+
+ { /* eslint-disable react/jsx-no-bind */ } + + + { /* eslint-disable react/jsx-no-bind */ } + +
+
+ ); + } + return (null); + +}; + +render(, document.getElementById('app')); diff --git a/src/views/scratcher-onboarding/scratcher-onboarding.scss b/src/views/scratcher-onboarding/scratcher-onboarding.scss new file mode 100644 index 000000000..48362af02 --- /dev/null +++ b/src/views/scratcher-onboarding/scratcher-onboarding.scss @@ -0,0 +1,56 @@ +@import "../../colors"; +@import "../../frameless"; + +body{ + background-color: white !important; +} +.onboarding { + display: flex; + height: 100vh; + background-color: white; + flex-direction: row; + line-height: 1.87rem; + + button{ + padding: .3em .9em; + } + + .dot{ + width: 5px; + height: 5px; + border: solid 2px black; + } + + .dot.active{ + background-color: red; + } + + @media #{$medium-and-smaller} { + flex-direction: column; + } + .left-art{ + background-color: #E9F1FC; + display: flex; + flex: 4; + @media #{$medium-and-smaller} { + flex: 12 + } + + @media #{$small} { + display: flex; + } + } + .right-content{ + flex: 8; + padding: 40px; + @media #{$medium-and-smaller} { + flex: 12; + } + + @media #{$small} { + p { + width: 300px; + } + } + } +}