Skip to content

Commit

Permalink
fixing reordering
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreardon committed May 2, 2018
1 parent 5883efd commit 511e911
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions stories/src/dynamic/quote-app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import styled from 'styled-components';
import QuoteList from '../primatives/quote-list';
import { DragDropContext } from '../../../src/';
import { generateQuoteMap, authors } from '../data';
import reorder from '../reorder';
import { reorderQuoteMap } from '../reorder';
import type { Quote, QuoteMap, Author } from '../types';
import type { DropResult } from '../../../src/types';
import { grid } from '../constants';
Expand Down Expand Up @@ -152,15 +152,11 @@ export default class QuoteApp extends React.Component<*, State> {
return;
}

const quotes = reorder(
this.state.quotes,
result.source.index,
result.destination.index
);

this.setState({
quotes,
});
this.setState(reorderQuoteMap({
quoteMap: this.state.quoteMap,
source: result.source,
destination: result.destination,
}));
}

render() {
Expand Down

0 comments on commit 511e911

Please sign in to comment.