Skip to content

Commit a93ab25

Browse files
authored
[PROD] Feat: auto-tweet updated with partner twitter handle as prop (#285)
* feat: added partnetTwitterHandle as props and generating a new msg text including it * feat: added ar.io handle to their lessons * feat: added ar.io handle to their lessons
1 parent a015da0 commit a93ab25

File tree

16 files changed

+40
-71
lines changed

16 files changed

+40
-71
lines changed

TODO.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

apps/academy/src/components/mdx/QuizCompletedModals.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ export interface QuizProps {
2020
nextLessonTitle: string;
2121
actualLessonTitle: string;
2222
quizCompleted: boolean;
23-
successMessage?: { message: string }[];
23+
successMessage?: { message: string }[] | undefined;
2424
successTitle?: string | undefined;
2525
currentLessonPath: string;
26-
actionButton?: { href: string; text: string } | null;
26+
actionButton?: { href: string; text: string } | null | undefined;
27+
partnerTwitterHandle?: string | undefined;
2728
}
2829

2930
export type Answers = Record<string, number[]>;
@@ -38,9 +39,9 @@ const QuizCompletedModals = ({
3839
"You answered all the quiz questions correctly, great job. Celebrate your learning on Twitter and advance to the next lesson below.",
3940
},
4041
],
41-
// successTitle = "Lesson complete",
4242
currentLessonPath,
4343
actionButton,
44+
partnerTwitterHandle,
4445
}: QuizProps): JSX.Element => {
4546
const [showDialog, setShowDialog] = useState(false);
4647
// const [showKeepGoingModal, setShowKeepGoingModal] = useState(false);
@@ -114,8 +115,9 @@ const QuizCompletedModals = ({
114115
<div className="flex flex-col gap-y-6">
115116
<a
116117
href={createTwitterIntentLink(
117-
`I completed "${actualLessonTitle}" on @developer_dao Academy.
118-
https://academy.developerdao.com${currentLessonPath}`,
118+
partnerTwitterHandle === undefined
119+
? `I completed "${actualLessonTitle}" on @developer_dao Academy. https://academy.developerdao.com${currentLessonPath}`
120+
: `I completed "${actualLessonTitle}" lesson from ${partnerTwitterHandle} track on @developer_dao Academy. https://academy.developerdao.com${currentLessonPath}`,
119121
)}
120122
target="_blank"
121123
>

apps/academy/src/components/mdx/QuizStatusChecker.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ import Quiz from "./Quiz";
99

1010
export interface QuizStatusCheckerType {
1111
quiz: string;
12-
successMessage: { message: string }[];
12+
successMessage?: { message: string }[];
1313
successTitle?: string;
14-
actionButton: any;
14+
actionButton?: { href: string; text: string } | null;
15+
partnerTwitterHandle?: string | undefined;
1516
}
1617

1718
const QuizStatusChecker = ({
1819
quiz,
1920
successMessage,
2021
successTitle,
2122
actionButton,
23+
partnerTwitterHandle,
2224
}: QuizStatusCheckerType) => {
2325
const [quizCompleted, setQuizCompleted] = useState<boolean>(false);
2426
const { address, isDisconnected } = useAccount();
@@ -86,6 +88,7 @@ const QuizStatusChecker = ({
8688
nextLessonTitle={nextLessonTitle}
8789
actualLessonTitle={actualLessonTitle}
8890
currentLessonPath={currentLessonPath}
91+
partnerTwitterHandle={partnerTwitterHandle}
8992
/>
9093
{/* <Badge className="m-auto flex w-fit justify-center bg-green-600">
9194
<span className="text-2xl">Quiz Completed</span>

apps/academy/src/pages/tracks/arweave-101/1.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ Arweave’s bundled transactions allow you to move actions to L2 if you need mor
243243
message: "Secret code: HOLZBV",
244244
},
245245
]}
246+
partnerTwitterHandle="@ar_io_network"
246247
/>
247248

248249
## Conclusion

apps/academy/src/pages/tracks/arweave-101/2.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ Gateway nodes' indexing and caching features make accessing data on Arweave stra
349349
message: "Secret code: CSSYVH",
350350
},
351351
]}
352+
partnerTwitterHandle="@ar_io_network"
352353
/>
353354

354355
## Conclusion

apps/academy/src/pages/tracks/arweave-101/3.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ You also created your first wallet address and learned about the available Arwea
483483
message: "Secret code: DZBGSD",
484484
},
485485
]}
486+
partnerTwitterHandle="@ar_io_network"
486487
/>
487488

488489
## Conclusion

apps/academy/src/pages/tracks/arweave-101/4.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ as long as Arweave is online.
542542
message: "Secret code: 6QAIZ6",
543543
},
544544
]}
545+
partnerTwitterHandle="@ar_io_network"
545546
/>
546547

547548
## Conclusion

apps/academy/src/pages/tracks/arweave-101/5.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,7 @@ gateways and how to structure your code and split your bundle chunks to save mon
10121012
message: "Secret code: HlUJAJ",
10131013
},
10141014
]}
1015+
partnerTwitterHandle="@ar_io_network"
10151016
/>
10161017

10171018
## Conclusion

apps/academy/src/pages/tracks/arweave-201/1.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ In this lesson you learned what an Arweave gateway is and how to run one on your
377377
message: "Secret code: BR9LX5",
378378
},
379379
]}
380+
partnerTwitterHandle="@ar_io_network"
380381
/>
381382

382383
## Conclusion

apps/academy/src/pages/tracks/arweave-201/2.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,16 +408,17 @@ In this lesson, you learned how to deploy an Arweave gateway to AWS and everythi
408408
message: "Secret code: PO3ZEO",
409409
},
410410
]}
411+
partnerTwitterHandle="@ar_io_network"
411412
/>
412413

413414
## Conclusion
414415

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

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

423424
</LessonLayout>

apps/academy/src/pages/tracks/arweave-201/3.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ upload Arweave transactions on your own.
450450
message: "Secret code: BZB48B",
451451
},
452452
]}
453+
partnerTwitterHandle="@ar_io_network"
453454
/>
454455

455456
## Conclusion

apps/academy/src/pages/tracks/oracles-api3/1-oracles-api3-pricefeeds.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import LessonLayout from "../../../components/LessonLayout";
22
import QuizStatusChecker from "../../../components/mdx/QuizStatusChecker";
3-
// import Question from "../../../components/mdx/Question";
3+
import Question from "../../../components/mdx/Question";
44
// import Callout from "../../../components/mdx/Callout";
55
// import LessonQuestionsModal from "../../../components/mdx/LessonQuestionsModal";
66
// import LessonInformationalModal from "../../../components/mdx/LessonInformationalModal";
@@ -11,6 +11,7 @@ import QuizStatusChecker from "../../../components/mdx/QuizStatusChecker";
1111
authorPosition="Developer_DAO"
1212
authorTwitter="wc49358"
1313
createdDate=""
14+
authorImage="/authors/default.png"
1415
>
1516

1617
## Oracles and API3 (Price Feeds)

apps/academy/src/pages/tracks/oracles-api3/2-quantum-rand-num-gen.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ import LessonLayout from "../../../components/LessonLayout";
1111
authorPosition="Developer_DAO"
1212
authorTwitter=""
1313
createdDate=""
14+
authorImage="/authors/default.png"
15+
1416
>
1517

16-
{/* <QuizStatusChecker quiz="" /> */}
18+
<>{/* <QuizStatusChecker quiz="" /> */}</>
1719

1820
</LessonLayout>

apps/academy/src/pages/tracks/oracles-api3/3-airnode-deep-dive.mdx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ import LessonLayout from "../../../components/LessonLayout";
66
// import LessonInformationalModal from "../../../components/mdx/LessonInformationalModal";
77

88
<LessonLayout
9-
lessonTitle="Exploring Airnode - Deep Dive"
10-
author="BillyJitsu"
11-
authorPosition="Developer_DAO"
12-
authorTwitter=""
13-
createdDate=""
9+
lessonTitle="Exploring Airnode - Deep Dive"
10+
author="BillyJitsu"
11+
authorPosition="Developer_DAO"
12+
authorTwitter="wc49358"
13+
createdDate=""
14+
authorImage="/authors/default.png"
1415
>
15-
16-
{/* <QuizStatusChecker quiz="" /> */}
17-
16+
<>{/* <QuizStatusChecker quiz="" /> */}</>
1817
</LessonLayout>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"turbo": "1.10.11",
6262
"typescript": "5.1.6"
6363
},
64-
"packageManager": "pnpm@9.1.3",
64+
"packageManager": "pnpm@9.0.6",
6565
"prisma": {
6666
"schema": "packages/database/prisma/schema.prisma",
6767
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} packages/database/prisma/seed.ts"

packages/database/prisma/schema.prisma

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ model Lessons {
7272
stagingVisible Boolean @default(true)
7373
visible Boolean @default(true)
7474
nextLessonPath String?
75+
metaImagePath String @default("")
7576
// twitterShareUrl String?
7677
}
7778

78-
model Tags {
79+
model Tags {
7980
id String @id @default(cuid())
8081
tagName String
8182
tagDescription String
@@ -110,6 +111,7 @@ model Tracks {
110111
stagingVisible Boolean @default(true)
111112
visible Boolean @default(true)
112113
contributors ContributorsOnTracks[]
114+
metaImagePath String @default("")
113115
}
114116

115117
model TagsOnTracks {

0 commit comments

Comments
 (0)