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

Home page exceeds page's dimensions on Chromium-based browsers #470

Merged
merged 4 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 9 additions & 3 deletions apps/website/src/components/ProjectsList.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client"

import { Button, Grid, GridItem, HStack, IconButton, Text, VStack } from "@chakra-ui/react"
import { useCallback, useEffect, useState } from "react"
import { useCallback, useEffect, useRef, useState } from "react"
import ProjectCard from "../components/ProjectCard"
import allProjects from "../data/projects.json"
import IconChevronLeft from "../icons/IconChevronLeft"
Expand All @@ -16,6 +16,7 @@ export default function ProjectsList(props: any) {
const [index, setIndex] = useState<number>(0)
const [selectedCategory, setSelectedCategory] = useState<string | null>(null)
const [onlyPSE, setOnlyPSE] = useState<boolean | null>(null)
const viewToScrollRef = useRef<HTMLDivElement>(null)

const filterProjects = useCallback(() => {
let filteredProjects = allProjects
Expand All @@ -39,6 +40,12 @@ export default function ProjectsList(props: any) {
filterProjects()
}, [selectedCategory, onlyPSE])

useEffect(() => {
if (viewToScrollRef.current) {
viewToScrollRef.current.scrollIntoView({ behavior: "smooth" })
}
}, [index])

return (
<VStack {...props}>
<VStack align="left" spacing="6">
Expand Down Expand Up @@ -66,9 +73,8 @@ export default function ProjectsList(props: any) {
</HStack>
</VStack>

<VStack align="left" spacing="6">
<VStack align="left" spacing="6" ref={viewToScrollRef}>
<Text fontSize="20">Category</Text>

<HStack spacing="3" flexWrap="wrap">
{getProjectCategories(allProjects).map((category) => (
<Button
Expand Down
3 changes: 2 additions & 1 deletion apps/website/src/styles/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const styles: Styles = {
color: "white"
},
"body, #__next": {
minHeight: "100vh"
minHeight: "100vh",
overflowX: "hidden"
},
"#__next": {
display: "flex",
Expand Down
Loading