Grabbed dndbeyond's source code
``` ~/go/bin/sourcemapper -output ddb -jsurl https://media.dndbeyond.com/character-app/static/js/main.90aa78c5.js ```
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import React from "react";
|
||||
|
||||
import { Button } from "@dndbeyond/character-components/es";
|
||||
|
||||
interface withBuilderProps {
|
||||
clsNames: Array<string>;
|
||||
}
|
||||
function withBuilderButton<P extends object, C>(
|
||||
WrappedComponent: React.JSXElementConstructor<P> & C
|
||||
) {
|
||||
type Props = JSX.LibraryManagedAttributes<C, P>;
|
||||
return class WithBuilderButton extends React.PureComponent<
|
||||
Props & withBuilderProps
|
||||
> {
|
||||
static defaultProps = {
|
||||
clsNames: [],
|
||||
};
|
||||
|
||||
render() {
|
||||
const { children, clsNames } = this.props;
|
||||
|
||||
return (
|
||||
<WrappedComponent
|
||||
{...(this.props as any)}
|
||||
clsNames={[...clsNames, "builder-button"]}
|
||||
>
|
||||
{children}
|
||||
</WrappedComponent>
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default withBuilderButton(Button);
|
||||
@@ -0,0 +1,4 @@
|
||||
import Button from "./Button";
|
||||
|
||||
export default Button;
|
||||
export { Button };
|
||||
Reference in New Issue
Block a user