This commit is contained in:
mgabdev
2020-02-17 12:50:29 -05:00
parent cdde454915
commit be3daea78b
28 changed files with 456 additions and 176 deletions

View File

@@ -155,6 +155,7 @@ class Notification extends ImmutablePureComponent {
</span>
</div>
{ /*
<StatusContainer
id={notification.get('status')}
account={notification.get('account')}
@@ -165,7 +166,7 @@ class Notification extends ImmutablePureComponent {
updateScrollBottom={this.props.updateScrollBottom}
cachedMediaWidth={this.props.cachedMediaWidth}
cacheMediaWidth={this.props.cacheMediaWidth}
/>
/> */ }
</div>
</HotKeys>
);
@@ -186,7 +187,7 @@ class Notification extends ImmutablePureComponent {
<FormattedMessage id='notification.reblog' defaultMessage='{name} reposted your status' values={{ name: link }} />
</span>
</div>
{ /*
<StatusContainer
id={notification.get('status')}
account={notification.get('account')}
@@ -197,7 +198,7 @@ class Notification extends ImmutablePureComponent {
updateScrollBottom={this.props.updateScrollBottom}
cachedMediaWidth={this.props.cachedMediaWidth}
cacheMediaWidth={this.props.cacheMediaWidth}
/>
/> */ }
</div>
</HotKeys>
);
@@ -218,7 +219,7 @@ class Notification extends ImmutablePureComponent {
<FormattedMessage id='notification.poll' defaultMessage='A poll you have voted in has ended' />
</span>
</div>
{ /*
<StatusContainer
id={notification.get('status')}
account={notification.get('account')}
@@ -229,7 +230,7 @@ class Notification extends ImmutablePureComponent {
updateScrollBottom={this.props.updateScrollBottom}
cachedMediaWidth={this.props.cachedMediaWidth}
cacheMediaWidth={this.props.cacheMediaWidth}
/>
/> */}
</div>
</HotKeys>
);
@@ -242,16 +243,16 @@ class Notification extends ImmutablePureComponent {
const link = <bdi><Permalink className='notification__display-name' href={`/${account.get('acct')}`} title={account.get('acct')} to={`/${account.get('acct')}`} dangerouslySetInnerHTML={displayNameHtml} /></bdi>;
switch(notification.get('type')) {
case 'follow':
return this.renderFollow(notification, account, link);
case 'mention':
return this.renderMention(notification);
// case 'follow':
// return this.renderFollow(notification, account, link);
// case 'mention':
// return this.renderMention(notification);
case 'favourite':
return this.renderFavourite(notification, link);
case 'reblog':
return this.renderReblog(notification, link);
case 'poll':
return this.renderPoll(notification);
// case 'reblog':
// return this.renderReblog(notification, link);
// case 'poll':
// return this.renderPoll(notification);
}
return null;

View File

@@ -10,13 +10,12 @@ import {
dequeueNotifications,
} from '../../actions/notifications';
import NotificationContainer from './containers/notification_container';
import ColumnSettingsContainer from './containers/column_settings_container';
import FilterBarContainer from './containers/filter_bar_container';
// import ColumnSettingsContainer from './containers/column_settings_container';
// import FilterBarContainer from './containers/filter_bar_container';
import ScrollableList from '../../components/scrollable_list';
import LoadMore from '../../components/load_more';
import TimelineQueueButtonHeader from '../../components/timeline_queue_button_header';
// import TimelineQueueButtonHeader from '../../components/timeline_queue_button_header';
import Column from '../../components/column';
import { ColumnHeader } from '../../components/column_header';
const messages = defineMessages({
title: { id: 'column.notifications', defaultMessage: 'Notifications' },
@@ -128,9 +127,11 @@ class Notifications extends ImmutablePureComponent {
let scrollableContent = null;
const filterBarContainer = showFilterBar
? (<FilterBarContainer />)
: null;
// const filterBarContainer = showFilterBar
// ? (<FilterBarContainer />)
// : null;
console.log("notifications:", notifications)
if (isLoading && this.scrollableContent) {
scrollableContent = this.scrollableContent;
@@ -169,18 +170,15 @@ class Notifications extends ImmutablePureComponent {
onScrollToTop={this.handleScrollToTop}
onScroll={this.handleScroll}
>
{scrollableContent}
{ scrollableContent }
</ScrollableList>
);
return (
<Column ref={this.setColumnRef} heading={intl.formatMessage(messages.title)}>
<ColumnHeader icon='bell' active={isUnread} title={intl.formatMessage(messages.title)}>
<ColumnSettingsContainer />
</ColumnHeader>
{filterBarContainer}
<TimelineQueueButtonHeader onClick={this.handleDequeueNotifications} count={totalQueuedNotificationsCount} itemType='notification' />
{scrollContainer}
{ /* filterBarContainer */ }
{ /* <TimelineQueueButtonHeader onClick={this.handleDequeueNotifications} count={totalQueuedNotificationsCount} itemType='notification' /> */ }
{ scrollContainer }
</Column>
);
}

View File

@@ -24,18 +24,19 @@ import { isMobile } from '../../utils/is_mobile';
// import TrendsPanel from './components/trends_panel';
// import { WhoToFollowPanel } from '../../components/panel';
// import LinkFooter from '../../components/link_footer';
// import ProfilePage from '../../pages/profile_page';
import ProfilePage from '../../pages/profile_page'
// import GroupsPage from 'gabsocial/pages/groups_page';
// import GroupPage from '../../pages/group_page';
// import SearchPage from '../../pages/search_page';
import HomePage from '../../pages/home_page';
import HomePage from '../../pages/home_page'
import NotificationsPage from '../../pages/notifications_page'
// import GroupSidebarPanel from '../groups/sidebar_panel';
import {
Status,
// GettingStarted,
// CommunityTimeline,
// AccountTimeline,
AccountTimeline,
// AccountGallery,
HomeTimeline,
// Followers,
@@ -44,7 +45,7 @@ import {
// Favourites,
// DirectTimeline,
// HashtagTimeline,
// Notifications,
Notifications,
// FollowRequests,
// GenericNotFound,
// FavouritedStatuses,
@@ -194,9 +195,9 @@ class SwitchingColumnsArea extends PureComponent {
<WrappedRoute path='/lists' layout={LAYOUT.DEFAULT} component={Lists} content={children} />
<WrappedRoute path='/list/:id' page={HomePage} component={ListTimeline} content={children} />
<WrappedRoute path='/notifications' layout={LAYOUT.DEFAULT} component={Notifications} content={children} />
*/}
<WrappedRoute path='/notifications' layout={LAYOUT.DEFAULT} page={NotificationsPage} component={Notifications} content={children} />
{/*
<WrappedRoute path='/search' exact publicRoute page={SearchPage} component={Search} content={children} />
<WrappedRoute path='/search/people' exact page={SearchPage} component={Search} content={children} />
<WrappedRoute path='/search/hashtags' exact page={SearchPage} component={Search} content={children} />
@@ -206,10 +207,10 @@ class SwitchingColumnsArea extends PureComponent {
<WrappedRoute path='/blocks' layout={LAYOUT.DEFAULT} component={Blocks} content={children} />
<WrappedRoute path='/domain_blocks' layout={LAYOUT.DEFAULT} component={DomainBlocks} content={children} />
<WrappedRoute path='/mutes' layout={LAYOUT.DEFAULT} component={Mutes} content={children} />
*/ }
<Redirect from='/@:username' to='/:username' exact />
<WrappedRoute path='/:username' publicRoute exact component={AccountTimeline} page={ProfilePage} content={children} />
{ /*
<Redirect from='/@:username/with_replies' to='/:username/with_replies' />
<WrappedRoute path='/:username/with_replies' component={AccountTimeline} page={ProfilePage} content={children} componentParams={{ withReplies: true }} />

View File

@@ -1,5 +1,5 @@
import { Route } from 'react-router-dom';
import PageLayout from '../../../components/page_layout';
import DefaultLayout from '../../../components/layouts/default_layout';
import BundleColumnError from '../../../components/bundle_column_error';
import Bundle from './bundle';
import { me } from '../../../initial_state';
@@ -42,11 +42,11 @@ export default class WrappedRoute extends Component {
<Bundle fetchComponent={component} loading={this.renderLoading} error={this.renderError}>
{Component =>
(
<PageLayout layout={layout}>
<DefaultLayout layout={layout}>
<Component params={match.params} {...componentParams}>
{content}
</Component>
</PageLayout>
</DefaultLayout>
)
}
</Bundle>