aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/ui
diff options
context:
space:
mode:
authorLibravatar muhamedsalih-tw <104364298+muhamedsalih-tw@users.noreply.github.com>2022-11-19 15:21:09 +0530
committerLibravatar GitHub <noreply@github.com>2022-11-19 09:51:09 +0000
commita051331680b21f20201a47601d69505a4cfa9e40 (patch)
treef98dd4bc668c9814d58c0e49170aeeb19c2fe1de /src/components/ui
parent6.2.1-nightly.46 [skip ci] (diff)
downloadferdium-app-a051331680b21f20201a47601d69505a4cfa9e40.tar.gz
ferdium-app-a051331680b21f20201a47601d69505a4cfa9e40.tar.zst
ferdium-app-a051331680b21f20201a47601d69505a4cfa9e40.zip
Transform service components to ts (#778)
Diffstat (limited to 'src/components/ui')
-rw-r--r--src/components/ui/FAB.tsx44
1 files changed, 21 insertions, 23 deletions
diff --git a/src/components/ui/FAB.tsx b/src/components/ui/FAB.tsx
index 37c3c9ec7..acb0f690e 100644
--- a/src/components/ui/FAB.tsx
+++ b/src/components/ui/FAB.tsx
@@ -1,30 +1,28 @@
1/** 1import { Component, ReactElement, ReactNode } from 'react';
2 * Floating Action Button (FAB)
3 */
4import { Component, ReactChildren } from 'react';
5import { observer } from 'mobx-react'; 2import { observer } from 'mobx-react';
6import classnames from 'classnames'; 3import classnames from 'classnames';
4import { noop } from 'lodash';
7 5
8type Props = { 6interface IProps {
9 className: string; 7 className: string;
10 disabled: boolean; 8 disabled?: boolean;
11 onClick: () => void; 9 onClick?: () => void;
12 type: string; 10 type?: string;
13 children: ReactChildren; 11 children: ReactNode;
14 htmlForm: string; 12 htmlForm?: string;
15}; 13}
16
17class Button extends Component<Props> {
18 static defaultProps = {
19 disabled: false,
20 onClick: () => {},
21 type: 'button',
22 htmlForm: '',
23 };
24 14
25 render() { 15@observer
26 const { className, disabled, onClick, type, children, htmlForm } = 16class Button extends Component<IProps> {
27 this.props; 17 render(): ReactElement {
18 const {
19 className,
20 disabled = false,
21 onClick = noop,
22 type = 'button',
23 children,
24 htmlForm = '',
25 } = this.props;
28 26
29 const buttonProps = { 27 const buttonProps = {
30 className: classnames({ 28 className: classnames({
@@ -45,4 +43,4 @@ class Button extends Component<Props> {
45 } 43 }
46} 44}
47 45
48export default observer(Button); 46export default Button;