1
0
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:
Youssef 2022-03-01 09:03:25 +01:00
parent 65713bc78f
commit 4f3b34115b
4 changed files with 6 additions and 8 deletions

View File

@ -25,7 +25,6 @@ const ResponsiveButton: React.FC<IResponsiveButtonProps> = ({
permission,
environmentId,
projectId,
className,
...rest
}) => {
const smallScreen = useMediaQuery(`(max-width:${maxWidth})`);

View File

@ -19,7 +19,7 @@ export const useStyles = makeStyles(theme => ({
},
},
searchIcon: {
marginRight: '8px',
marginRight: 8,
color: theme.palette.grey[600],
},
inputRoot: {

View File

@ -44,7 +44,7 @@ export const useStyles = makeStyles(theme => ({
},
search: {
border: `1px solid ${theme.palette.grey[300]}`,
height: '35px',
height: 35,
marginRight: '2rem',
},
button: {

View File

@ -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}