0
0
Fork 0

Add responsive panels to the single-column layout (#10820)

* Add responsive panels to the single-column layout

* Fixes

* Fix not being able to save the preference

* Fix code style issues

* Set max-height on the compose textarea and add a link to relationship manager
This commit is contained in:
Eugen Rochko 2019-05-25 21:27:00 +02:00 committed by GitHub
parent 5cdb4c483f
commit 1e5532e693
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 389 additions and 96 deletions

View file

@ -63,6 +63,14 @@ const messages = defineMessages({
uploadErrorPoll: { id: 'upload_error.poll', defaultMessage: 'File upload not allowed with polls.' },
});
const COMPOSE_PANEL_BREAKPOINT = 600 + (285 * 1) + (10 * 3);
export const ensureComposeIsVisible = (getState, routerHistory) => {
if (!getState().getIn(['compose', 'mounted']) && window.innerWidth < COMPOSE_PANEL_BREAKPOINT) {
routerHistory.push('/statuses/new');
}
};
export function changeCompose(text) {
return {
type: COMPOSE_CHANGE,
@ -77,9 +85,7 @@ export function replyCompose(status, routerHistory) {
status: status,
});
if (!getState().getIn(['compose', 'mounted'])) {
routerHistory.push('/statuses/new');
}
ensureComposeIsVisible(getState, routerHistory);
};
};
@ -102,9 +108,7 @@ export function mentionCompose(account, routerHistory) {
account: account,
});
if (!getState().getIn(['compose', 'mounted'])) {
routerHistory.push('/statuses/new');
}
ensureComposeIsVisible(getState, routerHistory);
};
};
@ -115,9 +119,7 @@ export function directCompose(account, routerHistory) {
account: account,
});
if (!getState().getIn(['compose', 'mounted'])) {
routerHistory.push('/statuses/new');
}
ensureComposeIsVisible(getState, routerHistory);
};
};