Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add styling props #16

Merged
merged 8 commits into from
Oct 24, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ class Cropper extends React.Component {
cropShape,
showGrid,
style: { containerStyle, cropAreaStyle, imageStyle },
classes: { containerClassName, cropAreaClassName, imageClassName },
} = this.props

return (
Expand All @@ -258,6 +259,7 @@ class Cropper extends React.Component {
innerRef={el => (this.container = el)}
data-testid="container"
containerStyle={containerStyle}
className={containerClassName}
>
<Img
src={this.props.image}
Expand All @@ -268,6 +270,7 @@ class Cropper extends React.Component {
transform: `translate(${x}px, ${y}px) scale(${zoom})`,
}}
imageStyle={imageStyle}
className={cropAreaClassName}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be imageClassName here 😄

tafelito marked this conversation as resolved.
Show resolved Hide resolved
/>
{this.state.cropSize && (
<CropArea
Expand All @@ -279,6 +282,7 @@ class Cropper extends React.Component {
}}
data-testid="cropper"
cropAreaStyle={cropAreaStyle}
className={imageClassName}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opposite here: should be cropAreaClassName

tafelito marked this conversation as resolved.
Show resolved Hide resolved
/>
)}
</Container>
Expand All @@ -294,6 +298,7 @@ Cropper.defaultProps = {
cropShape: 'rect',
showGrid: true,
style: {},
classes: {},
}

export default Cropper