mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: update PR based on feedback
This commit is contained in:
		
							parent
							
								
									65713bc78f
								
							
						
					
					
						commit
						4f3b34115b
					
				| @ -25,7 +25,6 @@ const ResponsiveButton: React.FC<IResponsiveButtonProps> = ({ | |||||||
|     permission, |     permission, | ||||||
|     environmentId, |     environmentId, | ||||||
|     projectId, |     projectId, | ||||||
|     className, |  | ||||||
|     ...rest |     ...rest | ||||||
| }) => { | }) => { | ||||||
|     const smallScreen = useMediaQuery(`(max-width:${maxWidth})`); |     const smallScreen = useMediaQuery(`(max-width:${maxWidth})`); | ||||||
|  | |||||||
| @ -19,7 +19,7 @@ export const useStyles = makeStyles(theme => ({ | |||||||
|         }, |         }, | ||||||
|     }, |     }, | ||||||
|     searchIcon: { |     searchIcon: { | ||||||
|         marginRight: '8px', |         marginRight: 8, | ||||||
|         color: theme.palette.grey[600], |         color: theme.palette.grey[600], | ||||||
|     }, |     }, | ||||||
|     inputRoot: { |     inputRoot: { | ||||||
|  | |||||||
| @ -44,7 +44,7 @@ export const useStyles = makeStyles(theme => ({ | |||||||
|     }, |     }, | ||||||
|     search: { |     search: { | ||||||
|         border: `1px solid ${theme.palette.grey[300]}`, |         border: `1px solid ${theme.palette.grey[300]}`, | ||||||
|         height: '35px', |         height: 35, | ||||||
|         marginRight: '2rem', |         marginRight: '2rem', | ||||||
|     }, |     }, | ||||||
|     button: { |     button: { | ||||||
|  | |||||||
| @ -19,7 +19,7 @@ import { CREATE_FEATURE } from 'component/providers/AccessProvider/permissions'; | |||||||
| import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; | import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; | ||||||
| import classnames from 'classnames'; | import classnames from 'classnames'; | ||||||
| 
 | 
 | ||||||
| interface IProjectFeatureToggles { | interface IProjectFeatureTogglesProps { | ||||||
|     features: IFeatureToggleListItem[]; |     features: IFeatureToggleListItem[]; | ||||||
|     loading: boolean; |     loading: boolean; | ||||||
| } | } | ||||||
| @ -27,19 +27,18 @@ interface IProjectFeatureToggles { | |||||||
| export const ProjectFeatureToggles = ({ | export const ProjectFeatureToggles = ({ | ||||||
|     features, |     features, | ||||||
|     loading, |     loading, | ||||||
| }: IProjectFeatureToggles) => { | }: IProjectFeatureTogglesProps) => { | ||||||
|     const styles = useStyles(); |     const styles = useStyles(); | ||||||
|     const { id } = useParams<{ id: string }>(); |     const { id } = useParams<{ id: string }>(); | ||||||
|     const history = useHistory(); |     const history = useHistory(); | ||||||
|     const { hasAccess } = useContext(AccessContext); |     const { hasAccess } = useContext(AccessContext); | ||||||
|     const { uiConfig } = useUiConfig(); |     const { uiConfig } = useUiConfig(); | ||||||
|     const [filter, setFilter] = useState(''); |     const [filter, setFilter] = useState(''); | ||||||
|     useState<IFeatureToggleListItem[]>(features); |  | ||||||
| 
 | 
 | ||||||
|     const filteredFeatures = useMemo(() => { |     const filteredFeatures = useMemo(() => { | ||||||
|         const regExp = new RegExp(filter, 'i'); |         const regExp = new RegExp(filter, 'i'); | ||||||
|         return filter |         return filter | ||||||
|             ? features?.filter(feature => regExp.test(feature?.name)) |             ? features.filter(feature => regExp.test(feature.name)) | ||||||
|             : features; |             : features; | ||||||
|     }, [features, filter]); |     }, [features, filter]); | ||||||
| 
 | 
 | ||||||
| @ -98,7 +97,7 @@ export const ProjectFeatureToggles = ({ | |||||||
|             } |             } | ||||||
|         > |         > | ||||||
|             <ConditionallyRender |             <ConditionallyRender | ||||||
|                 condition={filteredFeatures?.length > 0} |                 condition={filteredFeatures.length > 0} | ||||||
|                 show={ |                 show={ | ||||||
|                     <FeatureToggleListNew |                     <FeatureToggleListNew | ||||||
|                         features={filteredFeatures} |                         features={filteredFeatures} | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user