feat: uepr-12: Address comments

This commit is contained in:
Kaloyan Manolov 2024-10-22 18:46:47 +03:00
parent 731ca7a7b2
commit a8114679a1
6 changed files with 61 additions and 33 deletions

View file

@ -1,10 +1,12 @@
import React, {useCallback, useState, useEffect} from 'react';
import {CommunityGuidelines, communityGuidelines} from './community-guidelines.jsx';
import PropTypes from 'prop-types';
import {FormattedMessage, injectIntl} from 'react-intl';
import {FormattedMessage, useIntl} from 'react-intl';
const ReactModal = require('react-modal');
const CommunityGuidelinesModal = props => {
export const CommunityGuidelinesModal = props => {
useIntl();
const [currentPage, setCurrentPage] = useState(0);
const onNextPage = useCallback(() => setCurrentPage(currentPage + 1), [currentPage]);
const onBackPage = useCallback(() => setCurrentPage(currentPage - 1), [currentPage]);
@ -48,5 +50,3 @@ CommunityGuidelinesModal.propTypes = {
onComplete: PropTypes.func,
isOpen: PropTypes.bool
};
export const IntlCommunityGuidelinesModal = injectIntl(CommunityGuidelinesModal);

View file

@ -51,7 +51,7 @@ class WelcomeStep extends React.Component {
innerClassName="join-flow-inner-welcome-step"
nextButton={this.props.createProjectOnComplete ? (
<React.Fragment>
<FormattedMessage id="general.getStarted" />
<FormattedMessage id="registration.reviewGuidelines" />
<img
className="join-flow-next-button-arrow"
src="/svgs/project/r-arrow.svg"

View file

@ -1,4 +1,4 @@
import React, {useEffect} from 'react';
import React, {useEffect, useMemo} from 'react';
import Button from '../forms/button.jsx';
import {FormattedMessage} from 'react-intl';
import PropTypes from 'prop-types';
@ -13,21 +13,23 @@ const OnboardingNavigation = ({
onBackPage,
nextButtonText
}) => {
const dots = [];
useEffect(() => {
new Image().src = '/images/onboarding/right-arrow.svg';
new Image().src = '/images/onboarding/left-arrow.svg';
}, []);
if (currentPage >= 0 && totalDots){
for (let i = 0; i < totalDots; i++){
dots.push(<div
key={`dot page-${currentPage} ${i}`}
className={`dot ${currentPage === i && 'active'}`}
/>);
const dots = useMemo(() => {
const dotsComponents = [];
if (currentPage >= 0 && totalDots){
for (let i = 0; i < totalDots; i++){
dotsComponents.push(<div
key={`dot page-${currentPage} ${i}`}
className={`dot ${currentPage === i && 'active'}`}
/>);
}
}
}
return dotsComponents;
}, [currentPage, totalDots]);
return (
<div className="navigation">

View file

@ -225,6 +225,7 @@
"registration.personalStepDescription": "Your individual responses will not be displayed publicly, and will be kept confidential and secure",
"registration.private": "We will keep this information private.",
"registration.problemsAre": "The problems are:",
"registration.reviewGuidelines": "Review Community Guidelines",
"registration.selectCountry": "Select country",
"registration.startOverInstruction": "Click \"Start over.\"",
"registration.studentPersonalStepDescription": "This information will not appear on the Scratch website.",
@ -483,29 +484,29 @@
"communityGuidelines.buttons.back": "Back",
"communityGuidelines.buttons.next": "Next",
"communityGuidelines.buttons.finish": "I Understand",
"communityGuidelines.guidelines.respectSection": "Become a Scratcher - Treat everyone with respect",
"communityGuidelines.guidelines.respectHeader": "Scratchers treat everyone with respect.",
"communityGuidelines.buttons.finish": "I Agree",
"communityGuidelines.guidelines.respectSection": "Become a New Scratcher - Treat everyone with respect",
"communityGuidelines.guidelines.respectHeader": "New Scratchers treat everyone with respect.",
"communityGuidelines.guidelines.respectBody": "Everyone on Scratch is encouraged to share things that excite them and are important to them—we hope that you find ways to celebrate your own identity on Scratch, and allow others to do the same.",
"communityGuidelines.guidelines.safeSection": "Become a Scratcher - Be safe",
"communityGuidelines.guidelines.safeHeader": "Scratchers are safe: we keep personal and contact information private.",
"communityGuidelines.guidelines.safeSection": "Become a New Scratcher - Be safe",
"communityGuidelines.guidelines.safeHeader": "New Scratchers are safe: we keep personal and contact information private.",
"communityGuidelines.guidelines.safeBody": "This includes not sharing real last names, phone numbers, addresses, hometowns, school names, email addresses, usernames or links to social media sites, video chatting applications, or websites with private chat functionality.",
"communityGuidelines.guidelines.feedbackSection": "Become a Scratcher - Give helpful feedback",
"communityGuidelines.guidelines.feedbackHeader": "Scratchers give helpful feedback.",
"communityGuidelines.guidelines.feedbackSection": "Become a New Scratcher - Give helpful feedback",
"communityGuidelines.guidelines.feedbackHeader": "New Scratchers give helpful feedback.",
"communityGuidelines.guidelines.feedbackBody": "When commenting on a project, remember to say something you like about it, offer suggestions, and be kind, not critical.",
"communityGuidelines.guidelines.remix1Section": "Become a Scratcher - Embrace remix culture",
"communityGuidelines.guidelines.remix1Header": "Scratchers embrace remix culture.",
"communityGuidelines.guidelines.remix1Section": "Become a New Scratcher - Embrace remix culture",
"communityGuidelines.guidelines.remix1Header": "New Scratchers embrace remix culture.",
"communityGuidelines.guidelines.remix1Body": "Remixing is when you build upon someone elses projects, code, ideas, images, or anything else they share on Scratch to make your own unique creation.",
"communityGuidelines.guidelines.remix2Section": "Become a Scratcher - Embrace remix culture",
"communityGuidelines.guidelines.remix2Section": "Become a New Scratcher - Embrace remix culture",
"communityGuidelines.guidelines.remix2Header": "Remixing is a great way to collaborate and connect with other Scratchers.",
"communityGuidelines.guidelines.remix2Body": "You are encouraged to use anything you find on Scratch in your own creations, as long as you provide credit to everyone whose work you used and make a meaningful change to it. ",
"communityGuidelines.guidelines.remix3Section": "Become a Scratcher - Embrace remix culture",
"communityGuidelines.guidelines.remix3Section": "Become a New Scratcher - Embrace remix culture",
"communityGuidelines.guidelines.remix3Header": "Remixing means sharing with others.",
"communityGuidelines.guidelines.remix3Body": "When you share something on Scratch, you are giving permission to all Scratchers to use your work in their creations, too.",
"communityGuidelines.guidelines.honestSection": "Become a Scratcher - Be honest",
"communityGuidelines.guidelines.honestHeader": "Scratchers are honest.",
"communityGuidelines.guidelines.honestSection": "Become a New Scratcher - Be honest",
"communityGuidelines.guidelines.honestHeader": "New Scratchers are honest.",
"communityGuidelines.guidelines.honestBody": "Its important to be honest and authentic when interacting with others on Scratch, and remember that there is a person behind every Scratch account.",
"communityGuidelines.guidelines.friendlySection": "Become a Scratcher - Keep the site friendly",
"communityGuidelines.guidelines.friendlyHeader": "Scratchers help keep the site friendly.",
"communityGuidelines.guidelines.friendlySection": "Become a New Scratcher - Keep the site friendly",
"communityGuidelines.guidelines.friendlyHeader": "New Scratchers help keep the site friendly.",
"communityGuidelines.guidelines.friendlyBody": "Its important to keep your creations and conversations friendly and appropriate for all ages. If you think something on Scratch is mean, insulting, too violent, or otherwise disruptive to the community, click “Report” to let us know about it."
}

View file

@ -29,6 +29,31 @@
"becomeAScratcher.noInvitation.body": "To become a Scratcher, you must be active on Scratch for a while, share several projects, and comment constructively in the community. After a few weeks, you will receive a notification inviting you to become a Scratcher. Scratch on!",
"becomeAScratcher.finishLater.header": "No worries, take your time!",
"becomeAScratcher.finishLater.body": "By leaving this page, you will not finish the process to become a Scratcher and will stay as a New Scratcher. If you change your mind later, you can always come back via your profile page.",
"becomeAScratcher.finishLater.clickBecomeAScratcher": "Just click on “★ Become a Scratcher!” below your username."
"becomeAScratcher.finishLater.clickBecomeAScratcher": "Just click on “★ Become a Scratcher!” below your username.",
"communityGuidelines.guidelines.respectSection": "Become a Scratcher - Treat everyone with respect",
"communityGuidelines.guidelines.respectHeader": "Scratchers treat everyone with respect.",
"communityGuidelines.guidelines.respectBody": "Everyone on Scratch is encouraged to share things that excite them and are important to them—we hope that you find ways to celebrate your own identity on Scratch, and allow others to do the same.",
"communityGuidelines.guidelines.safeSection": "Become a Scratcher - Be safe",
"communityGuidelines.guidelines.safeHeader": "Scratchers are safe: we keep personal and contact information private.",
"communityGuidelines.guidelines.safeBody": "This includes not sharing real last names, phone numbers, addresses, hometowns, school names, email addresses, usernames or links to social media sites, video chatting applications, or websites with private chat functionality.",
"communityGuidelines.guidelines.feedbackSection": "Become a Scratcher - Give helpful feedback",
"communityGuidelines.guidelines.feedbackHeader": "Scratchers give helpful feedback.",
"communityGuidelines.guidelines.feedbackBody": "When commenting on a project, remember to say something you like about it, offer suggestions, and be kind, not critical.",
"communityGuidelines.guidelines.remix1Section": "Become a Scratcher - Embrace remix culture",
"communityGuidelines.guidelines.remix1Header": "Scratchers embrace remix culture.",
"communityGuidelines.guidelines.remix1Body": "Remixing is when you build upon someone elses projects, code, ideas, images, or anything else they share on Scratch to make your own unique creation.",
"communityGuidelines.guidelines.remix2Section": "Become a Scratcher - Embrace remix culture",
"communityGuidelines.guidelines.remix2Header": "Remixing is a great way to collaborate and connect with other Scratchers.",
"communityGuidelines.guidelines.remix2Body": "You are encouraged to use anything you find on Scratch in your own creations, as long as you provide credit to everyone whose work you used and make a meaningful change to it. ",
"communityGuidelines.guidelines.remix3Section": "Become a Scratcher - Embrace remix culture",
"communityGuidelines.guidelines.remix3Header": "Remixing means sharing with others.",
"communityGuidelines.guidelines.remix3Body": "When you share something on Scratch, you are giving permission to all Scratchers to use your work in their creations, too.",
"communityGuidelines.guidelines.honestSection": "Become a Scratcher - Be honest",
"communityGuidelines.guidelines.honestHeader": "Scratchers are honest.",
"communityGuidelines.guidelines.honestBody": "Its important to be honest and authentic when interacting with others on Scratch, and remember that there is a person behind every Scratch account.",
"communityGuidelines.guidelines.friendlySection": "Become a Scratcher - Keep the site friendly",
"communityGuidelines.guidelines.friendlyHeader": "Scratchers help keep the site friendly.",
"communityGuidelines.guidelines.friendlyBody": "Its important to keep your creations and conversations friendly and appropriate for all ages. If you think something on Scratch is mean, insulting, too violent, or otherwise disruptive to the community, click “Report” to let us know about it."
}

View file

@ -14,7 +14,7 @@ const Page = require('../../components/page/www/page.jsx');
const SplashPresentation = require('./presentation.jsx');
const {injectIntl} = require('react-intl');
const {
IntlCommunityGuidelinesModal
CommunityGuidelinesModal
} = require('../../components/community-guidelines/community-guidelines-modal.jsx');
const SCRATCH_WEEK_START_TIME = 1621224000000; // 2021-05-17 00:00:00 -- No end time for now
@ -203,7 +203,7 @@ class Splash extends React.Component {
const shouldReviewCommunityGuidelines = this.props.shouldReviewCommunityGuidelines;
return (<>
<IntlCommunityGuidelinesModal
<CommunityGuidelinesModal
isOpen={shouldReviewCommunityGuidelines && this.props.user.id}
userId={`${this.props.user.id}`}
onComplete={this.handleCommunityGuidelinesReview}