Added logoDisabled/Stealth Gab mode for logo in NavigationBar

• Added:
- logoDisabled/Stealth Gab mode for logo in NavigationBar to turn into Gab "g"
This commit is contained in:
mgabdev 2020-11-03 15:04:31 -06:00
parent 4d042e38c0
commit d282d1d9c7
4 changed files with 28 additions and 5 deletions

View File

@ -1,7 +1,6 @@
import React from 'react'
import PropTypes from 'prop-types'
import { CX } from '../constants'
import Logo from './logo'
import Loading from './loading'
import VerifiedIcon from './verified_icon'
@ -13,9 +12,19 @@ class Icon extends React.PureComponent {
className,
id,
size,
minimizeLogo,
} = this.props
if (id === 'logo') return <Logo className={className} />
if (id === 'logo') {
if (minimizeLogo) {
return (
<div className={[_s.d, _s.px5, _s.py5, _s.circle, _s.bgNavigationBlendLight].join(' ')}>
<i className={[_s.gfi, _s['gfi-gab-g'], _s.px5, _s.py5, _s.fillNavigationBrand].join(' ')} style={{fontSize: '22px'}} />
</div>
)
}
return <Logo className={className} />
}
else if (id === 'loading') return <Loading size={size} className={className} />
else if (id === 'verified') return <VerifiedIcon size={size} className={className} />
@ -35,6 +44,7 @@ Icon.propTypes = {
className: PropTypes.string,
id: PropTypes.string.isRequired,
size: PropTypes.string,
minimizeLogo: PropTypes.bool,
}
export default Icon

View File

@ -84,7 +84,7 @@ class DisplayOptionsModal extends ImmutablePureComponent {
<div className={[_s.d, _s.mb15].join(' ')}>
<Text weight='bold' size='small' color='secondary'>
Rounded
Options
</Text>
<div className={[_s.d, _s.radiusSmall, _s.mt10, _s.py15, _s.px15, _s.bgTertiary].join(' ')}>
<SettingSwitch
@ -102,6 +102,15 @@ class DisplayOptionsModal extends ImmutablePureComponent {
onChange={this.handleOnRadiusKeyDisabled}
label={'Circles Disabled'}
/>
<SettingSwitch
prefix='displayOptions'
settings={displayOptionsSettings}
settingPath={'logoDisabled'}
onChange={this.handleOnRadiusKeyDisabled}
label={'Stealth Gab'}
/>
</div>
</div>

View File

@ -66,6 +66,7 @@ class DefaultNavigationBar extends ImmutablePureComponent {
tabs,
account,
noActions,
logoDisabled,
} = this.props
const navigationContainerClasses = CX({
@ -148,7 +149,7 @@ class DefaultNavigationBar extends ImmutablePureComponent {
backgroundColor='none'
className={[_s.d, _s.jcCenter, _s.noSelect, _s.noUnderline, _s.h53PX, _s.cursorPointer, _s.px10, _s.mr5].join(' ')}
>
<Icon id='logo' className={_s.fillNavigationBrand} />
<Icon id='logo' className={_s.fillNavigationBrand} minimizeLogo={logoDisabled} />
</Button>
</h1>
@ -201,7 +202,7 @@ class DefaultNavigationBar extends ImmutablePureComponent {
href='/'
className={[_s.h53PX, _s.bgTransparent, _s.outlineNone, _s.cursorPointer, _s.d, _s.jcCenter].join(' ')}
>
<Icon id='logo' className={_s.fillNavigationBrand} />
<Icon id='logo' className={_s.fillNavigationBrand} minimizeLogo={logoDisabled} />
</button>
}
{
@ -257,6 +258,7 @@ const mapStateToProps = (state) => ({
account: makeGetAccount()(state, me),
emailConfirmationResends: state.getIn(['user', 'emailConfirmationResends'], 0),
theme: state.getIn(['settings', 'displayOptions', 'theme'], DEFAULT_THEME),
logoDisabled: state.getIn(['settings', 'displayOptions', 'logoDisabled'], false),
})
const mapDispatchToProps = (dispatch) => ({
@ -290,6 +292,7 @@ DefaultNavigationBar.propTypes = {
emailConfirmationResends: PropTypes.number.isRequired,
noActions: PropTypes.bool,
theme: PropTypes.string,
logoDisabled: PropTypes.bool,
}
export default connect(mapStateToProps, mapDispatchToProps)(DefaultNavigationBar)

View File

@ -38,6 +38,7 @@ const initialState = ImmutableMap({
fontSize: 'normal',
radiusSmallDisabled: false,
radiusCircleDisabled: false,
logoDisabled: false,
theme: 'light',
}),