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

Merged
merged 13 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 10 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
8 changes: 4 additions & 4 deletions apps/site/src/app/(home)/sections/FAQ/FAQ.module.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@use "zothacks-theme" as theme;
@use "bootstrap-utils" as utils;

$mobile-item-padding-y: 26px;
$mobile-item-padding-x: 32px;
$mobile-item-padding-y: 1.6rem;
$mobile-item-padding-x: 2rem;

$item-padding-y: 32px;
$item-padding-x: 48px;
$item-padding-y: 2rem;
$item-padding-x: 3rem;

.container {
position: relative;
Expand Down
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,47 @@
@use "zothacks-theme" as theme;
@use "bootstrap-utils" as utils;

$mobile-item-padding-y: 1.6rem;
$mobile-item-padding-x: 2rem;

$item-padding-y: 2rem;
$item-padding-x: 3rem;

$heading-font-size: 28px;
IanWearsHat marked this conversation as resolved.
Show resolved Hide resolved

.card {
background-color: theme.$white;
border: 6px solid theme.$white;
box-shadow: inset 0 0 0 6px theme.$black;
border-radius: 16px;

padding: $mobile-item-padding-y $mobile-item-padding-x;

display: flex;
align-items: center;
}

.bang {
margin-right: $mobile-item-padding-x - 0.4375;
}

.title {
font-size: $heading-font-size;
font-weight: 600;
color: theme.$light-blue;
}

.description {
margin: 0;
font-weight: 500;
}

@include utils.media-breakpoint-up(md) {
.card {
padding: $item-padding-y $item-padding-x;
}

.bang {
margin-right: $item-padding-x - 0.4375;
}
}
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 @@ -13,18 +13,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,29 +1,27 @@
import { PortableText } from "@portabletext/react";
import imageUrlBuilder from "@sanity/image-url";

import styles from "./ApiResources.module.scss";

import ResourceCard from "../../components/ResourceCard/ResourceCard";
import HeadingCard from "../../components/HeadingCard/HeadingCard";
import { getResources } from "../../getResources";
import { client } from "@/lib/sanity/client";

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(
({ _id, title, description, link, logo, background }) => (
<div className={styles.column + " col"} key={_id}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "bootstrap-utils" as utils;

.landing {
display: flex;
flex-direction: column;
Expand All @@ -8,3 +10,7 @@
margin-bottom: 5vh;
text-align: left;
}

.title {
width: 75%;
}
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>
IanWearsHat marked this conversation as resolved.
Show resolved Hide resolved
<Image src={resourcesTitle} className={styles.title} alt="resources title" />
</div>
);
}
Expand Down
Loading