Add Sections Component #49
Merged
j285he
merged 12 commits from j285he-sections
into main
7 months ago
@ -0,0 +1,60 @@ |
||||
.sections { |
||||
display: flex; |
||||
flex-direction: row; |
||||
gap: calc(15rem / 16); |
||||
|
||||
} |
||||
|
||||
.sections h1 { |
||||
flex: 3; |
||||
text-align: right; |
||||
margin: 0; |
||||
} |
||||
|
||||
.separator { |
||||
flex: 1; |
||||
background-color: var(--label); |
||||
height: calc(1rem / 16); |
||||
width: 100%; |
||||
margin-top: calc(30rem / 16); |
||||
} |
||||
|
||||
.nav { |
||||
flex: 3; |
||||
display: flex; |
||||
flex-direction: column; |
||||
} |
||||
|
||||
.nav ul { |
||||
list-style-type: none; |
||||
margin: 0; |
||||
padding: 0; |
||||
} |
||||
|
||||
.nav li { |
||||
margin: calc(20rem / 16); |
||||
margin-left: 0; |
||||
} |
||||
|
||||
.nav li:first-child { |
||||
margin-top: calc(18rem / 16); |
||||
} |
||||
|
||||
.nav li .linkNumber { |
||||
color: var(--secondary-accent); |
||||
margin: 0; |
||||
display: inline; |
||||
} |
||||
|
||||
.nav li a { |
||||
font-size: calc(24rem / 16); |
||||
color: var(--primary-text); |
||||
} |
||||
|
||||
.nav li a:hover .linkName { |
||||
text-decoration: underline; |
||||
} |
||||
|
||||
.nav li .linkName { |
||||
margin: 0; |
||||
display: inline; |
||||
} |
@ -0,0 +1,45 @@ |
||||
import React from "react"; |
||||
|
||||
import styles from "./Sections.module.css"; |
||||
|
||||
interface SectionsData { |
||||
name: string; |
||||
url: string; |
||||
} |
||||
|
||||
interface SectionsProps { |
||||
/* Whether to display the "Sections" title and separator that appears on the left. */ |
||||
showHeader?: boolean; |
||||
data: SectionsData[]; |
||||
} |
||||
j285he marked this conversation as resolved
|
||||
|
||||
export function Sections({ data, showHeader = true }: SectionsProps) { |
||||
return ( |
||||
j285he marked this conversation as resolved
|
||||
<section className={styles.sections}> |
||||
{showHeader ? ( |
||||
<> |
||||
<h1>Sections</h1> |
||||
<div className={styles.separator} /> |
||||
</> |
||||
) : ( |
||||
"" |
||||
)} |
||||
<nav className={styles.nav}> |
||||
<ul> |
||||
{data.map((datum, index) => { |
||||
return ( |
||||
<li key={`${datum.name}-${index}`}> |
||||
<a href={datum.url}> |
||||
<span className={styles.linkNumber}> |
||||
{String(index).padStart(2, "0")}{" "} |
||||
</span> |
||||
<span className={styles.linkName}>{datum.name}</span> |
||||
</a> |
||||
</li> |
||||
); |
||||
})} |
||||
</ul> |
||||
</nav> |
||||
</section> |
||||
); |
||||
} |
@ -0,0 +1,46 @@ |
||||
export const sectionsData = [ |
||||
a258wang marked this conversation as resolved
|
||||
{ |
||||
name: "Demographics", |
||||
url: "/", |
||||
}, |
||||
{ |
||||
name: "Academics", |
||||
url: "/", |
||||
}, |
||||
{ |
||||
name: "Co-op", |
||||
url: "/", |
||||
}, |
||||
{ |
||||
name: "Lifestyle and Interests", |
||||
url: "/", |
||||
}, |
||||
{ |
||||
name: "Intimacy and Drugs", |
||||
url: "/", |
||||
}, |
||||
{ |
||||
name: "Post-grad", |
||||
url: "/", |
||||
}, |
||||
{ |
||||
name: "Friends", |
||||
url: "/", |
||||
}, |
||||
{ |
||||
name: "Miscellaneous", |
||||
url: "/", |
||||
}, |
||||
{ |
||||
name: "Mental Health", |
||||
url: "/", |
||||
}, |
||||
{ |
||||
name: "Personal", |
||||
url: "/", |
||||
}, |
||||
{ |
||||
name: "Contributors", |
||||
url: "/", |
||||
}, |
||||
]; |
Loading…
Reference in new issue
Continuing from thoughts here: #49
Maybe try getting rid of min-width and see what that looks like? I suspect it'll be fine if we don't specify the width at all.
Removed min-width, still doesn't look correct on small screens but might be better when we get mobile-specific font sizes?