Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #73 from notion/upgradeReact-15
Browse files Browse the repository at this point in the history
Migrate to React 15.5
  • Loading branch information
brijeshb42 authored May 3, 2017
2 parents f715d3b + fd6cff6 commit fd3008c
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 47 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"dependencies": {
"draft-js": "^0.10.0",
"immutable": "^3.7.6",
"react-addons-css-transition-group": "^15.0.0"
"prop-types": "^15.5.8",
"react-transition-group": "^1.1.2"
},
"peerDependencies": {
"react": "^15.0.0",
Expand All @@ -48,7 +49,7 @@
"babel-preset-react": "^6.5.0",
"chai": "^3.5.0",
"css-loader": "^0.23.1",
"enzyme": "^2.5.1",
"enzyme": "^2.8.2",
"eslint": "^3.3.1",
"eslint-config-airbnb": "^10.0.1",
"eslint-loader": "^1.5.0",
Expand All @@ -64,7 +65,6 @@
"mocha": "^2.4.5",
"mocha-loader": "^0.7.1",
"node-sass": "^3.4.2",
"react-addons-test-utils": "^15.0.0",
"react-hot-loader": "^1.3.0",
"sass-loader": "^3.2.0",
"style-loader": "^0.13.1",
Expand Down
9 changes: 5 additions & 4 deletions src/components/addbutton.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import PropTypes from 'prop-types';
// import './addbutton.scss';

import React, { PropTypes } from 'react';
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
import React from 'react';
import CSSTransitionGroup from 'react-transition-group/CSSTransitionGroup';

import { getSelectedBlockNode } from '../util';

Expand Down Expand Up @@ -150,7 +151,7 @@ export default class AddButton extends React.Component {
<i className="fa fa-plus-circle fa-lg" />
</button>
{this.state.isOpen ? (
<ReactCSSTransitionGroup
<CSSTransitionGroup
transitionName="md-example"
transitionEnterTimeout={200}
transitionLeaveTimeout={100}
Expand All @@ -168,7 +169,7 @@ export default class AddButton extends React.Component {
/>
);
})}
</ReactCSSTransitionGroup>
</CSSTransitionGroup>
) : null}
</div>
);
Expand Down
3 changes: 2 additions & 1 deletion src/components/blocks/atomic.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import PropTypes from 'prop-types';
// import './atomic.scss';

import React, { PropTypes } from 'react';
import React from 'react';

const AtomicBlock = (props) => {
const content = props.getEditorState().getCurrentContent();
Expand Down
3 changes: 2 additions & 1 deletion src/components/blocks/image.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import PropTypes from 'prop-types';
import React from 'react';

import { EditorBlock } from 'draft-js';

Expand Down
3 changes: 2 additions & 1 deletion src/components/blocks/todo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import PropTypes from 'prop-types';
// import './todo.scss';

import React, { PropTypes } from 'react';
import React from 'react';
import { EditorBlock } from 'draft-js';

import { updateDataOfBlock } from '../../model/';
Expand Down
3 changes: 2 additions & 1 deletion src/components/blocktoolbar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import PropTypes from 'prop-types';
import React from 'react';
import { RichUtils } from 'draft-js';

import StyleButton from './stylebutton';
Expand Down
3 changes: 2 additions & 1 deletion src/components/entities/link.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import PropTypes from 'prop-types';
import React from 'react';

import { Entity } from '../../util/constants';

Expand Down
3 changes: 2 additions & 1 deletion src/components/inlinetoolbar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import PropTypes from 'prop-types';
import React from 'react';

import StyleButton from './stylebutton';

Expand Down
3 changes: 2 additions & 1 deletion src/components/sides/break.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import PropTypes from 'prop-types';
import React from 'react';

import { addNewBlock } from '../../model';
import { Block } from '../../util/constants';
Expand Down
3 changes: 2 additions & 1 deletion src/components/sides/image.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import PropTypes from 'prop-types';
import React from 'react';

import { addNewBlock } from '../../model';
import { Block } from '../../util/constants';
Expand Down
3 changes: 2 additions & 1 deletion src/components/stylebutton.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import PropTypes from 'prop-types';
import React from 'react';

import { HYPERLINK } from '../util/constants.js';

Expand Down
25 changes: 13 additions & 12 deletions src/components/toolbar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import PropTypes from 'prop-types';
// import './toolbar.scss';

import React, { PropTypes } from 'react';
import React from 'react';
import ReactDOM from 'react-dom';

import BlockToolbar from './blocktoolbar';
Expand Down Expand Up @@ -330,15 +331,15 @@ export const INLINE_BUTTONS = [
description: 'Add a link',
},
];
// {
// label: 'S',
// style: 'STRIKETHROUGH',
// icon: 'strikethrough',
// description: 'Strikethrough',
// },
// {
// label: 'Code',
// style: 'CODE',
// description: 'Inline Code',
// },
// {
// label: 'S',
// style: 'STRIKETHROUGH',
// icon: 'strikethrough',
// description: 'Strikethrough',
// },
// {
// label: 'Code',
// style: 'CODE',
// description: 'Inline Code',
// },

