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: added partnetTwitterHandle as props and more #283

Merged
merged 4 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
48 changes: 0 additions & 48 deletions TODO.md

This file was deleted.

12 changes: 7 additions & 5 deletions apps/academy/src/components/mdx/QuizCompletedModals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ export interface QuizProps {
nextLessonTitle: string;
actualLessonTitle: string;
quizCompleted: boolean;
successMessage?: { message: string }[];
successMessage?: { message: string }[] | undefined;
successTitle?: string | undefined;
currentLessonPath: string;
actionButton?: { href: string; text: string } | null;
actionButton?: { href: string; text: string } | null | undefined;
partnerTwitterHandle?: string | undefined;
}

export type Answers = Record<string, number[]>;
Expand All @@ -38,9 +39,9 @@ const QuizCompletedModals = ({
"You answered all the quiz questions correctly, great job. Celebrate your learning on Twitter and advance to the next lesson below.",
},
],
// successTitle = "Lesson complete",
currentLessonPath,
actionButton,
partnerTwitterHandle,
}: QuizProps): JSX.Element => {
const [showDialog, setShowDialog] = useState(false);
// const [showKeepGoingModal, setShowKeepGoingModal] = useState(false);
Expand Down Expand Up @@ -114,8 +115,9 @@ const QuizCompletedModals = ({
<div className="flex flex-col gap-y-6">
<a
href={createTwitterIntentLink(
`I completed "${actualLessonTitle}" on @developer_dao Academy.
https://academy.developerdao.com${currentLessonPath}`,
partnerTwitterHandle === undefined
? `I completed "${actualLessonTitle}" on @developer_dao Academy. https://academy.developerdao.com${currentLessonPath}`
: `I completed "${actualLessonTitle}" lesson from ${partnerTwitterHandle} track on @developer_dao Academy. https://academy.developerdao.com${currentLessonPath}`,
)}
target="_blank"
>
Expand Down
7 changes: 5 additions & 2 deletions apps/academy/src/components/mdx/QuizStatusChecker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ import Quiz from "./Quiz";

export interface QuizStatusCheckerType {
quiz: string;
successMessage: { message: string }[];
successMessage?: { message: string }[];
successTitle?: string;
actionButton: any;
actionButton?: { href: string; text: string } | null;
partnerTwitterHandle?: string | undefined;
}

const QuizStatusChecker = ({
quiz,
successMessage,
successTitle,
actionButton,
partnerTwitterHandle,
}: QuizStatusCheckerType) => {
const [quizCompleted, setQuizCompleted] = useState<boolean>(false);
const { address, isDisconnected } = useAccount();
Expand Down Expand Up @@ -86,6 +88,7 @@ const QuizStatusChecker = ({
nextLessonTitle={nextLessonTitle}
actualLessonTitle={actualLessonTitle}
currentLessonPath={currentLessonPath}
partnerTwitterHandle={partnerTwitterHandle}
/>
{/* <Badge className="m-auto flex w-fit justify-center bg-green-600">
<span className="text-2xl">Quiz Completed</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import LessonLayout from "../../../components/LessonLayout";
import QuizStatusChecker from "../../../components/mdx/QuizStatusChecker";
// import Question from "../../../components/mdx/Question";
import Question from "../../../components/mdx/Question";
// import Callout from "../../../components/mdx/Callout";
// import LessonQuestionsModal from "../../../components/mdx/LessonQuestionsModal";
// import LessonInformationalModal from "../../../components/mdx/LessonInformationalModal";
Expand All @@ -11,6 +11,7 @@ import QuizStatusChecker from "../../../components/mdx/QuizStatusChecker";
authorPosition="Developer_DAO"
authorTwitter="wc49358"
createdDate=""
authorImage="/authors/default.png"
>

## Oracles and API3 (Price Feeds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import LessonLayout from "../../../components/LessonLayout";
authorPosition="Developer_DAO"
authorTwitter=""
createdDate=""
authorImage="/authors/default.png"

>

{/* <QuizStatusChecker quiz="" /> */}
<>{/* <QuizStatusChecker quiz="" /> */}</>

</LessonLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import LessonLayout from "../../../components/LessonLayout";
// import LessonInformationalModal from "../../../components/mdx/LessonInformationalModal";

<LessonLayout
lessonTitle="Exploring Airnode - Deep Dive"
author="BillyJitsu"
authorPosition="Developer_DAO"
authorTwitter=""
createdDate=""
lessonTitle="Exploring Airnode - Deep Dive"
author="BillyJitsu"
authorPosition="Developer_DAO"
authorTwitter="wc49358"
createdDate=""
authorImage="/authors/default.png"
>

{/* <QuizStatusChecker quiz="" /> */}

<>{/* <QuizStatusChecker quiz="" /> */}</>
</LessonLayout>
4 changes: 3 additions & 1 deletion packages/database/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ model Lessons {
stagingVisible Boolean @default(true)
visible Boolean @default(true)
nextLessonPath String?
metaImagePath String @default("")
// twitterShareUrl String?
}

model Tags {
model Tags {
id String @id @default(cuid())
tagName String
tagDescription String
Expand Down Expand Up @@ -110,6 +111,7 @@ model Tracks {
stagingVisible Boolean @default(true)
visible Boolean @default(true)
contributors ContributorsOnTracks[]
metaImagePath String @default("")
}

model TagsOnTracks {
Expand Down