Commit daf803d4 authored by Technoboy10's avatar Technoboy10

experiment with the react-responsive library

parent 188841c7
...@@ -3,6 +3,7 @@ var FormattedMessage = require('react-intl').FormattedMessage; ...@@ -3,6 +3,7 @@ var FormattedMessage = require('react-intl').FormattedMessage;
var FooterBox = require('../container/footer.jsx'); var FooterBox = require('../container/footer.jsx');
var LanguageChooser = require('../../languagechooser/languagechooser.jsx'); var LanguageChooser = require('../../languagechooser/languagechooser.jsx');
var MediaQuery = require('react-responsive');
require('./footer.scss'); require('./footer.scss');
...@@ -11,7 +12,7 @@ var Footer = React.createClass({ ...@@ -11,7 +12,7 @@ var Footer = React.createClass({
render: function () { render: function () {
return ( return (
<FooterBox> <FooterBox>
{this.props.layout == 'COLS4' || this.props.layout == 'COLS6' ? [ <MediaQuery maxWidth={639}>
<div className="lists"> <div className="lists">
<dl> <dl>
<dd> <dd>
...@@ -48,7 +49,8 @@ var Footer = React.createClass({ ...@@ -48,7 +49,8 @@ var Footer = React.createClass({
</dd> </dd>
</dl> </dl>
</div> </div>
] : [ </MediaQuery>
<MediaQuery minWidth={640}>
<div className="lists"> <div className="lists">
<dl> <dl>
<dt> <dt>
...@@ -199,7 +201,7 @@ var Footer = React.createClass({ ...@@ -199,7 +201,7 @@ var Footer = React.createClass({
</dd> </dd>
</dl> </dl>
</div> </div>
]} </MediaQuery>
<LanguageChooser /> <LanguageChooser />
<div className="copyright"> <div className="copyright">
......
...@@ -17,6 +17,7 @@ var Login = require('../../login/login.jsx'); ...@@ -17,6 +17,7 @@ var Login = require('../../login/login.jsx');
var Modal = require('../../modal/modal.jsx'); var Modal = require('../../modal/modal.jsx');
var NavigationBox = require('../container/navigation.jsx'); var NavigationBox = require('../container/navigation.jsx');
var Registration = require('../../registration/registration.jsx'); var Registration = require('../../registration/registration.jsx');
var MediaQuery = require('react-responsive');
require('./navigation.scss'); require('./navigation.scss');
...@@ -248,8 +249,9 @@ var Navigation = React.createClass({ ...@@ -248,8 +249,9 @@ var Navigation = React.createClass({
<a className={dropdownClasses} <a className={dropdownClasses}
href="#" onClick={this.handleAccountNavClick}> href="#" onClick={this.handleAccountNavClick}>
<Avatar src={this.props.session.session.user.thumbnailUrl} alt="" /> <Avatar src={this.props.session.session.user.thumbnailUrl} alt="" />
{this.props.layout == 'COLS8' || this.props.layout == 'COLS12' ? <MediaQuery minWidth={640} component='span'>
this.props.session.session.user.username : ''} {this.props.session.session.user.username}
</MediaQuery>
</a> </a>
<Dropdown <Dropdown
as="ul" as="ul"
......
var React = require('react'); var React = require('react');
var connect = require('react-redux').connect;
var classNames = require('classnames'); var classNames = require('classnames');
var Navigation = require('../../navigation/www/navigation.jsx'); var Navigation = require('../../navigation/www/navigation.jsx');
...@@ -14,24 +13,17 @@ var Page = React.createClass({ ...@@ -14,24 +13,17 @@ var Page = React.createClass({
return ( return (
<div className="page"> <div className="page">
<div id="navigation" className={classes}> <div id="navigation" className={classes}>
<Navigation layout={this.props.layout}/> <Navigation/>
</div> </div>
<div id="view"> <div id="view">
{this.props.children} {this.props.children}
</div> </div>
<div id="footer"> <div id="footer">
<Footer layout={this.props.layout}/> <Footer/>
</div> </div>
</div> </div>
); );
} }
}); });
var mapStateToProps = function (state) { module.exports = Page;
return {
layout: state.layout
};
};
var ConnectedPage = connect(mapStateToProps)(Page);
module.exports = ConnectedPage;
...@@ -5,12 +5,11 @@ var detailsReducer = require('./conference-details.js').detailsReducer; ...@@ -5,12 +5,11 @@ var detailsReducer = require('./conference-details.js').detailsReducer;
var permissionsReducer = require('./permissions.js').permissionsReducer; var permissionsReducer = require('./permissions.js').permissionsReducer;
var sessionReducer = require('./session.js').sessionReducer; var sessionReducer = require('./session.js').sessionReducer;
var tokenReducer = require('./token.js').tokenReducer; var tokenReducer = require('./token.js').tokenReducer;
var layout = require('./layout.js'); // var layout = require('./layout.js');
var appReducer = combineReducers({ var appReducer = combineReducers({
session: sessionReducer, session: sessionReducer,
token: tokenReducer, token: tokenReducer,
layout: layout,
permissions: permissionsReducer, permissions: permissionsReducer,
conferenceSchedule: scheduleReducer, conferenceSchedule: scheduleReducer,
conferenceDetails: detailsReducer conferenceDetails: detailsReducer
......
...@@ -6,7 +6,6 @@ var React = require('react'); ...@@ -6,7 +6,6 @@ var React = require('react');
var api = require('../../lib/api'); var api = require('../../lib/api');
var render = require('../../lib/render.jsx'); var render = require('../../lib/render.jsx');
var sessionActions = require('../../redux/session.js'); var sessionActions = require('../../redux/session.js');
var layout = require('../../redux/layout.js');
var shuffle = require('../../lib/shuffle.js').shuffle; var shuffle = require('../../lib/shuffle.js').shuffle;
var Activity = require('../../components/activity/activity.jsx'); var Activity = require('../../components/activity/activity.jsx');
...@@ -43,12 +42,6 @@ var Splash = injectIntl(React.createClass({ ...@@ -43,12 +42,6 @@ var Splash = injectIntl(React.createClass({
permissions: {} permissions: {}
}; };
}, },
componentWillMount: function () {
this.props.dispatch(layout.getLayout());
for (var query in layout.mediaQueries) {
layout.mediaQueries[query].addListener(this.onResize);
}
},
componentDidUpdate: function (prevProps) { componentDidUpdate: function (prevProps) {
if (this.props.session.session.user != prevProps.session.session.user) { if (this.props.session.session.user != prevProps.session.session.user) {
if (this.props.session.session.user) { if (this.props.session.session.user) {
...@@ -94,9 +87,6 @@ var Splash = injectIntl(React.createClass({ ...@@ -94,9 +87,6 @@ var Splash = injectIntl(React.createClass({
} }
} }
}, },
onResize: function () {
this.props.dispatch(layout.getLayout());
},
getActivity: function () { getActivity: function () {
api({ api({
uri: '/proxy/users/' + this.props.session.session.user.username + '/activity?limit=5' uri: '/proxy/users/' + this.props.session.session.user.username + '/activity?limit=5'
...@@ -449,8 +439,7 @@ var Splash = injectIntl(React.createClass({ ...@@ -449,8 +439,7 @@ var Splash = injectIntl(React.createClass({
var mapStateToProps = function (state) { var mapStateToProps = function (state) {
return { return {
session: state.session, session: state.session,
permissions: state.permissions, permissions: state.permissions
layout: state.layout
}; };
}; };
......
...@@ -65,8 +65,17 @@ ...@@ -65,8 +65,17 @@
.box { .box {
width: $cols6; width: $cols6;
white-space: normal;
} }
} }
} }
} }
//6 columns
@media only screen and (min-width: $tablet) and (max-width: $desktop - 1) {
.splash {
.splash-header {
margin: 0 auto;
width: $cols8;
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment