Skip to content

Commit

Permalink
Merge pull request wojtekmaj#2 from diegomura/refator-files-names
Browse files Browse the repository at this point in the history
Refactor file names
  • Loading branch information
diegomura authored Oct 22, 2016
2 parents 5db8a60 + 8bee91e commit 023539a
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 40 deletions.
10 changes: 5 additions & 5 deletions src/component.js → src/GenericComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import Wrappers from './wrappers';
import ReactMultiChild from 'react/lib/ReactMultiChild';

const PDFRendererComponent = function(element) {
const GenericComponent = function(element) {
this.node = null;
this._mountImage = null;
this._renderedChildren = null;
this._currentElement = element;
};

const PDFRendererComponentMixin = {
const GenericComponentMixin = {
getPublicInstance() {
return this.node;
},
Expand Down Expand Up @@ -44,9 +44,9 @@ const PDFRendererComponentMixin = {
};

Object.assign(
PDFRendererComponent.prototype,
PDFRendererComponentMixin,
GenericComponent.prototype,
GenericComponentMixin,
ReactMultiChild.Mixin
);

export default PDFRendererComponent;
export default GenericComponent;
10 changes: 5 additions & 5 deletions src/PDFTextComponent.js → src/TextComponent.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict';

const PDFTextComponent = function(element) {
const TextComponent = function(element) {
this._currentElement = element;
};

const PDFTextComponentMixin = {
const TextComponentMixin = {
mountComponent(transaction, nativeParent, nativeContainerInfo, context) {
// Just return the text value
return this._currentElement;
Expand All @@ -15,8 +15,8 @@ const PDFTextComponentMixin = {
};

Object.assign(
PDFTextComponent.prototype,
PDFTextComponentMixin
TextComponent.prototype,
TextComponentMixin
);

export default PDFTextComponent;
export default TextComponent;
8 changes: 4 additions & 4 deletions src/injection.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import ReactInjection from 'react/lib/ReactInjection';
import ReactHostComponent from 'react/lib/ReactHostComponent';
import ReactDefaultBatchingStrategy from 'react/lib/ReactDefaultBatchingStrategy';
import PDFRendererReconcileTransaction from './reconcileTransaction';
import PDFRendererComponent from './component';
import PDFTextComponent from './PDFTextComponent';
import GenericComponent from './GenericComponent';
import TextComponent from './TextComponent';

function inject() {
ReactInjection.HostComponent.injectGenericComponentClass(
PDFRendererComponent
GenericComponent
);

ReactInjection.HostComponent.injectTextComponentClass(
PDFTextComponent
TextComponent
);

ReactInjection.Updates.injectReconcileTransaction(
Expand Down
10 changes: 5 additions & 5 deletions src/reconcileTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const ON_RENDERER_READY_QUEUEING = {
*/
const TRANSACTION_WRAPPERS = [ON_RENDERER_READY_QUEUEING];

function PDFRendererReconcileTransaction() {
function ReconcileTransaction() {
this.reinitializeTransaction();
this.reactMountReady = CallbackQueue.getPooled(null);
}
Expand Down Expand Up @@ -72,12 +72,12 @@ const Mixin = {
};

Object.assign(
PDFRendererReconcileTransaction.prototype,
ReconcileTransaction.prototype,
Transaction.Mixin,
PDFRendererReconcileTransaction,
ReconcileTransaction,
Mixin
);

PooledClass.addPoolingTo(PDFRendererReconcileTransaction);
PooledClass.addPoolingTo(ReconcileTransaction);

export default PDFRendererReconcileTransaction;
export default ReconcileTransaction;
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

const PDFCircleComponent = function(element, context) {
const CircleComponent = function(element, context) {
this._element = element;
this._context = context;
};

const PDFCircleComponentMixin = {
const CircleComponentMixin = {
mountComponent() {
const node = this._element;
const {x, y, radius} = node.props;
Expand All @@ -15,8 +15,8 @@ const PDFCircleComponentMixin = {
};

Object.assign(
PDFCircleComponent.prototype,
PDFCircleComponentMixin
CircleComponent.prototype,
CircleComponentMixin
);

export default PDFCircleComponent;
export default CircleComponent;
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

const PDFPageComponent = function(element, context) {
const PageComponent = function(element, context) {
this._element = element;
this._context = context;
};

const PDFPageComponentMixin = {
const PageComponentMixin = {
mountComponent() {
// Because the document already starts with a page
// we don't call addPage the first time
Expand All @@ -17,8 +17,8 @@ const PDFPageComponentMixin = {
};

Object.assign(
PDFPageComponent.prototype,
PDFPageComponentMixin
PageComponent.prototype,
PageComponentMixin
);

export default PDFPageComponent;
export default PageComponent;
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

const PDFRectComponent = function(element, context) {
const RectComponent = function(element, context) {
this._element = element;
this._context = context;
};

const PDFRectComponentMixin = {
const RectComponentMixin = {
mountComponent() {
const node = this._element;
const {children, x, y, width, height, cornerRadius, ...props} = node.props;
Expand All @@ -21,8 +21,8 @@ const PDFRectComponentMixin = {
};

Object.assign(
PDFRectComponent.prototype,
PDFRectComponentMixin
RectComponent.prototype,
RectComponentMixin
);

export default PDFRectComponent;
export default RectComponent;
12 changes: 6 additions & 6 deletions src/wrappers/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

import PDFPageComponent from './PDFPageComponent';
import PDFRectComponent from './PDFRectComponent';
import PDFCircleComponent from './PDFCircleComponent';
import PageComponent from './PageComponent';
import RectComponent from './RectComponent';
import CircleComponent from './CircleComponent';

export default {
'page': PDFPageComponent,
'rect': PDFRectComponent,
'circle': PDFCircleComponent
'page': PageComponent,
'rect': RectComponent,
'circle': CircleComponent
};

0 comments on commit 023539a

Please sign in to comment.