-
Notifications
You must be signed in to change notification settings - Fork 1
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
Added Resources title and section title component #177
base: main
Are you sure you want to change the base?
Changes from all commits
5f74978
30cbefd
899447d
c0cac36
af7b373
a23be66
0063909
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@use "zothacks-theme" as theme; | ||
|
||
$item-padding-y: 32px; | ||
$item-padding-x: 48px; | ||
|
||
$heading-font-size: 28px; | ||
|
||
.card { | ||
background-color: theme.$white; | ||
border: 6px solid theme.$white; | ||
box-shadow: inset 0 0 0 6px theme.$black; | ||
border-radius: 16px; | ||
|
||
padding: $item-padding-y $item-padding-x; | ||
|
||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.bang { | ||
margin-right: $item-padding-x - 7; | ||
} | ||
|
||
.title { | ||
font-size: $heading-font-size; | ||
font-weight: 600; | ||
color: theme.$light-blue; | ||
} | ||
|
||
.description { | ||
margin: 0; | ||
font-weight: 500; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Image from "next/image"; | ||
import resourcesBang from "@/assets/images/resources-bang.svg"; | ||
|
||
import styles from "./HeadingCard.module.scss"; | ||
|
||
interface HeadingCardProps { | ||
title: string; | ||
description: string; | ||
} | ||
|
||
export default function HeadingCard({ title, description }: HeadingCardProps) { | ||
return ( | ||
<div className={styles.card}> | ||
<Image | ||
className={styles.bang} | ||
src={resourcesBang} | ||
alt="exclamation mark" | ||
/> | ||
<div> | ||
<h2 className={styles.title}>{title}</h2> | ||
<p className={styles.description}>{description}</p> | ||
</div> | ||
</div> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
import { PortableText } from "@portabletext/react"; | ||
import { client } from "@/lib/sanity/client"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Chore: client is defined in our own code, so where it was initially placed was correct. |
||
import imageUrlBuilder from "@sanity/image-url"; | ||
|
||
import styles from "./ApiResources.module.scss"; | ||
|
||
import ResourceCard from "../../components/ResourceCard/ResourceCard"; | ||
import { getResources } from "../../getResources"; | ||
import { client } from "@/lib/sanity/client"; | ||
import ResourceCard from "../../components/ResourceCard/ResourceCard"; | ||
import HeadingCard from "../../components/HeadingCard/HeadingCard"; | ||
IanWearsHat marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
import styles from "./ApiResources.module.scss"; | ||
|
||
async function ApiResources() { | ||
const resources = await getResources("api"); | ||
return ( | ||
<div className="container"> | ||
{/* Card Component */} | ||
<div className={styles.card}> | ||
<h2 className={styles.title}>API Resources</h2> | ||
<p className={styles.text}> | ||
Application Programming Interface (API) are interfaces or | ||
<HeadingCard | ||
title="API Resources" | ||
description="Application Programming Interface (API) are interfaces or | ||
communication protocol that simplifies implementation and maintenance | ||
of software. In order to access most API's, many languages use | ||
of software. In order to access most API's, many languages use | ||
HTTP protocol to communicate with the servers that host the API and | ||
retrieve data. | ||
</p> | ||
</div> | ||
retrieve data." | ||
/> | ||
|
||
<div className={styles["bottom-spacer"] + " row"}> | ||
{/* Sticky Notes */} | ||
{resources.map( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import Image from "next/image"; | ||
import resourcesTitle from "@/assets/images/resources-title.svg"; | ||
|
||
import styles from "./Landing.module.scss"; | ||
|
||
function Landing() { | ||
return ( | ||
<div className={styles.landing}> | ||
<h1>Resources</h1> | ||
<Image src={resourcesTitle} alt="resources title" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue: the size of the Resources Title stays the same for all screen sizes, so on small screens (i.e iPhone SE), the title starts getting cut off on the sides. |
||
</div> | ||
); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought: similar to the FAQs, on smaller screen sizes the text looks a bit squished.