mirror of
https://github.com/strapi/strapi.git
synced 2025-12-02 01:52:21 +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';
|
import { HeaderSearch as Base } from 'strapi-helper-plugin';
|
||||||
|
|
||||||
const HeaderSearch = styled(Base)`
|
const HeaderSearch = styled(Base)`
|
||||||
left: 32.5rem;
|
left: 32rem;
|
||||||
|
z-index: 1060;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default HeaderSearch;
|
export default HeaderSearch;
|
||||||
|
|||||||
@ -76,13 +76,17 @@ const ListPage = () => {
|
|||||||
}, [search, isLoadingForPermissions]);
|
}, [search, isLoadingForPermissions]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
toggleHeaderSearch({ id: 'Settings.permissions.menu.link.users.label' });
|
if (canRead) {
|
||||||
|
toggleHeaderSearch({ id: 'Settings.permissions.menu.link.users.label' });
|
||||||
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
toggleHeaderSearch();
|
if (canRead) {
|
||||||
|
toggleHeaderSearch();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, [canRead]);
|
||||||
|
|
||||||
const handleChangeDataToDelete = ids => {
|
const handleChangeDataToDelete = ids => {
|
||||||
dispatch({
|
dispatch({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user