This repository has been archived by the owner on Nov 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: kaiguo <kaiguo@xsky.com>
- Loading branch information
kaiguo
committed
Dec 21, 2022
1 parent
f62a5f5
commit f3ebf1c
Showing
12 changed files
with
241 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
import React from 'react'; | ||
import { Button as BSButton } from 'react-bootstrap'; | ||
import Tooltip from '../Tooltip' | ||
import Tooltip from '../Tooltip'; | ||
import { ButtonProps } from '../../interface'; | ||
import './style.scss'; | ||
|
||
interface Button extends ButtonProps {}; | ||
interface Button extends ButtonProps {} | ||
|
||
const Button:React.FC<ButtonProps> = props => { | ||
const Button: React.FC<ButtonProps> = props => { | ||
const { toolTip, children, ...restProps } = props; | ||
const { disabled, className } = restProps; | ||
return ( | ||
toolTip ? ( | ||
<Tooltip | ||
label={ | ||
<div className="Button_Tooltip-Div"> | ||
<BSButton | ||
{...(restProps as any)} | ||
className={disabled ? `Button_Tooltip-Div-Button ${className}` : `${className}` } | ||
> | ||
{children} | ||
</BSButton> | ||
</div> | ||
} | ||
{...toolTip} | ||
/> | ||
) : <BSButton {...(restProps as any)}>{children}</BSButton> | ||
) | ||
} | ||
return toolTip ? ( | ||
<Tooltip | ||
label={ | ||
<div className="Button_Tooltip-Div"> | ||
<BSButton | ||
{...(restProps as any)} | ||
className={disabled ? `Button_Tooltip-Div-Button ${className}` : `${className}`} | ||
> | ||
{children} | ||
</BSButton> | ||
</div> | ||
} | ||
{...toolTip} | ||
/> | ||
) : ( | ||
<BSButton {...(restProps as any)}>{children}</BSButton> | ||
); | ||
}; | ||
|
||
export default Button; | ||
export default Button; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.