diff --git a/src/views/studio/studio.jsx b/src/views/studio/studio.jsx index f345b4da7..51054bbc5 100644 --- a/src/views/studio/studio.jsx +++ b/src/views/studio/studio.jsx @@ -8,8 +8,7 @@ import { } from 'react-router-dom'; import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import {FormattedMessage, injectIntl, intlShape} from 'react-intl'; -import {isRtl} from 'scratch-l10n'; + import Page from '../../components/page/www/page.jsx'; import render from '../../lib/render.jsx'; @@ -35,21 +34,20 @@ import './studio.scss'; import {selectIsAdmin, selectMuteStatus} from '../../redux/session.js'; import {formatRelativeTime} from '../../lib/format-time.js'; import CommentingStatus from '../../components/commenting-status/commenting-status.jsx'; +import {FormattedMessage} from 'react-intl'; import {selectShowCuratorMuteError} from '../../redux/studio-permissions.js'; -export const StudioShell = ({intl, isAdmin, showCuratorMuteError, muteExpiresAtMs, studioLoadFailed, onLoadInfo}) => { +const StudioShell = ({isAdmin, showCuratorMuteError, muteExpiresAtMs, studioLoadFailed, onLoadInfo}) => { const match = useRouteMatch(); + useEffect(() => { onLoadInfo(); }, [isAdmin]); // Reload any time isAdmin changes to allow admins to view deleted studios - + return ( studioLoadFailed ? : -
+
@@ -100,7 +98,6 @@ export const StudioShell = ({intl, isAdmin, showCuratorMuteError, muteExpiresAtM }; StudioShell.propTypes = { - intl: intlShape, isAdmin: PropTypes.bool, showCuratorMuteError: PropTypes.bool, muteExpiresAtMs: PropTypes.number, @@ -120,8 +117,6 @@ const ConnectedStudioShell = connect( } )(StudioShell); -const IntlConnectedStudioShell = injectIntl(ConnectedStudioShell); - render( @@ -129,7 +124,7 @@ render( {/* Use variable studioPath to support /studio-playground/ or future route */} - + diff --git a/test/unit/views/studio.test.jsx b/test/unit/views/studio.test.jsx deleted file mode 100644 index f4c8c1a66..000000000 --- a/test/unit/views/studio.test.jsx +++ /dev/null @@ -1,39 +0,0 @@ -const React = require('react'); -const {shallow} = require('enzyme'); -import {StudioShell} from '../../../src/views/studio/studio.jsx'; - -jest.mock('react-dom', () => ({ - render: jest.fn() -})); - -jest.mock('react-router-dom', () => ({ - useRouteMatch: jest.fn(() => ({path: ''})) -})); - -describe('Studio', () => { - test('dir is RTL when locale is rtl', () => { - const component = shallow( - - ); - - const studioShell = component.find('div.studio-shell'); - expect(studioShell.prop('dir')).toEqual('rtl'); - }); - - test('dir is LTR when locale is ltr', () => { - const component = shallow( - - ); - - const studioShell = component.find('div.studio-shell'); - expect(studioShell.prop('dir')).toBeNull(); - }); -});