mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: journal number setting dialog.
This commit is contained in:
27
client/src/components/Forms/InputPrependButton.js
Normal file
27
client/src/components/Forms/InputPrependButton.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { Button, Tooltip, Classes } from '@blueprintjs/core';
|
||||
|
||||
export default function InputPrependButton({
|
||||
buttonProps = {},
|
||||
tooltip = false,
|
||||
tooltipProps = {},
|
||||
}) {
|
||||
const appendButton = useMemo(() => (
|
||||
<Button
|
||||
className={classNames('input-prepend__button', Classes.SMALL)}
|
||||
{...buttonProps}
|
||||
/>
|
||||
), [buttonProps]);
|
||||
|
||||
const appendButtonWithTooltip = useMemo(
|
||||
() => (<Tooltip {...tooltipProps}>{ appendButton }</Tooltip>),
|
||||
[tooltipProps, appendButton],
|
||||
);
|
||||
|
||||
return (
|
||||
<div class="input-prepend">
|
||||
{ tooltip ? appendButtonWithTooltip : appendButton }
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user