mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
tweak a few things before WIP PR
This commit is contained in:
parent
ae9c15f6ce
commit
25402113bf
5 changed files with 2 additions and 81 deletions
|
@ -60,7 +60,6 @@
|
|||
"lodash.defaultsdeep": "3.10.0",
|
||||
"lodash.merge": "3.3.2",
|
||||
"lodash.omit": "3.1.0",
|
||||
"lodash.pickby": "^4.4.0",
|
||||
"lodash.range": "3.0.1",
|
||||
"minilog": "2.0.8",
|
||||
"node-sass": "3.3.3",
|
||||
|
@ -74,7 +73,7 @@
|
|||
"react-modal": "1.3.0",
|
||||
"react-onclickoutside": "4.1.1",
|
||||
"react-redux": "4.4.5",
|
||||
"react-responsive": "^1.1.4",
|
||||
"react-responsive": "1.1.4",
|
||||
"react-slick": "0.12.2",
|
||||
"react-telephone-input": "3.4.5",
|
||||
"redux": "3.5.2",
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
var keyMirror = require('keymirror');
|
||||
var pickBy = require('lodash.pickBy');
|
||||
|
||||
var Types = {
|
||||
SET_STATE: 'splash/activity/SET_LAYOUT',
|
||||
SET_ERROR: 'splash/activity/SET_ERROR'
|
||||
};
|
||||
|
||||
function reducer (state, action) {
|
||||
if (typeof state === 'undefined') {
|
||||
state = reducer.getInitialState();
|
||||
}
|
||||
switch (action.type) {
|
||||
case Types.SET_STATE:
|
||||
return action.layout;
|
||||
case Types.SET_ERROR:
|
||||
return state;
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
reducer.Layouts = keyMirror({
|
||||
COLS4: null,
|
||||
COLS6: null,
|
||||
COLS8: null,
|
||||
COLS12: null
|
||||
});
|
||||
|
||||
reducer.mediaQueries = {
|
||||
COLS4: window.matchMedia('screen and (max-width: 479px)'),
|
||||
COLS6: window.matchMedia('screen and (min-width: 480px) and (max-width: 639px)'),
|
||||
COLS8: window.matchMedia('screen and (min-width: 640px) and (max-width: 941px)'),
|
||||
COLS12: window.matchMedia('screen and (min-width: 942px)')
|
||||
};
|
||||
|
||||
reducer.getInitialState = function () {
|
||||
return reducer.Layouts.COLS12;
|
||||
};
|
||||
|
||||
reducer.setLayout = function (layout) {
|
||||
return {
|
||||
type: Types.SET_STATE,
|
||||
layout: layout
|
||||
};
|
||||
};
|
||||
|
||||
reducer.setLayoutError = function (error) {
|
||||
return {
|
||||
type: Types.SET_ERROR,
|
||||
error: error
|
||||
};
|
||||
};
|
||||
|
||||
reducer.getLayout = function () {
|
||||
return function (dispatch) {
|
||||
var matched = pickBy(reducer.mediaQueries, function (value, key) { //eslint-disable-line
|
||||
return value.matches;
|
||||
});
|
||||
dispatch(reducer.setLayout(Object.keys(matched)[0]));
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = reducer;
|
|
@ -5,7 +5,6 @@ var detailsReducer = require('./conference-details.js').detailsReducer;
|
|||
var permissionsReducer = require('./permissions.js').permissionsReducer;
|
||||
var sessionReducer = require('./session.js').sessionReducer;
|
||||
var tokenReducer = require('./token.js').tokenReducer;
|
||||
// var layout = require('./layout.js');
|
||||
|
||||
var appReducer = combineReducers({
|
||||
session: sessionReducer,
|
||||
|
|
1
src/redux/session.json
Normal file
1
src/redux/session.json
Normal file
|
@ -0,0 +1 @@
|
|||
{ "user": { "id": 36977, "username": "technoboy10", "thumbnailUrl": "//cdn2.scratch.mit.edu/get_image/user/36977_32x32.png?v=1459545234.83", "dateJoined": "2007-08-25T16:43:03" }, "permissions": { "admin": false, "social": true, "educator": false, "student": false }, "flags": { "has_outstanding_email_confirmation": false, "show_welcome": true, "confirm_email_banner": true, "unsupported_browser_banner": true } }
|
|
@ -21,20 +21,6 @@
|
|||
"view": "guidelines/guidelines",
|
||||
"title": "Scratch Community Guidelines"
|
||||
},
|
||||
{
|
||||
"name": "student-complete-registration",
|
||||
"pattern": "^/classes/complete_registration",
|
||||
"routeAlias": "/classes/(complete_registration|.+/register/.+)",
|
||||
"view": "studentcompleteregistration/studentcompleteregistration",
|
||||
"title": "Complete your Registration"
|
||||
},
|
||||
{
|
||||
"name": "student-registration",
|
||||
"pattern": "^/classes/:id/register/:token",
|
||||
"routeAlias": "/classes/(complete_registration|.+/register/.+)",
|
||||
"view": "studentregistration/studentregistration",
|
||||
"title": "Class Registration"
|
||||
},
|
||||
{
|
||||
"name": "conference-index",
|
||||
"pattern": "^/conference/?$",
|
||||
|
|
Loading…
Reference in a new issue