diff options
author | 2022-11-17 05:45:39 +0530 | |
---|---|---|
committer | 2022-11-17 00:15:39 +0000 | |
commit | d9502c7516bc2d4ae467c6ea8a2e4816b0885f37 (patch) | |
tree | b339c587a5529ac26d52cfc12d9972a8a00255e6 /src/features/workspaces/components/WorkspaceItem.tsx | |
parent | Transform JSX components to TSX (#755) (diff) | |
download | ferdium-app-d9502c7516bc2d4ae467c6ea8a2e4816b0885f37.tar.gz ferdium-app-d9502c7516bc2d4ae467c6ea8a2e4816b0885f37.tar.zst ferdium-app-d9502c7516bc2d4ae467c6ea8a2e4816b0885f37.zip |
Transfrom workspace components to ts (#775)
Diffstat (limited to 'src/features/workspaces/components/WorkspaceItem.tsx')
-rw-r--r-- | src/features/workspaces/components/WorkspaceItem.tsx | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/features/workspaces/components/WorkspaceItem.tsx b/src/features/workspaces/components/WorkspaceItem.tsx index eb33a0376..b097a8298 100644 --- a/src/features/workspaces/components/WorkspaceItem.tsx +++ b/src/features/workspaces/components/WorkspaceItem.tsx | |||
@@ -1,6 +1,8 @@ | |||
1 | import { Component } from 'react'; | 1 | /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */ // TODO - [TS DEBT] Need to check and remove it |
2 | import { Component, ReactElement } from 'react'; | ||
2 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
3 | import injectSheet from 'react-jss'; | 4 | import withStyles, { WithStylesProps } from 'react-jss'; |
5 | import { noop } from 'lodash'; | ||
4 | import Workspace from '../models/Workspace'; | 6 | import Workspace from '../models/Workspace'; |
5 | 7 | ||
6 | const styles = theme => ({ | 8 | const styles = theme => ({ |
@@ -14,24 +16,24 @@ const styles = theme => ({ | |||
14 | columnName: {}, | 16 | columnName: {}, |
15 | }); | 17 | }); |
16 | 18 | ||
17 | type Props = { | 19 | interface IProps extends WithStylesProps<typeof styles> { |
18 | classes: any; | 20 | workspace: Workspace; |
19 | workspace: typeof Workspace; | 21 | onItemClick: (workspace: Workspace) => void; |
20 | onItemClick: (workspace) => void; | 22 | } |
21 | }; | ||
22 | 23 | ||
23 | class WorkspaceItem extends Component<Props> { | 24 | @observer |
24 | render() { | 25 | class WorkspaceItem extends Component<IProps> { |
26 | render(): ReactElement { | ||
25 | const { classes, workspace, onItemClick } = this.props; | 27 | const { classes, workspace, onItemClick } = this.props; |
26 | 28 | ||
27 | return ( | 29 | return ( |
28 | <tr className={classes.row}> | 30 | <tr className={classes.row}> |
29 | <td onClick={() => onItemClick(workspace)}>{workspace.name}</td> | 31 | <td onClick={() => onItemClick(workspace)} onKeyDown={noop}> |
32 | {workspace.name} | ||
33 | </td> | ||
30 | </tr> | 34 | </tr> |
31 | ); | 35 | ); |
32 | } | 36 | } |
33 | } | 37 | } |
34 | 38 | ||
35 | export default injectSheet(styles, { injectTheme: true })( | 39 | export default withStyles(styles, { injectTheme: true })(WorkspaceItem); |
36 | observer(WorkspaceItem), | ||
37 | ); | ||