From c008473a61934d84277391f9afc34b015799194a Mon Sep 17 00:00:00 2001 From: Konstantin Markov Date: Mon, 24 Jun 2024 15:39:22 +0300 Subject: [PATCH] Improve types, fix lint --- client/components/UI/List/Column.tsx | 38 +++++++++++++++------------- client/utils/index.ts | 1 + 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/client/components/UI/List/Column.tsx b/client/components/UI/List/Column.tsx index 3eac2e008..c8f9e0d1e 100644 --- a/client/components/UI/List/Column.tsx +++ b/client/components/UI/List/Column.tsx @@ -7,7 +7,26 @@ import classNames from 'classnames'; * @name Column * @description Column Component of a list item */ -export const Column = ({children, grow, border, noPadding, hasCheck, checked, className}) => ( + +interface IProps { + children: Array | JSX.Element; + grow?: boolean; + border?: boolean; + noPadding?: boolean; + hasCheck?: boolean; + checked?: boolean; + className?: string; +} + +export const Column = ({ + children, + grow = false, + border = true, + noPadding = false, + hasCheck = false, + checked, + className, +}: IProps) => (
); - -Column.propTypes = { - children: PropTypes.node.isRequired, - grow: PropTypes.bool, - border: PropTypes.bool, - noPadding: PropTypes.bool, - hasCheck: PropTypes.bool, - checked: PropTypes.bool, - className: PropTypes.string, -}; - -Column.defaultProps = { - grow: false, - border: true, - noPadding: false, - hasCheck: false, -}; diff --git a/client/utils/index.ts b/client/utils/index.ts index 71e594a3d..3c163411b 100644 --- a/client/utils/index.ts +++ b/client/utils/index.ts @@ -545,6 +545,7 @@ export const getUsersForDesk = (desk, globalUserList = []) => { if (!desk) return globalUserList; const deskMembersSet = new Set(desk.members.map((member) => member.user)); + return globalUserList.filter(({_id}) => deskMembersSet.has(_id)); };