diff --git a/app/javascript/flavours/glitch/actions/compose.js b/app/javascript/flavours/glitch/actions/compose.js index a88dba1b13..c463871044 100644 --- a/app/javascript/flavours/glitch/actions/compose.js +++ b/app/javascript/flavours/glitch/actions/compose.js @@ -12,6 +12,7 @@ import { } from './timelines'; export const COMPOSE_CHANGE = 'COMPOSE_CHANGE'; +export const COMPOSE_CYCLE_ELEFRIEND = 'COMPOSE_CYCLE_ELEFRIEND'; export const COMPOSE_SUBMIT_REQUEST = 'COMPOSE_SUBMIT_REQUEST'; export const COMPOSE_SUBMIT_SUCCESS = 'COMPOSE_SUBMIT_SUCCESS'; export const COMPOSE_SUBMIT_FAIL = 'COMPOSE_SUBMIT_FAIL'; @@ -54,6 +55,12 @@ export function changeCompose(text) { }; }; +export function cycleElefriendCompose() { + return { + type: COMPOSE_CYCLE_ELEFRIEND, + }; +}; + export function replyCompose(status, router) { return (dispatch, getState) => { dispatch({ diff --git a/app/javascript/flavours/glitch/features/drawer/index.js b/app/javascript/flavours/glitch/features/drawer/index.js index ba56f1a30c..8f97190962 100644 --- a/app/javascript/flavours/glitch/features/drawer/index.js +++ b/app/javascript/flavours/glitch/features/drawer/index.js @@ -28,6 +28,7 @@ import { wrap } from 'flavours/glitch/util/redux_helpers'; const mapStateToProps = state => ({ account: state.getIn(['accounts', me]), columns: state.getIn(['settings', 'columns']), + elefriend: state.getIn(['compose', 'elefriend']), results: state.getIn(['search', 'results']), searchHidden: state.getIn(['search', 'hidden']), searchValue: state.getIn(['search', 'value']), @@ -56,6 +57,7 @@ class Drawer extends React.Component { const { account, columns, + elefriend, intl, multiColumn, onChange, @@ -69,10 +71,8 @@ class Drawer extends React.Component { submitted, } = this.props; - let choices = ['mbstobon-bg-1', 'mbstobon-bg-2', 'mbstobon-bg-3']; - let glitchyFriendDecision = choices[Math.floor(Math.random() * choices.length)]; - let drawerAttrs = { - className: classNames('contents', glitchyFriendDecision) + let elefriendAttrs = { + className: classNames('mastodon', 'mbstobon-' + elefriend), }; // The result. @@ -98,7 +98,7 @@ class Drawer extends React.Component {
- {multiColumn &&
} + {multiColumn &&
}
{ map.set('in_reply_to', action.status.get('id')); diff --git a/app/javascript/flavours/glitch/styles/components/drawer.scss b/app/javascript/flavours/glitch/styles/components/drawer.scss index 75b5d6b041..8526003bf7 100644 --- a/app/javascript/flavours/glitch/styles/components/drawer.scss +++ b/app/javascript/flavours/glitch/styles/components/drawer.scss @@ -66,8 +66,8 @@ .mastodon { flex: 1; - @for $i from 1 through 3 { - &.mbstobon-bg-#{$i} { + @for $i from 0 through 2 { + &.mbstobon-#{$i} { background: url("~flavours/glitch/images/mbstobon-ui-#{$i}.png") no-repeat left bottom / contain; } }