mirror of
https://github.com/maputnik/editor.git
synced 2026-02-09 22:20:03 +00:00
In this PR I have changed some of the jsx files to tsx file. I'm starting off with the "leafs" so that migration of the rest will be easier, hopefully. What I'm basically doing is taking a jsx file, copy paste it into: https://mskelton.dev/ratchet And after that I'm fixing the types as needed. It's not a very long process. Hopefully more PRs will follow and this will be over soon. I don't plan to migrate the storybook as I generally don't understand why is it useful, I'll open an issue to see if anyone thinks differently.
33 lines
860 B
TypeScript
33 lines
860 B
TypeScript
import React from 'react'
|
|
import classnames from 'classnames'
|
|
|
|
type InputButtonProps = {
|
|
"data-wd-key"?: string
|
|
"aria-label"?: string
|
|
onClick?(...args: unknown[]): unknown
|
|
style?: object
|
|
className?: string
|
|
children?: React.ReactNode
|
|
disabled?: boolean
|
|
type?: typeof HTMLButtonElement.prototype.type
|
|
id?: string
|
|
title?: string
|
|
};
|
|
|
|
export default class InputButton extends React.Component<InputButtonProps> {
|
|
render() {
|
|
return <button
|
|
id={this.props.id}
|
|
title={this.props.title}
|
|
type={this.props.type}
|
|
onClick={this.props.onClick}
|
|
disabled={this.props.disabled}
|
|
aria-label={this.props["aria-label"]}
|
|
className={classnames("maputnik-button", this.props.className)}
|
|
data-wd-key={this.props["data-wd-key"]}
|
|
style={this.props.style}
|
|
>
|
|
{this.props.children}
|
|
</button>
|
|
}
|
|
} |