mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +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,
|
||||
environmentId,
|
||||
projectId,
|
||||
className,
|
||||
...rest
|
||||
}) => {
|
||||
const smallScreen = useMediaQuery(`(max-width:${maxWidth})`);
|
||||
|
@ -19,7 +19,7 @@ export const useStyles = makeStyles(theme => ({
|
||||
},
|
||||
},
|
||||
searchIcon: {
|
||||
marginRight: '8px',
|
||||
marginRight: 8,
|
||||
color: theme.palette.grey[600],
|
||||
},
|
||||
inputRoot: {
|
||||
|
@ -44,7 +44,7 @@ export const useStyles = makeStyles(theme => ({
|
||||
},
|
||||
search: {
|
||||
border: `1px solid ${theme.palette.grey[300]}`,
|
||||
height: '35px',
|
||||
height: 35,
|
||||
marginRight: '2rem',
|
||||
},
|
||||
button: {
|
||||
|
@ -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<IFeatureToggleListItem[]>(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 = ({
|
||||
}
|
||||
>
|
||||
<ConditionallyRender
|
||||
condition={filteredFeatures?.length > 0}
|
||||
condition={filteredFeatures.length > 0}
|
||||
show={
|
||||
<FeatureToggleListNew
|
||||
features={filteredFeatures}
|
||||
|
Loading…
Reference in New Issue
Block a user