Updated mobile slide out sidebar
• Updated: - mobile slide out sidebar
This commit is contained in:
parent
33369c5fbf
commit
f5446783b8
@ -10,6 +10,7 @@ import Avatar from './avatar'
|
|||||||
import DisplayName from './display_name'
|
import DisplayName from './display_name'
|
||||||
import Button from './button'
|
import Button from './button'
|
||||||
import Heading from './heading'
|
import Heading from './heading'
|
||||||
|
import Image from './image'
|
||||||
import Text from './text'
|
import Text from './text'
|
||||||
import List from './list'
|
import List from './list'
|
||||||
import { closeSidebar } from '../actions/sidebar'
|
import { closeSidebar } from '../actions/sidebar'
|
||||||
@ -47,93 +48,6 @@ class SidebarXS extends ImmutablePureComponent {
|
|||||||
const acct = account.get('acct')
|
const acct = account.get('acct')
|
||||||
const isPro = account.get('is_pro')
|
const isPro = account.get('is_pro')
|
||||||
|
|
||||||
const mainItems = [
|
|
||||||
{
|
|
||||||
to: `/${acct}`,
|
|
||||||
onClick: this.handleSidebarClose,
|
|
||||||
title: intl.formatMessage(messages.profile),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'list',
|
|
||||||
to: '/lists',
|
|
||||||
onClick: this.handleSidebarClose,
|
|
||||||
title: intl.formatMessage(messages.lists),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'star',
|
|
||||||
to: '/shortcuts',
|
|
||||||
onClick: this.handleSidebarClose,
|
|
||||||
title: intl.formatMessage(messages.shortcuts),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'pro',
|
|
||||||
href: 'https://pro.gab.com',
|
|
||||||
onClick: this.handleSidebarClose,
|
|
||||||
title: intl.formatMessage(messages.pro),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'shop',
|
|
||||||
href: 'https://shop.dissenter.com',
|
|
||||||
onClick: this.handleSidebarClose,
|
|
||||||
title: intl.formatMessage(messages.shop),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'search',
|
|
||||||
to: '/search',
|
|
||||||
onClick: this.handleSidebarClose,
|
|
||||||
title: intl.formatMessage(messages.search),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'explore',
|
|
||||||
to: '/timeline/pro',
|
|
||||||
onClick: this.handleSidebarClose,
|
|
||||||
title: intl.formatMessage(messages.proFeed),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'cog',
|
|
||||||
href: '/settings/preferences',
|
|
||||||
onClick: this.handleSidebarClose,
|
|
||||||
title: intl.formatMessage(messages.preferences),
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// icon: 'group',
|
|
||||||
// to: '/follow_requests',
|
|
||||||
// onClick: this.handleSidebarClose,
|
|
||||||
// title: intl.formatMessage(messages.follow_requests),
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
icon: 'block',
|
|
||||||
to: '/settings/blocks',
|
|
||||||
onClick: this.handleSidebarClose,
|
|
||||||
title: intl.formatMessage(messages.blocks),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'audio-mute',
|
|
||||||
to: '/settings/mutes',
|
|
||||||
onClick: this.handleSidebarClose,
|
|
||||||
title: intl.formatMessage(messages.mutes),
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// icon: 'report',
|
|
||||||
// to: '/filters',
|
|
||||||
// onClick: this.handleSidebarClose,
|
|
||||||
// title: intl.formatMessage(messages.filters),
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
onClick: this.props.onOpenDisplayModel, //on open display model
|
|
||||||
title: intl.formatMessage(messages.display),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
href: 'https://help.gab.com',
|
|
||||||
onClick: this.handleSidebarClose,
|
|
||||||
title: intl.formatMessage(messages.help),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
href: '/auth/sign_out',
|
|
||||||
title: intl.formatMessage(messages.logout),
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
const containerClasses = CX({
|
const containerClasses = CX({
|
||||||
d: 1,
|
d: 1,
|
||||||
posFixed: 1,
|
posFixed: 1,
|
||||||
@ -148,72 +62,143 @@ class SidebarXS extends ImmutablePureComponent {
|
|||||||
return (
|
return (
|
||||||
<div className={containerClasses}>
|
<div className={containerClasses}>
|
||||||
<div className={[_s.d, _s.posFixed, _s.top0, _s.left0, _s.right0, _s.bgBlackOpaque, _s.bottom0].join(' ')} role='button' onClick={this.handleSidebarClose} />
|
<div className={[_s.d, _s.posFixed, _s.top0, _s.left0, _s.right0, _s.bgBlackOpaque, _s.bottom0].join(' ')} role='button' onClick={this.handleSidebarClose} />
|
||||||
<div className={[_s.defaut, _s.posFixed, _s.left0, _s.top0, _s.bottom0, _s.bgPrimary, _s.saveAreaInsetPT, _s.saveAreaInsetPB, _s.saveAreaInsetPL, _s.minW330PX, _s.borderRight1PX, _s.borderColorSecondary, _s.maxW80PC].join(' ')}>
|
<div className={[_s.defaut, _s.posFixed, _s.left0, _s.top0, _s.bottom0, _s.bgSecondary, _s.saveAreaInsetPT, _s.saveAreaInsetPB, _s.saveAreaInsetPL, _s.minW330PX, _s.borderRight1PX, _s.borderColorSecondary, _s.maxW80PC, _s.overflowYScroll].join(' ')}>
|
||||||
|
|
||||||
<div className={[_s.d, _s.flexRow, _s.px15, _s.h53PX, _s.w100PC, _s.borderBottom1PX, _s.borderColorSecondary, _s.aiCenter, _s.jcCenter].join(' ')}>
|
<div
|
||||||
<Heading size='h2'>Account Info</Heading>
|
className={[_s.d, _s.h122PX].join(' ')}
|
||||||
|
onMouseEnter={this.handleOnMouseEnter}
|
||||||
|
onMouseLeave={this.handleOnMouseLeave}
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
alt={intl.formatMessage(messages.headerPhoto)}
|
||||||
|
className={_s.h122PX}
|
||||||
|
src={account.get('header_static')}
|
||||||
|
/>
|
||||||
<Button
|
<Button
|
||||||
title='close'
|
title='close'
|
||||||
color='secondary'
|
color='white'
|
||||||
backgroundColor='none'
|
backgroundColor='none'
|
||||||
onClick={this.handleSidebarClose}
|
onClick={this.handleSidebarClose}
|
||||||
icon='close'
|
icon='close'
|
||||||
iconSize='12px'
|
iconSize='12px'
|
||||||
className={_s.mlAuto}
|
className={[_s.posAbs, _s.top0, _s.right0, _s.mr10, _s.mt10].join(' ')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={[_s.d, _s.w100PC, _s.overflowYScroll, _s.calcH53PX].join(' ')}>
|
<div className={[_s.d, _s.px15, _s.w100PC, _s.pb15, _s.bgPrimary, _s.borderColorSecondary, _s.borderBottom1PX].join(' ')}>
|
||||||
|
<div className={[_s.d].join(' ')}>
|
||||||
|
|
||||||
<div className={[_s.d, _s.w100PC, _s.px15, _s.py10].join(' ')}>
|
<div className={[_s.d, _s.flexRow].join(' ')}>
|
||||||
<div className={[_s.d, _s.mt5].join(' ')}>
|
<div className={[_s.d, _s.mtNeg32PX].join(' ')}>
|
||||||
<Link
|
<NavLink
|
||||||
to={`/${acct}`}
|
to={`/${acct}`}
|
||||||
title={acct}
|
title={acct}
|
||||||
onClick={this.handleSidebarClose}
|
onClick={this.handleSidebarClose}
|
||||||
|
className={[_s.boxShadowProfileAvatar, _s.w84PX, _s.circle].join(' ')}
|
||||||
>
|
>
|
||||||
<Avatar account={account} size={60} />
|
<Avatar account={account} size={84} />
|
||||||
</Link>
|
</NavLink>
|
||||||
</div>
|
</div>
|
||||||
<div className={[_s.d, _s.my10, _s.w100PC].join(' ')}>
|
<div className={[_s.d, _s.px15, _s.pt10].join(' ')}>
|
||||||
<DisplayName account={account} isMultiline />
|
<DisplayName account={account} isMultiline />
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div className={[_s.d, _s.flexRow, _s.flexWrap].join(' ')}>
|
</div>
|
||||||
<NavLink
|
|
||||||
to={`/${acct}/followers`}
|
|
||||||
onClick={this.handleSidebarClose}
|
|
||||||
title={intl.formatNumber(account.get('followers_count'))}
|
|
||||||
className={[_s.text, _s.noUnderline, _s.underline_onHover, _s.mr15].join(' ')}
|
|
||||||
>
|
|
||||||
<Text weight='bold'>{shortNumberFormat(account.get('followers_count'))} </Text>
|
|
||||||
<Text>{intl.formatMessage(messages.followers)}</Text>
|
|
||||||
</NavLink>
|
|
||||||
<NavLink
|
|
||||||
to={`/${acct}/following`}
|
|
||||||
onClick={this.handleSidebarClose}
|
|
||||||
title={intl.formatNumber(account.get('following_count'))}
|
|
||||||
className={[_s.text, _s.noUnderline, _s.underline_onHover].join(' ')}
|
|
||||||
>
|
|
||||||
<Text weight='bold'>{shortNumberFormat(account.get('following_count'))} </Text>
|
|
||||||
<Text>{intl.formatMessage(messages.follows)}</Text>
|
|
||||||
</NavLink>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
<div className={[_s.d, _s.w100PC].join(' ')}>
|
||||||
|
<div className={[_s.d, _s.boxShadowNone].join(' ')}>
|
||||||
<div className={[_s.d, _s.my10, _s.px15].join(' ')}>
|
|
||||||
<WrappedBundle component={ProgressPanel} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={[_s.d, _s.mb15, _s.boxShadowNone].join(' ')}>
|
|
||||||
<List
|
<List
|
||||||
items={mainItems}
|
items={[
|
||||||
size='large'
|
{
|
||||||
|
to: `/${acct}`,
|
||||||
|
onClick: this.handleSidebarClose,
|
||||||
|
title: intl.formatMessage(messages.profile),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
to: '/lists',
|
||||||
|
onClick: this.handleSidebarClose,
|
||||||
|
title: intl.formatMessage(messages.lists),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
to: '/shortcuts',
|
||||||
|
onClick: this.handleSidebarClose,
|
||||||
|
title: intl.formatMessage(messages.shortcuts),
|
||||||
|
},
|
||||||
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className={[_s.d, _s.w100PC].join(' ')}>
|
||||||
|
<div className={[_s.d, _s.mt5, _s.boxShadowNone].join(' ')}>
|
||||||
|
<div className={[_s.py10, _s.px15].join(' ')}>
|
||||||
|
<Text color='secondary' size='small' weight='medium'>Preferences</Text>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<List
|
||||||
|
items={[
|
||||||
|
{
|
||||||
|
onClick: this.props.onOpenDisplayModel, //on open display model
|
||||||
|
title: intl.formatMessage(messages.display),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
href: '/settings/preferences',
|
||||||
|
onClick: this.handleSidebarClose,
|
||||||
|
title: intl.formatMessage(messages.settings),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
to: '/settings/blocks',
|
||||||
|
onClick: this.handleSidebarClose,
|
||||||
|
title: intl.formatMessage(messages.blocks),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
to: '/settings/mutes',
|
||||||
|
onClick: this.handleSidebarClose,
|
||||||
|
title: intl.formatMessage(messages.mutes),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={[_s.d, _s.w100PC, _s.pb35, _s.mb15].join(' ')}>
|
||||||
|
<div className={[_s.d, _s.mt5, _s.boxShadowNone, _s.pb35, _s.mb15].join(' ')}>
|
||||||
|
<div className={[_s.py10, _s.px15].join(' ')}>
|
||||||
|
<Text color='secondary' size='small' weight='medium'>More</Text>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<List
|
||||||
|
items={[
|
||||||
|
{
|
||||||
|
to: '/timeline/pro',
|
||||||
|
onClick: this.handleSidebarClose,
|
||||||
|
title: intl.formatMessage(messages.proFeed),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
href: 'https://pro.gab.com',
|
||||||
|
onClick: this.handleSidebarClose,
|
||||||
|
title: intl.formatMessage(messages.pro),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
href: 'https://shop.dissenter.com',
|
||||||
|
onClick: this.handleSidebarClose,
|
||||||
|
title: intl.formatMessage(messages.shop),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
href: 'https://help.gab.com',
|
||||||
|
onClick: this.handleSidebarClose,
|
||||||
|
title: intl.formatMessage(messages.help),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
href: '/auth/sign_out',
|
||||||
|
title: intl.formatMessage(messages.logout),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@ -225,7 +210,7 @@ const messages = defineMessages({
|
|||||||
followers: { id: 'account.followers', defaultMessage: 'Followers' },
|
followers: { id: 'account.followers', defaultMessage: 'Followers' },
|
||||||
follows: { id: 'account.follows', defaultMessage: 'Following' },
|
follows: { id: 'account.follows', defaultMessage: 'Following' },
|
||||||
profile: { id: 'account.profile', defaultMessage: 'Profile' },
|
profile: { id: 'account.profile', defaultMessage: 'Profile' },
|
||||||
preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },
|
settings: { id: 'navigation_bar.settings', defaultMessage: 'Settings' },
|
||||||
follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },
|
follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },
|
||||||
blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },
|
blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },
|
||||||
mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },
|
mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },
|
||||||
@ -243,6 +228,7 @@ const messages = defineMessages({
|
|||||||
display: { id: 'display_options', defaultMessage: 'Display Options' },
|
display: { id: 'display_options', defaultMessage: 'Display Options' },
|
||||||
proFeed: { id: 'pro_feed', defaultMessage: 'Pro Feed' },
|
proFeed: { id: 'pro_feed', defaultMessage: 'Pro Feed' },
|
||||||
shortcuts: { id: 'shortcuts', defaultMessage: 'Shortcuts' },
|
shortcuts: { id: 'shortcuts', defaultMessage: 'Shortcuts' },
|
||||||
|
headerPhoto: { id: 'header_photo', defaultMessage: 'Header photo' },
|
||||||
})
|
})
|
||||||
|
|
||||||
const mapStateToProps = (state) => ({
|
const mapStateToProps = (state) => ({
|
||||||
|
@ -767,6 +767,7 @@ pre {
|
|||||||
.pt5 { padding-top: 5px; }
|
.pt5 { padding-top: 5px; }
|
||||||
.pt2 { padding-top: 2px; }
|
.pt2 { padding-top: 2px; }
|
||||||
|
|
||||||
|
.pb35 { padding-bottom: 35px; }
|
||||||
.pb15 { padding-bottom: 15px; }
|
.pb15 { padding-bottom: 15px; }
|
||||||
.pb10 { padding-bottom: 10px; }
|
.pb10 { padding-bottom: 10px; }
|
||||||
.pb5 { padding-bottom: 5px; }
|
.pb5 { padding-bottom: 5px; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user