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

Fix/sidebar scroll #47

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
279 changes: 145 additions & 134 deletions components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,70 +28,75 @@ const Sidebar = (props: { showSidebar: boolean }) => {
<span className={styles.maindepartment}>
<Link href="/department/news">News</Link>
</span>
<div className={styles.subdepartment}>
<span>
<Link href="/department/news/campaign-coverage">
Campaign Coverage
</Link>
</span>
<span>
<Link href="/department/news/israel-hamas-war">
Israel-Hamas War
</Link>
</span>
<div className={styles.subdepartment_wrapper}>
<div className={styles.subdepartment}>
<span>
<Link href="/department/news/campaign-coverage">
Campaign Coverage
</Link>
</span>
<span>
<Link href="/department/news/israel-hamas-war">
Israel-Hamas War
</Link>
</span>
</div>
<Image
src="/images/right-arrow.svg"
width={10}
alt="right-arrow"
height={10}
id={styles.right_arrow}
/>
</div>
<Image
src="/images/right-arrow.svg"
width={10}
alt="right-arrow"
height={10}
id={styles.right_arrow}
/>
</div>

<div className={styles.department}>
<span className={styles.maindepartment}>
<Link href="/department/features">Features</Link>
</span>
<div className={styles.subdepartment}>
<span>
<Link href="/department/opinions/voices">
VOICES
</Link>
</span>
<span>
<Link href="/department/opinions/9-11">9/11</Link>
</span>
<div className={styles.subdepartment_wrapper}>
<div className={styles.subdepartment}>
<span>
<Link href="/department/opinions/voices">
VOICES
</Link>
</span>
<span>
<Link href="/department/opinions/9-11">9/11</Link>
</span>
</div>
<Image
src="/images/right-arrow.svg"
width={10}
alt="right-arrow"
height={10}
id={styles.right_arrow}
/>
</div>
<Image
src="/images/right-arrow.svg"
width={10}
alt="right-arrow"
height={10}
id={styles.right_arrow}
/>
</div>

<div className={styles.department}>
<span className={styles.maindepartment}>
<Link href="/department/opinions">Opinions</Link>
</span>
<div className={styles.subdepartment}>
<span>
<Link href="/department/opinions/staff-editorials">
Staff Editorials
</Link>
</span>
<div className={styles.subdepartment_wrapper}>
<div className={styles.subdepartment}>
<span>
<Link href="/department/opinions/staff-editorials">
Staff Editorials
</Link>
</span>
</div>
<Image
src="/images/right-arrow.svg"
width={10}
alt="right-arrow"
height={10}
id={styles.right_arrow}
/>
</div>
<Image
src="/images/right-arrow.svg"
width={10}
alt="right-arrow"
height={10}
id={styles.right_arrow}
/>
</div>

<span className={styles.maindepartment}>
<Link href="/department/science">Science</Link>
</span>
Expand All @@ -100,107 +105,113 @@ const Sidebar = (props: { showSidebar: boolean }) => {
<span className={styles.maindepartment}>
<Link href="/department/ae">Arts & Entertainment</Link>
</span>
<div className={styles.subdepartment}>
<span>
<Link href="/department/ae/fashion">Fashion</Link>
</span>
<span>
<Link href="/department/ae/art">Art</Link>
</span>
<span>
<Link href="/department/ae/culture">Culture</Link>
</span>
<span>
<Link href="/department/ae/film">Film</Link>
</span>
<span>
<Link href="/department/ae/food">Food</Link>
</span>
<span>
<Link href="/department/ae/literature">
Literature
</Link>
</span>
<span>
<Link href="/department/ae/music">Music</Link>
</span>
<span>
<Link href="/department/ae/television">
Television
</Link>
</span>
<span>
<Link href="/department/ae/theater">Theater</Link>
</span>
<span>
<Link href="/department/ae/thinkpiece">
Thinkpiece
</Link>
</span>
<span>
<Link href="/department/ae/sing!">Sing!</Link>
</span>
<span>
<Link href="/department/ae/stc">STC!</Link>
</span>
<div className={styles.subdepartment_wrapper}>
<div className={styles.subdepartment}>
<span>
<Link href="/department/ae/fashion">Fashion</Link>
</span>
<span>
<Link href="/department/ae/art">Art</Link>
</span>
<span>
<Link href="/department/ae/culture">Culture</Link>
</span>
<span>
<Link href="/department/ae/film">Film</Link>
</span>
<span>
<Link href="/department/ae/food">Food</Link>
</span>
<span>
<Link href="/department/ae/literature">
Literature
</Link>
</span>
<span>
<Link href="/department/ae/music">Music</Link>
</span>
<span>
<Link href="/department/ae/television">
Television
</Link>
</span>
<span>
<Link href="/department/ae/theater">Theater</Link>
</span>
<span>
<Link href="/department/ae/thinkpiece">
Thinkpiece
</Link>
</span>
<span>
<Link href="/department/ae/sing!">Sing!</Link>
</span>
<span>
<Link href="/department/ae/stc">STC!</Link>
</span>
</div>
<Image
src="/images/right-arrow.svg"
width={10}
alt="right-arrow"
height={10}
id={styles.right_arrow}
/>
</div>
<Image
src="/images/right-arrow.svg"
width={10}
alt="right-arrow"
height={10}
id={styles.right_arrow}
/>
</div>

<div className={styles.department}>
<span className={styles.maindepartment}>
<Link href="/department/humor">Humor</Link>
</span>
<div className={styles.subdepartment}>
<span>
<Link href="/department/humor/disrespectator">
Disrespectator
</Link>
</span>
<span>
<Link href="/department/humor/spooktator">
Spooktator
</Link>
</span>
<div className={styles.subdepartment_wrapper}>
<div className={styles.subdepartment}>
<span>
<Link href="/department/humor/disrespectator">
Disrespectator
</Link>
</span>
<span>
<Link href="/department/humor/spooktator">
Spooktator
</Link>
</span>
</div>
<Image
src="/images/right-arrow.svg"
width={10}
alt="right-arrow"
height={10}
id={styles.right_arrow}
/>
</div>
<Image
src="/images/right-arrow.svg"
width={10}
alt="right-arrow"
height={10}
id={styles.right_arrow}
/>
</div>

<div className={styles.department}>
<span className={styles.maindepartment}>
<Link href="/department/sports">Sports</Link>
</span>
<div className={styles.subdepartment}>
<span>
<Link href="/department/sports/professional-sports">
Professional Sports
</Link>
</span>
<span>
<Link href="/department/sports/sports-at-stuyvesant">
Sports At Stuy
</Link>
</span>
<div className={styles.subdepartment_wrapper}>
<div className={styles.subdepartment}>
<span>
<Link href="/department/sports/professional-sports">
Professional Sports
</Link>
</span>
<span>
<Link href="/department/sports/sports-at-stuyvesant">
Sports At Stuy
</Link>
</span>
</div>
<Image
src="/images/right-arrow.svg"
width={10}
alt="right-arrow"
height={10}
id={styles.right_arrow}
/>
</div>
<Image
src="/images/right-arrow.svg"
width={10}
alt="right-arrow"
height={10}
id={styles.right_arrow}
/>
</div>

<span className={styles.maindepartment}>
Expand Down
15 changes: 14 additions & 1 deletion styles/Sidebar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@
font-family: var(--secondary-font);
padding-bottom: 10px;
color: var(--primary-immutable);
overflow-y: auto;
-ms-overflow-style: none;
scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
display: none;
}

#sidebar span {
margin-top: 5px;
margin-bottom: 5px;
Expand All @@ -28,6 +35,12 @@
justify-content: center;
}

.subdepartment_wrapper {
position: absolute;
left: 100%;
/* top: 47px; */
}

.subdepartment {
position: absolute;
left: 100%;
Expand Down Expand Up @@ -94,7 +107,7 @@
#right_arrow {
position: absolute;
margin-top: 0.8rem;
margin-left: 220px;
margin-left: -20px;
}

.department:hover #right_arrow {
Expand Down