mirror of
https://github.com/strapi/strapi.git
synced 2025-08-09 17:26:11 +00:00
Hide search when not allowed to read
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
1a23abf405
commit
96bd475c5a
@ -2,7 +2,8 @@ import styled from 'styled-components';
|
||||
import { HeaderSearch as Base } from 'strapi-helper-plugin';
|
||||
|
||||
const HeaderSearch = styled(Base)`
|
||||
left: 32.5rem;
|
||||
left: 32rem;
|
||||
z-index: 1060;
|
||||
`;
|
||||
|
||||
export default HeaderSearch;
|
||||
|
@ -76,13 +76,17 @@ const ListPage = () => {
|
||||
}, [search, isLoadingForPermissions]);
|
||||
|
||||
useEffect(() => {
|
||||
toggleHeaderSearch({ id: 'Settings.permissions.menu.link.users.label' });
|
||||
if (canRead) {
|
||||
toggleHeaderSearch({ id: 'Settings.permissions.menu.link.users.label' });
|
||||
}
|
||||
|
||||
return () => {
|
||||
toggleHeaderSearch();
|
||||
if (canRead) {
|
||||
toggleHeaderSearch();
|
||||
}
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
}, [canRead]);
|
||||
|
||||
const handleChangeDataToDelete = ids => {
|
||||
dispatch({
|
||||
|
Loading…
x
Reference in New Issue
Block a user