This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* MM-14196 Add virtualised list for posts * Use custom fork of react-window for creating virtualised lists * Remove all of the scroll corrections and rely on resize observer in virtualised list to figure out the scroll corrections * Use 100px as the trigger for loading more posts * Fix channel sync issue for first team switch * Add tests * Fix review comments * Remove global event emitter * remove references to postlist scroll change * Revert css change for post_hover menu * Remove unused import * Add inital value for floatingTimestamp * Update react window has to fix #2447 (comment)
- Loading branch information
1 parent
9681600
commit ec5c279
Showing
37 changed files
with
799 additions
and
619 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
components/post_view/new_message_separator/__snapshots__/new_message_separator.test.jsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`components/post_view/new_message_separator should render new_message_separator 1`] = ` | ||
<div | ||
className="new-separator" | ||
id="1234" | ||
> | ||
<hr | ||
className="separator__hr" | ||
/> | ||
<div | ||
className="separator__text" | ||
> | ||
<FormattedMessage | ||
defaultMessage="New Messages" | ||
id="posts_view.newMsg" | ||
values={Object {}} | ||
/> | ||
</div> | ||
</div> | ||
`; |
29 changes: 29 additions & 0 deletions
29
components/post_view/new_message_separator/new_message_separator.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. | ||
// See LICENSE.txt for license information. | ||
|
||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import {FormattedMessage} from 'react-intl'; | ||
|
||
export default class NewMessageSeparator extends React.PureComponent { | ||
static propTypes = { | ||
separatorId: PropTypes.string.isRequired, | ||
} | ||
|
||
render() { | ||
return ( | ||
<div | ||
id={this.props.separatorId} | ||
className='new-separator' | ||
> | ||
<hr className='separator__hr'/> | ||
<div className='separator__text'> | ||
<FormattedMessage | ||
id='posts_view.newMsg' | ||
defaultMessage='New Messages' | ||
/> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
components/post_view/new_message_separator/new_message_separator.test.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. | ||
// See LICENSE.txt for license information. | ||
|
||
import React from 'react'; | ||
|
||
import {shallowWithIntl} from 'tests/helpers/intl-test-helper.jsx'; | ||
|
||
import NewMessageSeparator from './new_message_separator.jsx'; | ||
|
||
describe('components/post_view/new_message_separator', () => { | ||
test('should render new_message_separator', () => { | ||
const wrapper = shallowWithIntl( | ||
<NewMessageSeparator separatorId='1234'/> | ||
); | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.