From 3268232a2b301587d653116aa854c748981e1cbe Mon Sep 17 00:00:00 2001 From: tomlum Date: Mon, 10 Jul 2023 16:08:16 -0400 Subject: [PATCH] deletes comments and old files --- .../bad-username-splash.jsx | 4 - src/views/banned-splash/banned-splash.jsx | 213 ------------------ src/views/banned-splash/banned-splash.scss | 125 ---------- src/views/banned-splash/blocked-account.svg | 3 - 4 files changed, 345 deletions(-) delete mode 100644 src/views/banned-splash/banned-splash.jsx delete mode 100644 src/views/banned-splash/banned-splash.scss delete mode 100644 src/views/banned-splash/blocked-account.svg diff --git a/src/views/bad-username-splash/bad-username-splash.jsx b/src/views/bad-username-splash/bad-username-splash.jsx index 8b9d99adb..170c9a499 100644 --- a/src/views/bad-username-splash/bad-username-splash.jsx +++ b/src/views/bad-username-splash/bad-username-splash.jsx @@ -1,6 +1,4 @@ const injectIntl = require('react-intl').injectIntl; -// const intlShape = require('react-intl').intlShape; -// const FormattedMessage = require('react-intl').FormattedMessage; const React = require('react'); const FormattedMessage = require('react-intl').FormattedMessage; import {connect} from 'react-redux'; @@ -159,8 +157,6 @@ const BannedSplash = ({hasSession, user, adminMessages, getAdminMessages}) => { name="newUsername" placeholder={'Type your new username'} spellCheck={false} - // toolTip={this.state.focused === 'username' && !touched.username && - // this.props.intl.formatMessage({id: 'registration.usernameAdviceShort'})} validationClassName="validation-left validation-full-width-input" /* eslint-disable react/jsx-no-bind */ onChange={e => { diff --git a/src/views/banned-splash/banned-splash.jsx b/src/views/banned-splash/banned-splash.jsx deleted file mode 100644 index ba79354f7..000000000 --- a/src/views/banned-splash/banned-splash.jsx +++ /dev/null @@ -1,213 +0,0 @@ -/* eslint-disable */ -const injectIntl = require('react-intl').injectIntl; -// const intlShape = require('react-intl').intlShape; -// const FormattedMessage = require('react-intl').FormattedMessage; -const React = require('react'); -import {connect} from 'react-redux'; -import {selectBannedUser, selectHasFetchedSession} from '../../redux/session'; -const messageActions = require('../../redux/messages.js'); -const JoinFlowStep = require('../../components/join-flow/join-flow-step.jsx'); -const FormikInput = require('../../components/formik-forms/formik-input.jsx'); -import {Formik} from 'formik'; -const PropTypes = require('prop-types'); - -const Page = require('../../components/page/www/page.jsx'); -const render = require('../../lib/render.jsx'); -import bannedIcon from './blocked-account.svg'; - -require('../../components/extension-landing/extension-landing.scss'); -require('./banned-splash.scss'); - -const validateUsernameConfirm = (username, usernameConfirm) => { - if (!usernameConfirm) { - // return 'Username is required'; - } else if (username !== usernameConfirm) { - return "Usernames don't match"; - } -}; - -const BannedSplash = ({hasSession, user, adminMessages, getAdminMessages}) => { - - React.useEffect(() => { - if (user && user.username && user.token){ - getAdminMessages(user.username, user.token); - } - }, [user]); - - if (hasSession && (!user || !user.banned)){ - window.location = '/'; - } - - if (user && user.banned){ - return (
-
-
-
- - -

Account Blocked

-
-

To recover access to your account, change your username.

-

Your scratch account {user && user.username} has been temporarily blocked because your usernamed appears to contain personal information.

-

This is a serious privacy issue. When you share information like this, it is visible to everyone on the internet, so please be careful what you share

-

When creating an username, please remember to avoid using last names, school names, or other private information in your username.

