]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Display customized mascot in web UI
authorThibaut Girka <thib@sitedethib.com>
Wed, 19 Dec 2018 19:23:16 +0000 (20:23 +0100)
committerThibG <thib@sitedethib.com>
Thu, 20 Dec 2018 17:39:05 +0000 (18:39 +0100)
Port relevant parts of 9d4541c612b506889675c4c19ced5cd17ad3710f to glitch-soc

app/javascript/flavours/glitch/features/drawer/index.js
app/javascript/flavours/glitch/util/initial_state.js

index ffb18c5a06fad7a40aa212117de822ef71dc8a52..c8121b8e559fba0132b1524e0225eceba21d59d8 100644 (file)
@@ -23,7 +23,7 @@ import DrawerResults from './results';
 import DrawerSearch from './search';
 
 //  Utils.
-import { me } from 'flavours/glitch/util/initial_state';
+import { me, mascot } from 'flavours/glitch/util/initial_state';
 import { wrap } from 'flavours/glitch/util/redux_helpers';
 
 //  Messages.
@@ -127,7 +127,7 @@ class Drawer extends React.Component {
             <Composer />
             {multiColumn && (
               <div className='drawer__inner__mastodon'>
-                <button className='mastodon' onClick={onClickElefriend} />
+                {mascot ? <img alt='' draggable='false' src={mascot} /> : <button className='mastodon' onClick={onClickElefriend} />}
               </div>
             )}
           </div>}
index d12c05c0d3fb9e5f39ecbcc006cab89e91c73234..a3c65563c2f42ec98e3de72fa18995aec964172e 100644 (file)
@@ -24,6 +24,7 @@ export const searchEnabled = getMeta('search_enabled');
 export const maxChars = (initialState && initialState.max_toot_chars) || 500;
 export const invitesEnabled = getMeta('invites_enabled');
 export const version = getMeta('version');
+export const mascot = getMeta('mascot');
 export const isStaff = getMeta('is_staff');
 
 export default initialState;