mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-22 21:42:30 -05:00
move the intl stuff to playground
This commit is contained in:
parent
ac024c6c6b
commit
9521203e19
8 changed files with 21 additions and 11 deletions
|
@ -74,8 +74,8 @@ BrushMode.propTypes = {
|
|||
};
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
brushModeState: state.brushMode,
|
||||
isBrushModeActive: state.mode === Modes.BRUSH
|
||||
brushModeState: state.scratchPaint.brushMode,
|
||||
isBrushModeActive: state.scratchPaint.mode === Modes.BRUSH
|
||||
});
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
changeBrushSize: brushSize => {
|
||||
|
|
|
@ -70,8 +70,8 @@ EraserMode.propTypes = {
|
|||
};
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
eraserModeState: state.eraserMode,
|
||||
isEraserModeActive: state.mode === Modes.ERASER
|
||||
eraserModeState: state.scratchPaint.eraserMode,
|
||||
isEraserModeActive: state.scratchPaint.mode === Modes.ERASER
|
||||
});
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
changeBrushSize: brushSize => {
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
import PaintEditor from './containers/paint-editor.jsx';
|
||||
import ScratchPaintReducer from './reducers/scratch-paint-reducer';
|
||||
|
||||
export default PaintEditor;
|
||||
export {
|
||||
PaintEditor as default,
|
||||
ScratchPaintReducer
|
||||
};
|
||||
|
|
|
@ -3,8 +3,8 @@ import ReactDOM from 'react-dom';
|
|||
import PaintEditor from '..';
|
||||
import {Provider} from 'react-redux';
|
||||
import {createStore} from 'redux';
|
||||
import reducer from '../reducers/combine-reducers';
|
||||
import {intlInitialState, IntlProvider} from '../reducers/intl.js';
|
||||
import reducer from './reducers/combine-reducers';
|
||||
import {intlInitialState, IntlProvider} from './reducers/intl.js';
|
||||
|
||||
const appTarget = document.createElement('div');
|
||||
document.body.appendChild(appTarget);
|
||||
|
|
8
src/playground/reducers/combine-reducers.js
Normal file
8
src/playground/reducers/combine-reducers.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import {combineReducers} from 'redux';
|
||||
import intlReducer from './intl';
|
||||
import {ScratchPaintReducer} from '../..';
|
||||
|
||||
export default combineReducers({
|
||||
intl: intlReducer,
|
||||
scratchPaint: ScratchPaintReducer
|
||||
});
|
|
@ -2,7 +2,7 @@ import {addLocaleData} from 'react-intl';
|
|||
import {updateIntl as superUpdateIntl} from 'react-intl-redux';
|
||||
import {IntlProvider, intlReducer} from 'react-intl-redux';
|
||||
|
||||
import locales from '../locale.js';
|
||||
import locales from '../../locale.js';
|
||||
|
||||
Object.keys(locales).forEach(locale => {
|
||||
// TODO: will need to handle locales not in the default intl - see www/custom-locales
|
|
@ -1,11 +1,9 @@
|
|||
import {combineReducers} from 'redux';
|
||||
import intlReducer from './intl';
|
||||
import modeReducer from './modes';
|
||||
import brushModeReducer from './brush-mode';
|
||||
import eraserModeReducer from './eraser-mode';
|
||||
|
||||
export default combineReducers({
|
||||
intl: intlReducer,
|
||||
mode: modeReducer,
|
||||
brushMode: brushModeReducer,
|
||||
eraserMode: eraserModeReducer
|
Loading…
Reference in a new issue