From 4f3b34115b4063a356ca1a5ca4d33a06c82de140 Mon Sep 17 00:00:00 2001 From: Youssef Date: Tue, 1 Mar 2022 09:03:25 +0100 Subject: [PATCH] fix: update PR based on feedback --- .../common/ResponsiveButton/ResponsiveButton.tsx | 1 - frontend/src/component/common/SearchField/styles.js | 2 +- .../ProjectFeatureToggles.styles.ts | 2 +- .../ProjectFeatureToggles/ProjectFeatureToggles.tsx | 9 ++++----- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/frontend/src/component/common/ResponsiveButton/ResponsiveButton.tsx b/frontend/src/component/common/ResponsiveButton/ResponsiveButton.tsx index f515cc4a1e..71602501e8 100644 --- a/frontend/src/component/common/ResponsiveButton/ResponsiveButton.tsx +++ b/frontend/src/component/common/ResponsiveButton/ResponsiveButton.tsx @@ -25,7 +25,6 @@ const ResponsiveButton: React.FC = ({ permission, environmentId, projectId, - className, ...rest }) => { const smallScreen = useMediaQuery(`(max-width:${maxWidth})`); diff --git a/frontend/src/component/common/SearchField/styles.js b/frontend/src/component/common/SearchField/styles.js index 3d495b0803..25262fd324 100644 --- a/frontend/src/component/common/SearchField/styles.js +++ b/frontend/src/component/common/SearchField/styles.js @@ -19,7 +19,7 @@ export const useStyles = makeStyles(theme => ({ }, }, searchIcon: { - marginRight: '8px', + marginRight: 8, color: theme.palette.grey[600], }, inputRoot: { diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeatureToggles.styles.ts b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeatureToggles.styles.ts index b8ee003208..889b1cece1 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeatureToggles.styles.ts +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeatureToggles.styles.ts @@ -44,7 +44,7 @@ export const useStyles = makeStyles(theme => ({ }, search: { border: `1px solid ${theme.palette.grey[300]}`, - height: '35px', + height: 35, marginRight: '2rem', }, button: { diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeatureToggles.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeatureToggles.tsx index b356ebf8a1..6fe73c123d 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeatureToggles.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeatureToggles.tsx @@ -19,7 +19,7 @@ import { CREATE_FEATURE } from 'component/providers/AccessProvider/permissions'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import classnames from 'classnames'; -interface IProjectFeatureToggles { +interface IProjectFeatureTogglesProps { features: IFeatureToggleListItem[]; loading: boolean; } @@ -27,19 +27,18 @@ interface IProjectFeatureToggles { export const ProjectFeatureToggles = ({ features, loading, -}: IProjectFeatureToggles) => { +}: IProjectFeatureTogglesProps) => { const styles = useStyles(); const { id } = useParams<{ id: string }>(); const history = useHistory(); const { hasAccess } = useContext(AccessContext); const { uiConfig } = useUiConfig(); const [filter, setFilter] = useState(''); - useState(features); const filteredFeatures = useMemo(() => { const regExp = new RegExp(filter, 'i'); return filter - ? features?.filter(feature => regExp.test(feature?.name)) + ? features.filter(feature => regExp.test(feature.name)) : features; }, [features, filter]); @@ -98,7 +97,7 @@ export const ProjectFeatureToggles = ({ } > 0} + condition={filteredFeatures.length > 0} show={