Commit a9def9c1 authored by Technoboy10's avatar Technoboy10

tweak splash to not be terrible on mobile

parent b88b8c83
...@@ -6,6 +6,7 @@ var React = require('react'); ...@@ -6,6 +6,7 @@ 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');
...@@ -42,6 +43,12 @@ var Splash = injectIntl(React.createClass({ ...@@ -42,6 +43,12 @@ 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) {
...@@ -87,6 +94,9 @@ var Splash = injectIntl(React.createClass({ ...@@ -87,6 +94,9 @@ 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'
...@@ -439,7 +449,8 @@ var Splash = injectIntl(React.createClass({ ...@@ -439,7 +449,8 @@ 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
}; };
}; };
......
@import "../../frameless";
.splash { .splash {
.splash-header { .splash-header {
display: flex; display: flex;
...@@ -39,3 +41,32 @@ ...@@ -39,3 +41,32 @@
margin-bottom: 20px; margin-bottom: 20px;
} }
} }
//4 columns
@media only screen and (max-width: $mobile - 1) {
.splash {
.splash-header {
flex-wrap: wrap;
justify-content: center;
.box {
width: $cols4;
}
}
}
}
//6 columns
@media only screen and (min-width: $mobile) and (max-width: $tablet - 1) {
.splash {
.splash-header {
flex-wrap: wrap;
justify-content: center;
.box {
width: $cols6;
white-space: normal;
}
}
}
}
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