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

Added Resources title and section title component #177

Open
wants to merge 7 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
3 changes: 3 additions & 0 deletions apps/site/src/assets/images/resources-bang.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions apps/site/src/assets/images/resources-title.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions apps/site/src/views/Resources/Resources.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
$container-padding: 6rem;

.resources {
h2 {
text-align: center;
}

:global {
section {
// responsive padding
Expand Down
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;
Comment on lines +3 to +4
Copy link
Contributor

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.


$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
Expand Up @@ -11,18 +11,6 @@
align-items: center;
}

.card {
background-image: url("~@/assets/index_cards/api-description-card.svg");
background-repeat: no-repeat;
background-position: center;
background-size: 100% 100%;
height: 343px;
position: relative;
display: flex;
justify-content: center;
margin-bottom: 30px;
}

.text {
font-size: 24px;
height: 60%;
Expand Down
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";
Copy link
Contributor

Choose a reason for hiding this comment

The 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&apos;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(
Expand Down
5 changes: 4 additions & 1 deletion apps/site/src/views/Resources/sections/Landing/Landing.tsx
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" />
Copy link
Contributor

Choose a reason for hiding this comment

The 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>
);
}
Expand Down
Loading