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 frontend issues on resources page #103

Merged
merged 10 commits into from
Oct 31, 2023
4 changes: 4 additions & 0 deletions apps/site/src/assets/icons/open-new-window.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed apps/site/src/assets/images/api-reference-tag.png
Binary file not shown.
3 changes: 0 additions & 3 deletions apps/site/src/assets/images/clear_tape_left.svg

This file was deleted.

3 changes: 0 additions & 3 deletions apps/site/src/assets/images/clear_tape_right.svg

This file was deleted.

Binary file not shown.
Binary file removed apps/site/src/assets/images/flask_project_button.png
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions apps/site/src/assets/images/resource-link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed apps/site/src/assets/images/tape.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 0 additions & 33 deletions apps/site/src/views/Resources/components/ApiGroup/ApiGroup.tsx

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
@use "zothacks-theme" as theme;

.group {
margin-top: 50px;
width: 344px;
height: 500px;
position: relative;
padding: 1rem 0;
box-shadow: 0 6px 5px -2px rgba(gray, 0.5);
}

Expand All @@ -11,7 +13,7 @@
width: 238px;
height: 60px;
position: absolute;
top: -5%;
top: -12.5%;
}

.container {
Expand All @@ -21,20 +23,31 @@
justify-content: center;
align-items: center;
gap: 10px;
height: 450px;
height: 350px;
}

.tag {
position: absolute;
left: -5%;
bottom: 5%;
background-image: url("~@/assets/images/resource-link.svg");
samderanova marked this conversation as resolved.
Show resolved Hide resolved
background-size: 100% 100%;
background-repeat: no-repeat;
background-position: left;
display: inline-block;
padding: 1rem;
padding-right: 3rem;
margin-left: -6px;
margin-bottom: 0.5rem;
transition:
filter 0.13s ease,
transform 0.13s ease,
filter 0.13s ease;
samderanova marked this conversation as resolved.
Show resolved Hide resolved

&:hover {
transform: translateX(-5px);
color: theme.$black;
text-decoration: none;
font-weight: bold;

&:hover,
&:focus {
transform: translateX(-5px) translateZ(0);
filter: drop-shadow(1px 0px 0px black) drop-shadow(-2px 0px 0px black)
samderanova marked this conversation as resolved.
Show resolved Hide resolved
drop-shadow(0px 2px 0px black) drop-shadow(0px -2px 0px black);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import Image from "next/image";

import openNewWindow from "@/assets/icons/open-new-window.svg";
import styles from "./ResourceCard.module.scss";

type Tag = {
text: string;
link: string;
};

interface ResourceCardProps {
title: string;
description: JSX.Element;
stickerSrc?: string;
links: Tag[];
stickyNoteColor: string;
}

export default function ResourceCard({
title,
description,
stickerSrc,
links,
stickyNoteColor,
}: ResourceCardProps) {
return (
<div
className={styles.group}
style={{
backgroundColor: `${stickyNoteColor}`,
}}
>
<div className={styles.container + " text-center px-3"}>
<div className={styles.tape}></div>
{stickerSrc && <img src={stickerSrc} alt="Resource logo" width="100" />}
<h3>{title}</h3>
{description}
</div>

{links.map(({ text, link }) => (
<a
key={link}
href={link}
target="_blank"
rel="noopener noreferrer"
className={styles.tag}
>
{text}
<div className="d-inline ms-1 vertical-align-middle">
<Image
src={openNewWindow}
width="20"
height="20"
alt="Open link in new window"
/>
</div>
</a>
))}
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import imageUrlBuilder from "@sanity/image-url";

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

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

Expand All @@ -27,11 +27,11 @@ async function ApiResources() {
{resources.map(
({ _id, title, description, link, logo, stickyNoteColor }) => (
<div className={styles.column + " col"} key={_id}>
<ApiGroup
<ResourceCard
title={title}
description={<PortableText value={description} />}
stickerSrc={imageUrlBuilder(client).image(logo).url()}
tagLink={link}
links={[{ text: "API Reference", link: link }]}
samderanova marked this conversation as resolved.
Show resolved Hide resolved
stickyNoteColor={stickyNoteColor.hex}
/>
</div>
Expand Down
Loading
Loading