-
-
- - {({ - errors, - // handleSubmit, - // isSubmitting, - setFieldError, - setFieldTouched, - setFieldValue, - // touched, - validateField, - values - }) => { - return ( - Make sure the username you chose is aligned with Scratch's Community Guidelines} - innerClassName="change-username-inner" - outerClassName="change-username-outer" - title={'Change your Username'} - // waiting={isSubmitting} - // onSubmit={handleSubmit} - nextButton={'Change'} - > -
- validateUsername(newUsername)} - validationClassName="validation-left validation-full-width-input" - /* eslint-disable react/jsx-no-bind */ - onBlur={() => validateField('newUsername')} - onChange={e => { - setFieldValue('newUsername', e.target.value.substring(0, 30)); - setFieldTouched('newUsername'); - setFieldError('newUsername', null); - }} - // onFocus={() => this.handleFocused('username')} - /* eslint-enable react/jsx-no-bind */ - // onSetRef={this.handleSetUsernameRef} - /> - validateUsernameConfirm(values.newUsername, newUsernameConfirm)} - validationClassName="validation-left validation-full-width-input" - onBlur={() => { - validateField('newUsernameConfirm'); - }} - onChange={e => { - setFieldValue('newUsernameConfirm', e.target.value.substring(0, 30)); - setFieldTouched('newUsernameConfirm'); - setFieldError('newUsernameConfirm', null); - }} - /* eslint-enable react/jsx-no-bind */ - // onSetRef={this.handleSetUsernameRef} - /> -
-
); - }} -
-
-
-
-
-
- Here are your past admin notifications -
- {adminMessages.map(message => ( -
-
- {new Date(message.datetime_created).toDateString()} -
- {/* // eslint-disable-next-line react/no-danger */} -
-
- ))} -
-
- ); - } - return
; -}; - -BannedSplash.propTypes = { - user: PropTypes.shape({ - username: PropTypes.string, - banned: PropTypes.bool, - token: PropTypes.string - }), - hasSession: PropTypes.bool, - adminMessages: PropTypes.arrayOf(PropTypes.shape({ - id: PropTypes.number.isRequired, - datetimeCreated: PropTypes.string.isRequired, - message: PropTypes.string.isRequired - })), - getAdminMessages: PropTypes.func -}; - - -// LET SESSION MAKE BANNED BE A STRING THAT SAYS THE KIND OF BANNED -// THIS IS AN API CHANGE ON THE SESSION -const ConnectedBannedSplash = connect( - state => ({ - user: selectBannedUser(state), - hasSession: selectHasFetchedSession(state), - adminMessages: state.messages.messages && state.messages.messages.admin - }), - dispatch => ({ - getAdminMessages: (username, token) => { - dispatch(messageActions.getAdminMessages( - username, token, 0 - )); - } - }) -)(BannedSplash); - - -const WrappedBannedSplash = injectIntl(ConnectedBannedSplash); - -render(, document.getElementById('app'), - {messages: messageActions.messagesReducer}); diff --git a/src/views/banned-splash/banned-splash.scss b/src/views/banned-splash/banned-splash.scss deleted file mode 100644 index 9868892d8..000000000 --- a/src/views/banned-splash/banned-splash.scss +++ /dev/null @@ -1,125 +0,0 @@ -@import "../../colors"; -@import "../../frameless"; - -.validation-left { - transform: translate(-20.5rem, 0); -} - -@media #{$intermediate-and-smaller} { - .validation-full-width-input { - box-sizing: border-box; - transform: unset; - margin-bottom: .75rem; - max-width: 100%; - } -} - -.inline{ - display:inline; -} - -#banned-splash{ - display: flex; - flex-direction: column; - align-items: center; -} - -#force-account-rename{ - width: 100%; - display: flex; - justify-content: center; - - #force-account-rename-inner{ - max-width: 1094px; - display: flex; - flex-direction: row; - @media only screen and (max-width: 800px) { - flex-direction: column; - } - - text-align: left; - - input{ - box-sizing: border-box; - width: 100%; - } - } - background-color: #575E75; - .col{ - padding: 40px; - flex: 1; - } -} - - -#admin-message-list{ - display: inline-block; - padding: 25px; - max-width: 1094px; - - #admin-message-list-title{ - text-align: left; - } -} - -.admin-message{ - text-align: left; - .admin-message-date{ - color: #575E75; - font-size: 12px; - padding-bottom: 10px; - } - text-align: left; - border-radius: 8px; - padding: 16px; - background-color: #E5F0FF; - margin: 10px; -} - -#force-account-rename-text{ - h1, h3, p{ - color: white; - } -} - -.empty{ - text-align: left; - - .admin-message{ - margin: 10px; - } -} - -.banned-message-box{ - margin: 20px; - text-align: left; -} - -.join-flow-outer-content{ - background-color: white; - border-radius: 16px; - color: #575e75; - max-width: 468px; - min-height: auto !important; - @media only screen and (max-width: 800px) { - margin: auto; - } -} - -.banned-icon{ - margin-right: 10px; - padding-top: 10px; - margin-bottom: -3px; -} - -.modal-flush-bottom-button{ - background-color: #855CD6; -} -.modal-flush-bottom-button:hover{ - background-color: #855CD6; -} - -.join-flow-outer-content{ - border: solid 4px #818698; - border-radius: 21px; -} \ No newline at end of file diff --git a/src/views/banned-splash/blocked-account.svg b/src/views/banned-splash/blocked-account.svg deleted file mode 100644 index 897a34da9..000000000 --- a/src/views/banned-splash/blocked-account.svg +++ /dev/null @@ -1,3 +0,0 @@ - - -