diff options
author | crupest <crupest@outlook.com> | 2022-04-30 23:02:44 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-04-30 23:02:44 +0800 |
commit | 5a095290db9abf5f8e9528ef4f56c0b974231ad1 (patch) | |
tree | e5100870518af9dbce285f9c7cd0099c5b6b2865 /FrontEnd/src/views/common/button | |
parent | fff1a785aad30ebc9e96bbf973c7916143193b36 (diff) | |
download | timeline-5a095290db9abf5f8e9528ef4f56c0b974231ad1.tar.gz timeline-5a095290db9abf5f8e9528ef4f56c0b974231ad1.tar.bz2 timeline-5a095290db9abf5f8e9528ef4f56c0b974231ad1.zip |
...
Diffstat (limited to 'FrontEnd/src/views/common/button')
-rw-r--r-- | FrontEnd/src/views/common/button/IconButton.css | 9 | ||||
-rw-r--r-- | FrontEnd/src/views/common/button/IconButton.tsx | 25 |
2 files changed, 34 insertions, 0 deletions
diff --git a/FrontEnd/src/views/common/button/IconButton.css b/FrontEnd/src/views/common/button/IconButton.css new file mode 100644 index 00000000..ef4dca00 --- /dev/null +++ b/FrontEnd/src/views/common/button/IconButton.css @@ -0,0 +1,9 @@ +.cru-icon-button { + color: var(--cru-theme-color); + font-size: 1.4rem; + cursor: pointer; +} + +.cru-icon-button.large { + font-size: 1.6rem; +} diff --git a/FrontEnd/src/views/common/button/IconButton.tsx b/FrontEnd/src/views/common/button/IconButton.tsx new file mode 100644 index 00000000..56c62588 --- /dev/null +++ b/FrontEnd/src/views/common/button/IconButton.tsx @@ -0,0 +1,25 @@ +import classNames from "classnames"; +import React from "react"; + +export type IconButtonProps = { + icon: string; + color?: string; + large?: boolean; +} & React.ComponentPropsWithRef<"i">; + +export default function IconButton(props: IconButtonProps): JSX.Element { + const { icon, color, className, large, ...otherProps } = props; + + return ( + <i + className={classNames( + "cru-icon-button", + large && "large", + "bi-" + icon, + color ? "cru-" + color : "cru-primary", + className + )} + {...otherProps} + /> + ); +} |