diff --git a/package-lock.json b/package-lock.json index 6cb9f3301..07ba06808 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22194,7 +22194,6 @@ "resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-5.1.0.tgz", "integrity": "sha512-OpFwrtKBQxgP5cQB6QDnugNW7ahGRp9bVaDDF0NIoP+4vZJxVSGJ7vRRSwvrc0qLl4PfZ5AEj70CBFJyVbLUow==", "dev": true, - "license": "AGPL-3.0-only", "dependencies": { "@microbit/microbit-universal-hex": "^0.2.2", "arraybuffer-loader": "^1.0.6", diff --git a/src/_colors.scss b/src/_colors.scss index ad8b3a916..618200b01 100644 --- a/src/_colors.scss +++ b/src/_colors.scss @@ -25,11 +25,15 @@ $background-color: hsla(0, 0%, 99%, 1); //#FDFDFD $motion-blue-3: hsla(215, 60%, 50%, 1);//#3373CC +$ui-light-blue: hsla(195, 63%, 86%, 1); //#C5E7f2 +$ui-cyan-blue: hsla(194, 73%, 36%, 1); //#19809F + /* UI Secondary Colors */ /* 3.0 colors */ /* Using www naming convention for now, should be consistent with gui */ $ui-aqua: hsla(144, 45%, 36%, 1); $ui-aqua-dark: darken($ui-aqua, 10%); +$ui-purple-light: hsla(260, 100%, 88%, 1); // #DACEF3 $ui-purple: hsla(260, 100%, 70%, 1); // #9966FF Looks Primary $ui-purple-dark: hsla(260, 60%, 60%, 1); // #855CD6 Looks Secondary $ui-purple-darker: hsla(260, 46%, 54%, 1); @@ -37,6 +41,7 @@ $ui-purple-10percent: hsla(260, 60%, 60%, .1); $ui-purple-25percent: hsla(260, 60%, 60%, .25); $ui-magenta: hsla(300, 53%, 60%, 1); /* #CF63CF Sounds Primary */ $ui-magenta-dark: hsla(300, 48%, 50%, 1); /* #BD42BD Sounds Tertiary */ +$ui-light-grayish-blue: hsla(215, 76%, 95%, 1); $ui-yellow: hsla(45, 100%, 50%, 1); // #FFBF00 Events Primary $ui-coral: hsla(350, 100%, 70%, 1); // #FF6680 More Blocks Primary @@ -48,6 +53,7 @@ $ui-light-primary: hsl(215, 100%, 95%); $ui-light-primary-transparent: hsla(215, 100%, 95%, 0); $ui-border: hsla(0, 0%, 85%, 1); //#D9D9D9 +$ui-border-light-blue: hsla(215, 50%, 90%, 1); //#D9E3F2 /* modals */ $ui-mint-green: hsl(163, 69%, 44%); @@ -59,6 +65,7 @@ $active-dark-gray: hsla(0, 0%, 0%, .2); $box-shadow-gray: hsla(0, 0%, 0%, .25); $box-shadow-light-gray: hsla(0, 0%, 0%, .15); $overlay-gray: hsla(0, 0%, 0%, .75); +$gray-50: hsla(226, 15%, 97%, 1); $transparent-light-blue: rgba(229, 240, 254, 0); /* Typography Colors */ diff --git a/src/components/adminpanel/adminpanel.jsx b/src/components/adminpanel/adminpanel.jsx index 926a7a4f5..3649348ff 100644 --- a/src/components/adminpanel/adminpanel.jsx +++ b/src/components/adminpanel/adminpanel.jsx @@ -11,7 +11,7 @@ const AdminPanel = ({ onOpen, onClose }) => ( -
+
{isOpen ? ( {}}) => { + const [currentPage, setCurrentPage] = useState(0); + const intl = useIntl(); + const onNextPage = useCallback(() => { + if (currentPage < GUIDES_SECTIONS.length - 1) { + setCurrentPage(currentPage + 1); + } + }, [currentPage]); + const onBackPage = useCallback(() => { + if (currentPage > 0) { + setCurrentPage(currentPage - 1); + } + }, [currentPage]); + + if (!isOpen) return null; + return ( + +
+
+ +
+
+
+ +
+
+ +
+ {GUIDES_SECTIONS[currentPage].cards.map(card => ( +
+ + + + +
+ ))} +
+
+ +
+ ); +}; + +CardsModal.propTypes = { + isOpen: PropTypes.bool, + onClose: PropTypes.func +}; diff --git a/src/components/cards-modal/cards-modal.scss b/src/components/cards-modal/cards-modal.scss new file mode 100644 index 000000000..1927285ef --- /dev/null +++ b/src/components/cards-modal/cards-modal.scss @@ -0,0 +1,150 @@ +@import "../../colors"; +@import "../../frameless"; + +.cards-modal-overlay { + display: flex; + justify-content: center; + align-items: center; + + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 510; + + background-color: $box-shadow-light-gray; + border-color: unset; +} + +.cards-modal-container { + display: flex; + flex-direction: column; + + background: white; + border-radius: 8px; + width: 640px; + + box-shadow: 0 0 0 4px $ui-blue-25percent; + + &:focus { + outline: none; + border: none; + } + + .cards-modal-header { + display: flex; + justify-content: space-between; + align-items: center; + + padding: 10px; + background-color: $ui-blue; + border-radius: 8px 8px 0 0; + + .cards-title { + font-size: 1rem; + font-weight: 700; + line-height: 1.25rem; + color: $ui-white; + margin-left: auto; + margin-right: auto; + } + + .close-button { + position: unset; + margin: 0; + } + } + + .cards-modal-section-title { + text-align: center; + vertical-align: middle; + + color: $header-gray; + font-size: 1.5rem; + font-weight: 700; + line-height: 2rem; + + padding: 0.5rem 0; + margin: 0.75rem 0 + } + + .cards-modal-section-content { + display: flex; + flex-wrap: wrap; + justify-content: center; + align-items: center; + margin: 0 1.25rem; + gap: 1.25rem; + + .section-img { + width: 200px; + } + + .cards-modal-cards-list { + flex: 1; + + .card { + display: flex; + justify-content: space-between; + align-items: center; + + font-size: 0.875rem; + font-weight: 500; + + + .button { + display: flex; + justify-content: center; + align-items: center; + width: 2rem; + height: 2rem; + } + } + + .card + .card { + border-top: 1px solid $box-shadow-light-gray; + } + } + } + + .cards-modal-navigation { + justify-content: center; + align-items: center; + margin: 1.75rem 0; + + .navigation-button { + padding: 0; + margin: 0 1rem; + } + + .dotRow{ + width: 32px; + height: 16px; + gap: 0.5rem; + } + + .dot{ + width: 8px; + height: 8px; + background-color: transparent; + border: 2px solid $ui-blue; + } + + .active{ + background-color: $ui-blue; + box-shadow: 0 0 0 4px $ui-blue-25percent; + } + } +} + +.cards-modal-container:focus { + outline: none; + border: none; +} + +@media only screen and (max-width: $mobileIntermediate) { + .cards-modal-container { + width: 100%; + } +} \ No newline at end of file diff --git a/src/components/community-guidelines/community-guidelines-modal.jsx b/src/components/community-guidelines/community-guidelines-modal.jsx index 13e78cde8..2ea0420c3 100644 --- a/src/components/community-guidelines/community-guidelines-modal.jsx +++ b/src/components/community-guidelines/community-guidelines-modal.jsx @@ -36,13 +36,25 @@ export const CommunityGuidelinesModal = props => { : - null} + onNextPage={ + currentPage < communityGuidelines.length - 1 ? + onNextPage : + onComplete + } + nextButtonText={ + currentPage === communityGuidelines.length - 1 ? ( + + ) : ( + + ) + } + prevButtonText={ + + } onBackPage={currentPage > 0 ? onBackPage : null} /> - ); + + ); }; CommunityGuidelinesModal.propTypes = { diff --git a/src/components/community-guidelines/community-guidelines.jsx b/src/components/community-guidelines/community-guidelines.jsx index fa7252c4e..5e6644d46 100644 --- a/src/components/community-guidelines/community-guidelines.jsx +++ b/src/components/community-guidelines/community-guidelines.jsx @@ -1,7 +1,7 @@ import React, {useEffect} from 'react'; import {FormattedMessage} from 'react-intl'; import thumbnailUrl from '../../lib/user-thumbnail.js'; -import OnboardingNavigation from '../onboarding-navigation/onboarding-navigation.jsx'; +import ModalNavigation from '../modal-navigation/modal-navigation.jsx'; import './community-guidelines.scss'; import PropTypes from 'prop-types'; @@ -65,6 +65,7 @@ export const CommunityGuidelines = ({ userId, currentPage, nextButtonText, + prevButtonText, onNextPage, onBackPage }) => { @@ -108,10 +109,11 @@ export const CommunityGuidelines = ({
)}
- @@ -123,7 +125,8 @@ CommunityGuidelines.propTypes = { currentPage: PropTypes.number, userId: PropTypes.string, constructHeader: PropTypes.func, - nextButtonText: PropTypes.string, + nextButtonText: PropTypes.node, + prevButtonText: PropTypes.node, onNextPage: PropTypes.func, onBackPage: PropTypes.func }; diff --git a/src/components/forms/button.scss b/src/components/forms/button.scss index db7be8f33..aaf71b7e7 100644 --- a/src/components/forms/button.scss +++ b/src/components/forms/button.scss @@ -39,6 +39,10 @@ $pass-bg: $ui-aqua; box-shadow: none; } + &.transparent { + background-color: transparent; + } + &.large { border-radius: .25rem; font-size: 1rem; diff --git a/src/components/intro/intro.jsx b/src/components/intro/intro.jsx index a9d31fd19..6c03a17f9 100644 --- a/src/components/intro/intro.jsx +++ b/src/components/intro/intro.jsx @@ -3,6 +3,8 @@ const connect = require('react-redux').connect; const PropTypes = require('prop-types'); const React = require('react'); +const classnames = require('classnames'); + const navigationActions = require('../../redux/navigation.js'); const Video = require('../video/video.jsx'); @@ -52,13 +54,8 @@ class Intro extends React.Component { - {this.state.videoOpen ? + {!this.state.videoOpen && ( -