@ -60,7 +60,6 @@ import { HotKeys } from 'react-hotkeys';
import initialState , { me , owner , singleUserMode , showTrends , trendsAsLanding } from '../../initial_state' ;
import initialState , { me , owner , singleUserMode , showTrends , trendsAsLanding } from '../../initial_state' ;
import { closeOnboarding , INTRODUCTION _VERSION } from 'flavours/glitch/actions/onboarding' ;
import { closeOnboarding , INTRODUCTION _VERSION } from 'flavours/glitch/actions/onboarding' ;
import { defineMessages , FormattedMessage , injectIntl } from 'react-intl' ;
import { defineMessages , FormattedMessage , injectIntl } from 'react-intl' ;
import { Helmet } from 'react-helmet' ;
import Header from './components/header' ;
import Header from './components/header' ;
/ / D u m m y i m p o r t , t o m a k e s u r e t h a t < S t a t u s / > e n d s u p i n t h e a p p l i c a t i o n b u n d l e .
/ / D u m m y i m p o r t , t o m a k e s u r e t h a t < S t a t u s / > e n d s u p i n t h e a p p l i c a t i o n b u n d l e .
@ -76,10 +75,8 @@ const mapStateToProps = state => ({
hasComposingText : state . getIn ( [ 'compose' , 'text' ] ) . trim ( ) . length !== 0 ,
hasComposingText : state . getIn ( [ 'compose' , 'text' ] ) . trim ( ) . length !== 0 ,
hasMediaAttachments : state . getIn ( [ 'compose' , 'media_attachments' ] ) . size > 0 ,
hasMediaAttachments : state . getIn ( [ 'compose' , 'media_attachments' ] ) . size > 0 ,
canUploadMore : ! state . getIn ( [ 'compose' , 'media_attachments' ] ) . some ( x => [ 'audio' , 'video' ] . includes ( x . get ( 'type' ) ) ) && state . getIn ( [ 'compose' , 'media_attachments' ] ) . size < 4 ,
canUploadMore : ! state . getIn ( [ 'compose' , 'media_attachments' ] ) . some ( x => [ 'audio' , 'video' ] . includes ( x . get ( 'type' ) ) ) && state . getIn ( [ 'compose' , 'media_attachments' ] ) . size < 4 ,
layout : state . getIn ( [ 'meta' , 'layout' ] ) ,
layout _local _setting : state . getIn ( [ 'local_settings' , 'layout' ] ) ,
layout _local _setting : state . getIn ( [ 'local_settings' , 'layout' ] ) ,
isWide : state . getIn ( [ 'local_settings' , 'stretch' ] ) ,
isWide : state . getIn ( [ 'local_settings' , 'stretch' ] ) ,
navbarUnder : state . getIn ( [ 'local_settings' , 'navbar_under' ] ) ,
dropdownMenuIsOpen : state . getIn ( [ 'dropdown_menu' , 'openId' ] ) !== null ,
dropdownMenuIsOpen : state . getIn ( [ 'dropdown_menu' , 'openId' ] ) !== null ,
unreadNotifications : state . getIn ( [ 'notifications' , 'unread' ] ) ,
unreadNotifications : state . getIn ( [ 'notifications' , 'unread' ] ) ,
showFaviconBadge : state . getIn ( [ 'local_settings' , 'notifications' , 'favicon_badge' ] ) ,
showFaviconBadge : state . getIn ( [ 'local_settings' , 'notifications' , 'favicon_badge' ] ) ,
@ -133,7 +130,6 @@ class SwitchingColumnsArea extends React.PureComponent {
static propTypes = {
static propTypes = {
children : PropTypes . node ,
children : PropTypes . node ,
location : PropTypes . object ,
location : PropTypes . object ,
navbarUnder : PropTypes . bool ,
mobile : PropTypes . bool ,
mobile : PropTypes . bool ,
} ;
} ;
@ -165,7 +161,7 @@ class SwitchingColumnsArea extends React.PureComponent {
} ;
} ;
render ( ) {
render ( ) {
const { children , mobile , navbarUnder } = this . props ;
const { children , mobile } = this . props ;
const { signedIn } = this . context . identity ;
const { signedIn } = this . context . identity ;
let redirect ;
let redirect ;
@ -185,7 +181,7 @@ class SwitchingColumnsArea extends React.PureComponent {
}
}
return (
return (
< ColumnsAreaContainer ref = { this . setRef } singleColumn = { mobile } navbarUnder = { navbarUnder } >
< ColumnsAreaContainer ref = { this . setRef } singleColumn = { mobile } >
< WrappedSwitch >
< WrappedSwitch >
{ redirect }
{ redirect }
@ -256,7 +252,6 @@ class UI extends React.Component {
layout _local _setting : PropTypes . string ,
layout _local _setting : PropTypes . string ,
isWide : PropTypes . bool ,
isWide : PropTypes . bool ,
systemFontUi : PropTypes . bool ,
systemFontUi : PropTypes . bool ,
navbarUnder : PropTypes . bool ,
isComposing : PropTypes . bool ,
isComposing : PropTypes . bool ,
hasComposingText : PropTypes . bool ,
hasComposingText : PropTypes . bool ,
hasMediaAttachments : PropTypes . bool ,
hasMediaAttachments : PropTypes . bool ,
@ -268,6 +263,7 @@ class UI extends React.Component {
dropdownMenuIsOpen : PropTypes . bool ,
dropdownMenuIsOpen : PropTypes . bool ,
unreadNotifications : PropTypes . number ,
unreadNotifications : PropTypes . number ,
showFaviconBadge : PropTypes . bool ,
showFaviconBadge : PropTypes . bool ,
hicolorPrivacyIcons : PropTypes . bool ,
moved : PropTypes . map ,
moved : PropTypes . map ,
layout : PropTypes . string . isRequired ,
layout : PropTypes . string . isRequired ,
firstLaunch : PropTypes . bool ,
firstLaunch : PropTypes . bool ,
@ -456,8 +452,8 @@ class UI extends React.Component {
}
}
componentDidUpdate ( prevProps ) {
componentDidUpdate ( prevProps ) {
if ( this . props . unreadNotifications != prevProps . unreadNotifications ||
if ( this . props . unreadNotifications != = prevProps . unreadNotifications ||
this . props . showFaviconBadge != prevProps . showFaviconBadge ) {
this . props . showFaviconBadge != = prevProps . showFaviconBadge ) {
if ( this . favicon ) {
if ( this . favicon ) {
try {
try {
this . favicon . badge ( this . props . showFaviconBadge ? this . props . unreadNotifications : 0 ) ;
this . favicon . badge ( this . props . showFaviconBadge ? this . props . unreadNotifications : 0 ) ;
@ -606,7 +602,7 @@ class UI extends React.Component {
render ( ) {
render ( ) {
const { draggingOver } = this . state ;
const { draggingOver } = this . state ;
const { children , isWide , navbarUnder, location, dropdownMenuIsOpen , layout , moved } = this . props ;
const { children , isWide , location, dropdownMenuIsOpen , layout , moved } = this . props ;
const columnsClass = layout => {
const columnsClass = layout => {
switch ( layout ) {
switch ( layout ) {
@ -622,7 +618,6 @@ class UI extends React.Component {
const className = classNames ( 'ui' , columnsClass ( layout ) , {
const className = classNames ( 'ui' , columnsClass ( layout ) , {
'wide' : isWide ,
'wide' : isWide ,
'system-font' : this . props . systemFontUi ,
'system-font' : this . props . systemFontUi ,
'navbar-under' : navbarUnder ,
'hicolor-privacy-icons' : this . props . hicolorPrivacyIcons ,
'hicolor-privacy-icons' : this . props . hicolorPrivacyIcons ,
} ) ;
} ) ;
@ -665,7 +660,7 @@ class UI extends React.Component {
< Header / >
< Header / >
< SwitchingColumnsArea location = { location } mobile = { layout === 'mobile' || layout === 'single-column' } navbarUnder = { navbarUnder } >
< SwitchingColumnsArea location = { location } mobile = { layout === 'mobile' || layout === 'single-column' } >
{ children }
{ children }
< / SwitchingColumnsArea >
< / SwitchingColumnsArea >