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

@uppy/image-editor: fix label definitions #5111

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Changes from all commits
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
56 changes: 16 additions & 40 deletions packages/@uppy/image-editor/src/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,11 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
const { i18n, opts } = this.props

return (
<label
role="tooltip"
aria-label={i18n('revert')}
data-microtip-position="top"
>
<label role="tooltip" data-microtip-position="top">
<button
type="button"
className="uppy-u-reset uppy-c-btn"
aria-label={i18n('revert')}
onClick={() => {
this.cropper.reset()
this.cropper.setAspectRatio(
Expand Down Expand Up @@ -205,14 +202,11 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
const { i18n } = this.props

return (
<label
role="tooltip"
aria-label={i18n('rotate')}
data-microtip-position="top"
>
<label role="tooltip" data-microtip-position="top">
<button
type="button"
className="uppy-u-reset uppy-c-btn"
aria-label={i18n('rotate')}
onClick={this.onRotate90Deg}
>
<svg
Expand All @@ -234,14 +228,11 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
const { i18n } = this.props

return (
<label
role="tooltip"
aria-label={i18n('flipHorizontal')}
data-microtip-position="top"
>
<label role="tooltip" data-microtip-position="top">
<button
type="button"
className="uppy-u-reset uppy-c-btn"
aria-label={i18n('flipHorizontal')}
onClick={() =>
this.cropper.scaleX(-this.cropper.getData().scaleX || -1)
}
Expand All @@ -265,14 +256,11 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
const { i18n } = this.props

return (
<label
role="tooltip"
aria-label={i18n('zoomIn')}
data-microtip-position="top"
>
<label role="tooltip" data-microtip-position="top">
<button
type="button"
className="uppy-u-reset uppy-c-btn"
aria-label={i18n('zoomIn')}
onClick={() => this.cropper.zoom(0.1)}
>
<svg
Expand All @@ -295,14 +283,11 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
const { i18n } = this.props

return (
<label
role="tooltip"
aria-label={i18n('zoomOut')}
data-microtip-position="top"
>
<label role="tooltip" data-microtip-position="top">
<button
type="button"
className="uppy-u-reset uppy-c-btn"
aria-label={i18n('zoomOut')}
onClick={() => this.cropper.zoom(-0.1)}
>
<svg
Expand All @@ -324,14 +309,11 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
const { i18n } = this.props

return (
<label
role="tooltip"
aria-label={i18n('aspectRatioSquare')}
data-microtip-position="top"
>
<label role="tooltip" data-microtip-position="top">
<button
type="button"
className="uppy-u-reset uppy-c-btn"
aria-label={i18n('aspectRatioSquare')}
onClick={() => this.cropper.setAspectRatio(1)}
>
<svg
Expand All @@ -353,14 +335,11 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
const { i18n } = this.props

return (
<label
role="tooltip"
aria-label={i18n('aspectRatioLandscape')}
data-microtip-position="top"
>
<label role="tooltip" data-microtip-position="top">
<button
type="button"
className="uppy-u-reset uppy-c-btn"
aria-label={i18n('aspectRatioLandscape')}
onClick={() => this.cropper.setAspectRatio(16 / 9)}
>
<svg
Expand All @@ -382,13 +361,10 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
const { i18n } = this.props

return (
<label
role="tooltip"
aria-label={i18n('aspectRatioPortrait')}
data-microtip-position="top"
>
<label role="tooltip" data-microtip-position="top">
<button
type="button"
aria-label={i18n('aspectRatioPortrait')}
className="uppy-u-reset uppy-c-btn"
onClick={() => this.cropper.setAspectRatio(9 / 16)}
>
Expand Down
Loading