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

Feat: update karnot form #967

Merged
merged 7 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
42 changes: 42 additions & 0 deletions components/quests/questBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { FunctionComponent, useMemo } from "react";
import questBanners from "../../public/utils/questbanners.json";
import styles from "@styles/quests.module.css";
import Button from "@components/UI/button";

type QuestBannerProps = {
questId: string;
};

const QuestBanner: FunctionComponent<QuestBannerProps> = ({ questId }) => {
const bannerDetails = useMemo(() => {
return questBanners.find((banner) => banner.questId === questId);
}, [questId]);
return bannerDetails ? (
<div className={styles.questBanner}>
<div
className={styles.questBannerImage}
style={{ backgroundImage: `url(${bannerDetails.image})` }}
/>
<div className={styles.questBannerContent}>
<h2 className={styles.questBannerTitle}>
{bannerDetails.tag ? (
<span className={styles.bannerTag}>{bannerDetails.tag} - </span>
) : null}
{bannerDetails.title}
</h2>
<p>{bannerDetails.description}</p>
<div className="w-fit">
<Button
onClick={() => {
window.open(bannerDetails.href, "_blank");
}}
>
{bannerDetails.cta}
</Button>
</div>
</div>
</div>
) : null;
};

export default QuestBanner;
3 changes: 2 additions & 1 deletion components/quests/questDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
} from "@services/apiService";
import Typography from "@components/UI/typography/typography";
import { TEXT_TYPE } from "@constants/typography";
import QuestBanner from "./questBanner";

type QuestDetailsProps = {
quest: QuestDocument;
Expand Down Expand Up @@ -429,7 +430,7 @@ const QuestDetails: FunctionComponent<QuestDetailsProps> = ({
/>
);
})}

<QuestBanner questId={questId} />
<Reward
quest={quest}
hasNftReward={hasNftReward}
Expand Down
Binary file added public/karnot/KarnotxSTRKFarm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/karnot/endurBanner.webp
Binary file not shown.
Binary file added public/karnot/xSTRK.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions public/utils/questbanners.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"questId": "224",
"tag": "Optional",
"title": "Write a thread on xSTRK",
"description": "Top 10 threads get $50 each.",
"cta": "Participate",
"href": "https://forms.gle/dxcDWjETeYCzRHtG7",
"image": "/karnot/endurBanner.webp"
}
]
58 changes: 58 additions & 0 deletions styles/quests.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,51 @@
font-weight: 400;
}

.questBanner {
max-width: 90%;
width: 728px;
margin-top: 1.5rem;
background-color: var(--menu-background);

/* Small Shadow */
box-shadow: 0px 2px 30px rgba(16, 16, 18, 0.06);
border-radius: 8px;
display: flex;
align-items: stretch;
height: 201px;
}

.questBannerContent {
display: flex;
flex-direction: column;
justify-content: center;
padding: 24px;
gap: 1rem;
width: fit-content;
}

.questBannerTitle {
font-size: 24px;
font-family: "Sora-Bold";
font-weight: 700;
line-height: 30px;
letter-spacing: 0.16px;
margin-top: 1rem;
width: fit-content;
}

.bannerTag {
color: rgba(210, 210, 210, 0.786);
}

.questBannerImage {
border-bottom-left-radius: 8px;
border-top-left-radius: 8px;
width: 201px;
height: 100%;
background-size: cover;
}

@media (max-width: 1024px) {
.verifyButton {
width: 100px;
Expand Down Expand Up @@ -384,4 +429,17 @@
width: 27px;
height: 27px;
}

.questBanner {
height: fit-content;
flex-direction: column;
gap: 1rem;
}

.questBannerImage {
width: 100%;
height: 100px;
border-bottom-left-radius: 0;
border-top-left-radius: 8px;
}
}