Skip to content

Commit 7c1b214

Browse files
committed
Change setting name to paginationType
1 parent dc82ec9 commit 7c1b214

File tree

9 files changed

+29
-143421
lines changed

9 files changed

+29
-143421
lines changed

assets/app.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,5 +1531,3 @@
15311531
.ace_scroll-left {
15321532
-webkit-box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.25) !important;
15331533
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.25) !important; }
1534-
1535-
/*# sourceMappingURL=app.css.map*/

assets/app.js

Lines changed: 16 additions & 143406 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

liveblog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ public static function enqueue_scripts() {
999999
'state' => self::get_liveblog_state(),
10001000
'is_liveblog_editable' => self::is_liveblog_editable(),
10011001
'socketio_enabled' => WPCOM_Liveblog_Socketio_Loader::is_enabled(),
1002-
'isLoadMore' => false,
1002+
'paginationType' => 'page',
10031003

10041004
'key' => self::KEY,
10051005
'nonce_key' => self::NONCE_KEY,

src/react/actions/apiActions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ export const getEntriesPaginated = (page, scrollTo) => ({
1212
scrollTo,
1313
});
1414

15-
export const getEntriesSuccess = (payload, renderNewEntries, isLoadMore) => ({
15+
export const getEntriesSuccess = (payload, renderNewEntries, paginationType) => ({
1616
type: types.GET_ENTRIES_SUCCESS,
1717
payload,
1818
renderNewEntries,
19-
isLoadMore,
19+
paginationType,
2020
});
2121

2222
export const getEntriesFailed = () => ({

src/react/containers/AppContainer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ class AppContainer extends Component {
2828

2929
render() {
3030
const { page, loading, entries, polling, mergePolling, config } = this.props;
31-
const { isLoadMore } = config;
31+
const paginationTypeLoadMore = config.paginationType === 'loadMore';
3232
const canEdit = config.is_liveblog_editable === '1';
3333

3434
return (
3535
<div style={{ position: 'relative' }}>
36-
{(page === 1 || isLoadMore) && canEdit && <EditorContainer isEditing={false} />}
36+
{(page === 1 || paginationTypeLoadMore) && canEdit && <EditorContainer isEditing={false} />}
3737
<UpdateButton polling={polling} click={() => mergePolling()} />
38-
{!isLoadMore && <PaginationContainer /> }
38+
{!paginationTypeLoadMore && <PaginationContainer /> }
3939
<Entries loading={loading} entries={entries} />
4040
<PaginationContainer />
4141
{this.eventsContainer && <EventsContainer container={this.eventsContainer} />}

src/react/containers/PaginationContainer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import * as userActions from '../actions/userActions';
77

88
class PaginationContainer extends Component {
99
render() {
10-
const { page, pages, getEntriesPaginated, isLoadMore } = this.props;
10+
const { page, pages, getEntriesPaginated, paginationType } = this.props;
1111

12-
if (isLoadMore) {
12+
if (paginationType === 'loadMore') {
1313
return (
1414
<div className="liveblog-pagination">
1515
{page !== pages &&
@@ -66,13 +66,13 @@ PaginationContainer.propTypes = {
6666
page: PropTypes.number,
6767
pages: PropTypes.number,
6868
getEntriesPaginated: PropTypes.func,
69-
isLoadMore: PropTypes.bool,
69+
paginationType: PropTypes.string,
7070
};
7171

7272
const mapStateToProps = state => ({
7373
page: state.pagination.page,
7474
pages: state.pagination.pages,
75-
isLoadMore: state.config.isLoadMore,
75+
paginationType: state.config.paginationType,
7676
});
7777

7878
const mapDispatchToProps = dispatch =>

src/react/epics/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const getPaginatedEntriesEpic = (action$, store) =>
8080
store.getState().api.entries,
8181
store.getState().polling.entries,
8282
),
83-
store.getState().config.isLoadMore,
83+
store.getState().config.paginationType,
8484
)),
8585
of(scrollToEntry(getScrollToId(res.response.entries, scrollTo))),
8686
),

src/react/epics/polling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const mergePollingEpic = (action$, store) =>
5454
const entries = Object.keys(polling.entries).map(key => polling.entries[key]);
5555
const pages = Math.max(pagination.pages, polling.pages);
5656

57-
if (pagination.page === 1 || config.isLoadMore) {
57+
if (pagination.page === 1 || config.paginationType === 'loadMore') {
5858
return concat(
5959
of(mergePollingIntoEntries(entries, pages)),
6060
of(scrollToEntry(`id_${entries[entries.length - 1].id}`)),

src/react/reducers/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const api = (state = initialState, action) => {
2929
error: false,
3030
loading: false,
3131
entries: applyUpdate(
32-
action.isLoadMore ? state.entries : {},
32+
action.paginationType === 'loadMore' ? state.entries : {},
3333
action.payload.entries,
3434
),
3535
newestEntry: getNewestEntry(

0 commit comments

Comments
 (0)