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

[PROD] Feat: auto-tweet updated with partner twitter handle as prop #285

Merged
merged 5 commits into from
Sep 17, 2024
Merged
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
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
1 change: 1 addition & 0 deletions apps/academy/src/pages/tracks/arweave-101/1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ Arweave’s bundled transactions allow you to move actions to L2 if you need mor
message: "Secret code: HOLZBV",
},
]}
partnerTwitterHandle="@ar_io_network"
/>

## Conclusion
Expand Down
1 change: 1 addition & 0 deletions apps/academy/src/pages/tracks/arweave-101/2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ Gateway nodes' indexing and caching features make accessing data on Arweave stra
message: "Secret code: CSSYVH",
},
]}
partnerTwitterHandle="@ar_io_network"
/>

## Conclusion
Expand Down
1 change: 1 addition & 0 deletions apps/academy/src/pages/tracks/arweave-101/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ You also created your first wallet address and learned about the available Arwea
message: "Secret code: DZBGSD",
},
]}
partnerTwitterHandle="@ar_io_network"
/>

## Conclusion
Expand Down
1 change: 1 addition & 0 deletions apps/academy/src/pages/tracks/arweave-101/4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ as long as Arweave is online.
message: "Secret code: 6QAIZ6",
},
]}
partnerTwitterHandle="@ar_io_network"
/>

## Conclusion
Expand Down
1 change: 1 addition & 0 deletions apps/academy/src/pages/tracks/arweave-101/5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,7 @@ gateways and how to structure your code and split your bundle chunks to save mon
message: "Secret code: HlUJAJ",
},
]}
partnerTwitterHandle="@ar_io_network"
/>

## Conclusion
Expand Down
1 change: 1 addition & 0 deletions apps/academy/src/pages/tracks/arweave-201/1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ In this lesson you learned what an Arweave gateway is and how to run one on your
message: "Secret code: BR9LX5",
},
]}
partnerTwitterHandle="@ar_io_network"
/>

## Conclusion
Expand Down
9 changes: 5 additions & 4 deletions apps/academy/src/pages/tracks/arweave-201/2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -408,16 +408,17 @@ In this lesson, you learned how to deploy an Arweave gateway to AWS and everythi
message: "Secret code: PO3ZEO",
},
]}
partnerTwitterHandle="@ar_io_network"
/>

## Conclusion

Hosting an Arweave gateway in the cloud is much more involved than doing so on your machine.
You need to think about reliability, content caching, and security.
Running a gateway improves all users' access to data on Arweave.
Hosting an Arweave gateway in the cloud is much more involved than doing so on your machine.
You need to think about reliability, content caching, and security.
Running a gateway improves all users' access to data on Arweave.
When the AR.IO network goes mainnet, you can join it and earn IO tokens for hosting a gateway.

You might already think it's not enough to just offer access to the data on Arweave. That's why
You might already think it's not enough to just offer access to the data on Arweave. That's why
you'll learn how to add a bundler to your gateway that let's you handle your own uploads.

</LessonLayout>
1 change: 1 addition & 0 deletions apps/academy/src/pages/tracks/arweave-201/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ upload Arweave transactions on your own.
message: "Secret code: BZB48B",
},
]}
partnerTwitterHandle="@ar_io_network"
/>

## Conclusion
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>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"turbo": "1.10.11",
"typescript": "5.1.6"
},
"packageManager": "pnpm@9.1.3",
"packageManager": "pnpm@9.0.6",
"prisma": {
"schema": "packages/database/prisma/schema.prisma",
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} packages/database/prisma/seed.ts"
Expand Down
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