mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Added data-column="{account|local|federated|favourites|hashtag|home|notifications|mutes|blocks|getting-started|follow-requests}" to Column
This commit is contained in:
parent
7b42d14f45
commit
b6bf04ece2
@ -8,6 +8,7 @@ export default class Column extends React.PureComponent {
|
|||||||
static propTypes = {
|
static propTypes = {
|
||||||
children: PropTypes.node,
|
children: PropTypes.node,
|
||||||
extraClasses: PropTypes.string,
|
extraClasses: PropTypes.string,
|
||||||
|
name: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
scrollTop () {
|
scrollTop () {
|
||||||
@ -41,10 +42,10 @@ export default class Column extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { children, extraClasses } = this.props;
|
const { children, extraClasses, name } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div role='region' className={`column ${extraClasses || ''}`} ref={this.setRef}>
|
<div role='region' data-column={name} className={`column ${extraClasses || ''}`} ref={this.setRef}>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -61,7 +61,7 @@ export default class AccountTimeline extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column>
|
<Column name='account'>
|
||||||
<ColumnBackButton />
|
<ColumnBackButton />
|
||||||
|
|
||||||
<StatusList
|
<StatusList
|
||||||
|
@ -54,7 +54,7 @@ export default class Blocks extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column icon='ban' heading={intl.formatMessage(messages.heading)}>
|
<Column name='blocks' icon='ban' heading={intl.formatMessage(messages.heading)}>
|
||||||
<ColumnBackButtonSlim />
|
<ColumnBackButtonSlim />
|
||||||
<ScrollContainer scrollKey='blocks'>
|
<ScrollContainer scrollKey='blocks'>
|
||||||
<div className='scrollable' onScroll={this.handleScroll}>
|
<div className='scrollable' onScroll={this.handleScroll}>
|
||||||
|
@ -117,7 +117,7 @@ export default class CommunityTimeline extends React.PureComponent {
|
|||||||
const pinned = !!columnId;
|
const pinned = !!columnId;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column ref={this.setRef}>
|
<Column ref={this.setRef} name='local'>
|
||||||
<ColumnHeader
|
<ColumnHeader
|
||||||
icon='users'
|
icon='users'
|
||||||
active={hasUnread}
|
active={hasUnread}
|
||||||
|
@ -66,7 +66,7 @@ export default class Favourites extends ImmutablePureComponent {
|
|||||||
const pinned = !!columnId;
|
const pinned = !!columnId;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column ref={this.setRef}>
|
<Column ref={this.setRef} name='favourites'>
|
||||||
<ColumnHeader
|
<ColumnHeader
|
||||||
icon='star'
|
icon='star'
|
||||||
title={intl.formatMessage(messages.heading)}
|
title={intl.formatMessage(messages.heading)}
|
||||||
|
@ -47,14 +47,14 @@ export default class FollowRequests extends ImmutablePureComponent {
|
|||||||
|
|
||||||
if (!accountIds) {
|
if (!accountIds) {
|
||||||
return (
|
return (
|
||||||
<Column>
|
<Column name='follow-requests'>
|
||||||
<LoadingIndicator />
|
<LoadingIndicator />
|
||||||
</Column>
|
</Column>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column icon='users' heading={intl.formatMessage(messages.heading)}>
|
<Column name='follow-requests' icon='users' heading={intl.formatMessage(messages.heading)}>
|
||||||
<ColumnBackButtonSlim />
|
<ColumnBackButtonSlim />
|
||||||
|
|
||||||
<ScrollContainer scrollKey='follow_requests'>
|
<ScrollContainer scrollKey='follow_requests'>
|
||||||
|
@ -85,7 +85,7 @@ export default class GettingStarted extends ImmutablePureComponent {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column icon='asterisk' heading={intl.formatMessage(messages.heading)} hideHeadingOnMobile>
|
<Column name='getting-started' icon='asterisk' heading={intl.formatMessage(messages.heading)} hideHeadingOnMobile>
|
||||||
<div className='scrollable optionally-scrollable'>
|
<div className='scrollable optionally-scrollable'>
|
||||||
<div className='getting-started__wrapper'>
|
<div className='getting-started__wrapper'>
|
||||||
<ColumnSubheading text={intl.formatMessage(messages.navigation_subheading)} />
|
<ColumnSubheading text={intl.formatMessage(messages.navigation_subheading)} />
|
||||||
|
@ -112,7 +112,7 @@ export default class HashtagTimeline extends React.PureComponent {
|
|||||||
const pinned = !!columnId;
|
const pinned = !!columnId;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column ref={this.setRef}>
|
<Column ref={this.setRef} name='hashtag'>
|
||||||
<ColumnHeader
|
<ColumnHeader
|
||||||
icon='hashtag'
|
icon='hashtag'
|
||||||
active={hasUnread}
|
active={hasUnread}
|
||||||
|
@ -72,7 +72,7 @@ export default class HomeTimeline extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column ref={this.setRef}>
|
<Column ref={this.setRef} name='home'>
|
||||||
<ColumnHeader
|
<ColumnHeader
|
||||||
icon='home'
|
icon='home'
|
||||||
active={hasUnread}
|
active={hasUnread}
|
||||||
|
@ -54,7 +54,7 @@ export default class Mutes extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column icon='volume-off' heading={intl.formatMessage(messages.heading)}>
|
<Column name='mutes' icon='volume-off' heading={intl.formatMessage(messages.heading)}>
|
||||||
<ColumnBackButtonSlim />
|
<ColumnBackButtonSlim />
|
||||||
<ScrollContainer scrollKey='mutes'>
|
<ScrollContainer scrollKey='mutes'>
|
||||||
<div className='scrollable mutes' onScroll={this.handleScroll}>
|
<div className='scrollable mutes' onScroll={this.handleScroll}>
|
||||||
|
@ -183,6 +183,7 @@ export default class Notifications extends React.PureComponent {
|
|||||||
return (
|
return (
|
||||||
<Column
|
<Column
|
||||||
ref={this.setColumnRef}
|
ref={this.setColumnRef}
|
||||||
|
name='notifications'
|
||||||
extraClasses={this.props.notifCleaningActive ? 'notif-cleaning' : null}
|
extraClasses={this.props.notifCleaningActive ? 'notif-cleaning' : null}
|
||||||
>
|
>
|
||||||
<ColumnHeader
|
<ColumnHeader
|
||||||
|
@ -117,7 +117,7 @@ export default class PublicTimeline extends React.PureComponent {
|
|||||||
const pinned = !!columnId;
|
const pinned = !!columnId;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column ref={this.setRef}>
|
<Column ref={this.setRef} name='federated'>
|
||||||
<ColumnHeader
|
<ColumnHeader
|
||||||
icon='globe'
|
icon='globe'
|
||||||
active={hasUnread}
|
active={hasUnread}
|
||||||
|
@ -13,6 +13,7 @@ export default class Column extends React.PureComponent {
|
|||||||
children: PropTypes.node,
|
children: PropTypes.node,
|
||||||
active: PropTypes.bool,
|
active: PropTypes.bool,
|
||||||
hideHeadingOnMobile: PropTypes.bool,
|
hideHeadingOnMobile: PropTypes.bool,
|
||||||
|
name: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
handleHeaderClick = () => {
|
handleHeaderClick = () => {
|
||||||
@ -36,7 +37,7 @@ export default class Column extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { heading, icon, children, active, hideHeadingOnMobile } = this.props;
|
const { heading, icon, children, active, hideHeadingOnMobile, name } = this.props;
|
||||||
|
|
||||||
const showHeading = heading && (!hideHeadingOnMobile || (hideHeadingOnMobile && !isMobile(window.innerWidth)));
|
const showHeading = heading && (!hideHeadingOnMobile || (hideHeadingOnMobile && !isMobile(window.innerWidth)));
|
||||||
|
|
||||||
@ -48,6 +49,7 @@ export default class Column extends React.PureComponent {
|
|||||||
<div
|
<div
|
||||||
ref={this.setRef}
|
ref={this.setRef}
|
||||||
role='region'
|
role='region'
|
||||||
|
data-column={name}
|
||||||
aria-labelledby={columnHeaderId}
|
aria-labelledby={columnHeaderId}
|
||||||
className='column'
|
className='column'
|
||||||
onScroll={this.handleScroll}
|
onScroll={this.handleScroll}
|
||||||
|
Loading…
Reference in New Issue
Block a user