19 changes: 10 additions & 9 deletions src/editor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import PropTypes from 'prop-types';
import React from 'react';
import {
Editor,
EditorState,
Expand Down Expand Up @@ -43,16 +44,16 @@ class MediumDraftEditor extends React.Component {
stringToTypeMap: PropTypes.object,
blockRenderMap: PropTypes.object,
blockButtons: PropTypes.arrayOf(PropTypes.shape({
label: React.PropTypes.string.isRequired,
style: React.PropTypes.string.isRequired,
icon: React.PropTypes.string,
description: React.PropTypes.string,
label: PropTypes.string.isRequired,
style: PropTypes.string.isRequired,
icon: PropTypes.string,
description: PropTypes.string,
})),
inlineButtons: PropTypes.arrayOf(PropTypes.shape({
label: React.PropTypes.string.isRequired,
style: React.PropTypes.string.isRequired,
icon: React.PropTypes.string,
description: React.PropTypes.string,
label: PropTypes.string.isRequired,
style: PropTypes.string.isRequired,
icon: PropTypes.string,
description: PropTypes.string,
})),
placeholder: PropTypes.string,
continuousBlocks: PropTypes.arrayOf(PropTypes.string),
Expand Down
11 changes: 6 additions & 5 deletions src/example.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import PropTypes from 'prop-types';
/* eslint-disable */

import React from 'react';
Expand Down Expand Up @@ -157,9 +158,9 @@ class SeparatorSideButton extends React.Component {
class EmbedSideButton extends React.Component {

static propTypes = {
setEditorState: React.PropTypes.func,
getEditorState: React.PropTypes.func,
close: React.PropTypes.func,
setEditorState: PropTypes.func,
getEditorState: PropTypes.func,
close: PropTypes.func,
};

constructor(props) {
Expand Down Expand Up @@ -211,7 +212,7 @@ class EmbedSideButton extends React.Component {
class AtomicEmbedComponent extends React.Component {

static propTypes = {
data: React.PropTypes.object.isRequired,
data: PropTypes.object.isRequired,
}

constructor(props) {
Expand Down Expand Up @@ -520,7 +521,7 @@ class App extends React.Component {
</div>
);
}
};
}

if (!__PROD__) {
window.ga = function() {
Expand Down
10 changes: 5 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ if (isProd) {
}
},
{
'react-addons-css-transition-group': {
root: ['React','addons','CSSTransitionGroup'],
commonjs2: 'react-addons-css-transition-group',
commonjs: 'react-addons-css-transition-group',
amd: 'react-addons-css-transition-group',
'react-transition-group/CSSTransitionGroup': {
root: ['React', 'addons', 'CSSTransitionGroup'],
commonjs2: 'react-transition-group/CSSTransitionGroup',
commonjs: 'react-transition-group/CSSTransitionGroup',
amd: 'react-transition-group/CSSTransitionGroup',
}
},
{
Expand Down

0 comments on commit fd3008c

Please sign in to comment.