Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

made the main page static and enabled scrolling in the filters component #5932

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions frontend/src/views/project.css
HelNershingThapa marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.scrollable-container::-webkit-scrollbar {
width: 0;
}
26 changes: 25 additions & 1 deletion frontend/src/views/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { useFetch } from '../hooks/UseFetch';
import { useSetTitleTag } from '../hooks/UseMetaTags';
import { NotFound } from './notFound';
import { ProjectDetailPlaceholder } from '../components/projectDetail/projectDetailPlaceholder';
import './project.css';

const ProjectCreate = React.lazy(() => import('../components/projectCreate/index'));

Expand Down Expand Up @@ -152,14 +153,37 @@ export const MoreFilters = () => {
const navigate = useNavigate();
const [fullProjectsQuery] = useExploreProjectsQueryParams();

useEffect(() => {
// Disable scrolling outside the component when it appears
document.body.style.overflow = 'hidden';
document.documentElement.style.overflow = 'hidden';

return () => {
// Restore scrolling when the component is closed
document.body.style.overflow = 'auto';
document.documentElement.style.overflow = 'auto';
};
}, []);

const currentUrl = `/explore${
stringify(fullProjectsQuery) ? ['?', stringify(fullProjectsQuery)].join('') : ''
}`;

return (
<>
<div className="absolute left-0 z-4 mt1 w-40-l w-100 h-100 bg-white h4 ph1 ph5-l">
<MoreFiltersForm currentUrl={currentUrl} />
<div
className="scrollable-container"
style={{
height: '100%',
overflow: 'auto',
HelNershingThapa marked this conversation as resolved.
Show resolved Hide resolved
scrollbarWidth: 'none',
msOverflowStyle: 'none',
HelNershingThapa marked this conversation as resolved.
Show resolved Hide resolved
}}
>
<MoreFiltersForm currentUrl={currentUrl} />
<MoreFiltersForm currentUrl={currentUrl} />
</div>
</div>
<div
onClick={() => navigate(currentUrl)}
Expand Down