Skip to content

Commit

Permalink
replace MarkdownCallout with default fumadocs Callout (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZYJLiu authored Feb 6, 2025
1 parent c5e1d5b commit df316fe
Show file tree
Hide file tree
Showing 104 changed files with 219 additions and 424 deletions.
2 changes: 1 addition & 1 deletion content/courses/connecting-to-offchain-data/oracles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ funds.
A potential solution to this challenge can be found
[in the Github repository on the `challenge-solution` branch](https://github.com/solana-developers/burry-escrow/tree/challenge-solution).
<Callout type="success" title="Completed the lab?">
<Callout type="info" title="Completed the lab?">
Push your code to GitHub and
[tell us what you thought of this lesson](https://form.typeform.com/to/IPH0UGz7#answers-lesson=1a5d266c-f4c1-4c45-b986-2afd4be59991)!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ export const solUsedSwitchboardFeed = new anchor.web3.PublicKey(
);

function delay(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
return new Promise((resolve) => setTimeout(resolve, ms));
}

describe("burry-escrow-vrf", () => {
Expand Down Expand Up @@ -1357,10 +1357,10 @@ describe("burry-escrow-vrf", () => {
});
```

<Callout type="note">
<Callout type="info">

If you only want to run the vrf tests, change
`describe("burry-escrow-vrf", () => {` to:
`describe("burry-escrow-vrf", () => {` to:
`describe.only("burry-escrow-vrf", () => {`

</Callout>
Expand Down Expand Up @@ -1637,7 +1637,7 @@ funds, just like getting out of jail in Monopoly.
If you get stuck, we have the solution in the
[`vrf-challenge-solution` branch](https://github.com/solana-developers/burry-escrow/tree/vrf-challenge-solution).
<Callout type="success" title="Completed the lab?">
<Callout type="info" title="Completed the lab?">
Push your code to GitHub and
[tell us what you thought of this lesson](https://form.typeform.com/to/IPH0UGz7#answers-lesson=5af49eda-f3e7-407d-8cd7-78d0653ee17c)!
Expand Down
16 changes: 8 additions & 8 deletions content/courses/intro-to-solana/interact-with-wallets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ npm install @solana/wallet-adapter-base \
@solana/wallet-adapter-react-ui
```

<Callout type="note">
<Callout type="info">

We're learning doing this manually to learn about Wallet
Adapter, but you can also use
[create-solana-dapp](https://github.com/solana-developers/create-solana-dapp) to
create a brand new React or NextJS app that supports Solana wallets.
create a brand new React or NextJS app that supports Solana wallets.

</Callout>

Expand Down Expand Up @@ -123,7 +123,7 @@ import {
import { clusterApiUrl } from "@solana/web3.js";
import "@solana/wallet-adapter-react-ui/styles.css";

export const Home: NextPage = props => {
export const Home: NextPage = (props) => {
const endpoint = clusterApiUrl("devnet");
const wallets = useMemo(() => [], []);

Expand Down Expand Up @@ -178,7 +178,7 @@ import {
} from "@solana/web3.js";
import "@solana/wallet-adapter-react-ui/styles.css";

const Home: NextPage = props => {
const Home: NextPage = (props) => {
const endpoint = clusterApiUrl("devnet");
const wallets = useMemo(() => [], []);

Expand Down Expand Up @@ -246,7 +246,7 @@ export const BalanceDisplay: FC = () => {
try {
connection.onAccountChange(
publicKey,
updatedAccountInfo => {
(updatedAccountInfo) => {
setBalance(updatedAccountInfo.lamports / LAMPORTS_PER_SOL);
},
"confirmed",
Expand Down Expand Up @@ -287,7 +287,7 @@ to submit transactions for approval.
const { publicKey, sendTransaction } = useWallet();
const { connection } = useConnection();

const sendSol = async event => {
const sendSol = async (event) => {
event.preventDefault();

if (!publicKey) {
Expand Down Expand Up @@ -475,7 +475,7 @@ import { AppBar } from "../components/AppBar";
import Head from "next/head";
import { PingButton } from "../components/PingButton";

const Home: NextPage = props => {
const Home: NextPage = (props) => {
return (
<div className={styles.App}>
<Head>
Expand Down Expand Up @@ -673,7 +673,7 @@ lets a user connect their wallet and send SOL to another account.
If you get really stumped, feel free to
[check out the solution code](https://github.com/Unboxed-Software/solana-send-sol-frontend/tree/main).

<Callout type="success" title="Completed the lab?">
<Callout type="info" title="Completed the lab?">

Push your code to GitHub and
[tell us what you thought of this lesson](https://form.typeform.com/to/IPH0UGz7#answers-lesson=69c5aac6-8a9f-4e23-a7f5-28ae2845dfe1)!
Expand Down
4 changes: 2 additions & 2 deletions content/courses/intro-to-solana/intro-to-cryptography.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ console.log(`The public key is: `, keypair.publicKey.toBase58());
console.log(`The secret key is: `, keypair.secretKey);
```

<Callout type="warning" title="Do not include secret keys in your source code">
<Callout type="warn" title="Do not include secret keys in your source code">

Since the keypair can be regenerated from the secret key, we usually only store
the secret key, and restore the keypair from the secret key.
Expand Down Expand Up @@ -241,7 +241,7 @@ Run `npx esrun generate-keypair.ts`. You should see the following result:
We've now learned about keypairs, and how to store secret keys securely on
Solana. In the next chapter, we'll use them!

<Callout type="success">
<Callout type="info">

## Completed the lab?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ signature so you can look at it on Solana Explorer.
If you get stuck feel free to glance at the
[solution code](https://github.com/Unboxed-Software/solana-ping-client).

<Callout type="success" title="Completed the lab?">
<Callout type="info" title="Completed the lab?">

Push your code to GitHub and
[tell us what you thought of this lesson](https://form.typeform.com/to/IPH0UGz7#answers-lesson=e969d07e-ae85-48c3-976f-261a22f02e52)!
Expand Down
5 changes: 2 additions & 3 deletions content/courses/intro-to-solana/intro-to-reading-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ objectives:
- Understand accounts and their addresses
- Understand SOL and lamports
- Use web3.js to connect to Solana and read an account balance
description:
"Connect to Solana DevNet from TypeScript and read data from the blockchain!"
description: "Connect to Solana DevNet from TypeScript and read data from the blockchain!"
---

## Summary
Expand Down Expand Up @@ -224,7 +223,7 @@ Modify the script as follows:

We'll transfer SOL in the next lesson!

<Callout type="success" title="Completed the lab?">
<Callout type="info" title="Completed the lab?">

Push your code to GitHub and
[tell us what you thought of this lesson](https://form.typeform.com/to/IPH0UGz7#answers-lesson=8bbbfd93-1cdc-4ce3-9c83-637e7aa57454)!
Expand Down
5 changes: 2 additions & 3 deletions content/courses/intro-to-solana/intro-to-writing-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ objectives:
- Use `@solana/web3.js` to send SOL
- Use `@solana/web3.js` to sign transactions
- Use Solana Explorer to view transactions
description:
"Make your first transactions on DevNet, using the System and memo programs!"
description: "Make your first transactions on DevNet, using the System and memo programs!"
---

## Summary
Expand Down Expand Up @@ -256,7 +255,7 @@ Answer the following questions:

- What do you think "confirmed" means?

<Callout type="success" title="Completed the lab?">
<Callout type="info" title="Completed the lab?">

Push your code to GitHub and
[tell us what you thought of this lesson](https://form.typeform.com/to/IPH0UGz7#answers-lesson=dda6b8de-9ed8-4ed2-b1a5-29d7a8a8b415)!
Expand Down
11 changes: 5 additions & 6 deletions content/courses/mobile/intro-to-solana-mobile.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ objectives:
- Explain the high-level Mobile Wallet Adapter (MWA) flow
- Explain the high-level differences between React and React Native
- Create a simple Android Solana App using React Native
description:
"Learn how to build native mobile apps using blockchain functionality"
description: "Learn how to build native mobile apps using blockchain functionality"
---

## Summary
Expand Down Expand Up @@ -718,7 +717,7 @@ function AuthorizationProvider({ children, cluster }: AuthProviderProps) {
);

const onChangeAccount = useCallback((nextAccount: Account) => {
setAuthorization(currentAuthorization => {
setAuthorization((currentAuthorization) => {
if (
currentAuthorization?.accounts.some(
({ address }) => address === nextAccount.address,
Expand Down Expand Up @@ -1051,7 +1050,7 @@ button will do the following in a new function `incrementCounter`:
- Call `signAndSendTransactions` to have the wallet sign and send the
transaction

<Callout type="note">
<Callout type="info">

The fake Solana wallet we use generates a new keypair every
time you restart the fake wallet app, requiring that we want to check for funds
Expand Down Expand Up @@ -1155,7 +1154,7 @@ export function CounterButton() {

showToastOrAlert(`Transaction successful! ${signature}`);
})
.catch(e => {
.catch((e) => {
console.log(e);
showToastOrAlert(`Error: ${JSON.stringify(e)}`);
})
Expand Down Expand Up @@ -1224,7 +1223,7 @@ code available on the

[solution branch](https://github.com/solana-developers/react-native-counter).

<Callout type="success" title="Good Job!">
<Callout type="info" title="Good Job!">

If you’ve successfully completed the lab, push your code to GitHub and share
your feedback on this lesson through this [form](https://form.typeform.com/to/IPH0UGz7#answers-lesson=c15928ce-8302-4437-9b1b-9aa1d65af864)
Expand Down
9 changes: 4 additions & 5 deletions content/courses/mobile/mwa-deep-dive.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ objectives:
- Connect to and sign transactions from a mobile wallet
- Create a simple mobile wallet
- Explain at a high level the interaction between `walletlib` and wallet apps
description:
"Initiate transactions on mobile wallets in your native mobile apps."
description: "Initiate transactions on mobile wallets in your native mobile apps."
---

## Summary
Expand Down Expand Up @@ -1427,7 +1426,7 @@ export async function sendSignedTransactions(
minContextSlot: number | undefined,
connection: Connection,
): Promise<[boolean[], Uint8Array[]]> {
const valid = signedTransactions.map(_ => true);
const valid = signedTransactions.map((_) => true);
const signatures: (Uint8Array | null)[] = await Promise.all(
signedTransactions.map(async (byteArray, index) => {
try {
Expand Down Expand Up @@ -1462,7 +1461,7 @@ export function signTransactionPayloads(
wallet: Keypair,
payloads: Uint8Array[],
): [boolean[], Uint8Array[]] {
const valid = payloads.map(_ => true);
const valid = payloads.map((_) => true);
const signedPayloads = payloads.map((payload, index) => {
try {
Expand Down Expand Up @@ -1627,7 +1626,7 @@ Try to do this without help as it's great practice, but if you get stuck, check
out the
[solution code on the repo](https://github.com/solana-developers/react-native-fake-solana-wallet).

<Callout type="success" title="Completed the lab?">
<Callout type="info" title="Completed the lab?">

Push your code to GitHub and
[tell us what you thought of this lesson](https://form.typeform.com/to/IPH0UGz7#answers-lesson=5a3d0f62-c5fc-4e03-b8a3-323c2c7b8f4f)!
Expand Down
12 changes: 6 additions & 6 deletions content/courses/mobile/solana-mobile-dapps-with-expo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,14 @@ or physical device.
There are also more details about this setup in the
[Introduction to Solana Mobile lesson](/developers/courses/mobile/intro-to-solana-mobile#0-prerequisites)

<Callout type="note">
<Callout type="info">

Even though we are using Expo, you'll need to follow the
React Native CLI guide for initial setup.

</Callout>

<Callout type="note">
<Callout type="info">

If you are running an emulator, it is highly recommend to
use a newer phone version to emulate along with providing several GB of RAM for
Expand Down Expand Up @@ -979,7 +979,7 @@ through the code for each of them and then show you the entire file at the end:
if (isLoading) return;

setIsLoading(true);
transact(async wallet => {
transact(async (wallet) => {
const auth = await authorizeSession(wallet);
setAccount(auth);
}).finally(() => {
Expand Down Expand Up @@ -1206,7 +1206,7 @@ export function NFTProvider(props: NFTProviderProps) {
if (isLoading) return;

setIsLoading(true);
transact(async wallet => {
transact(async (wallet) => {
const auth = await authorizeSession(wallet);
setAccount(auth);
}).finally(() => {
Expand Down Expand Up @@ -1526,7 +1526,7 @@ export function MainScreen() {

const loadSnapshots = async () => {
const loadedSnapshots = await Promise.all(
loadedNFTs.map(async loadedNft => {
loadedNFTs.map(async (loadedNft) => {
if (!loadedNft.metadata.name) return null;
if (!loadedNft.metadata.uri) return null;

Expand Down Expand Up @@ -1689,7 +1689,7 @@ welcome to choose your own, or you can select from the following ideas:
- Make a simplified clone of [Stepn](https://stepn.com/) using the pedometer
from `expo-sensors`

<Callout type="success" title="Completed the lab?">
<Callout type="info" title="Completed the lab?">

Push your code to GitHub and
[tell us what you thought of this lesson](https://form.typeform.com/to/IPH0UGz7#answers-lesson=19cf8d3a-89a0-465e-95da-908cf8f45409)!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ invoked program.

As the developer, you have full control over which accounts are passed into the
CPI. You can think of constructing a CPI as building a new instruction from
scratch, but only with the data that was passed into your program.
scratch, but only with the data that was passed into your program.

</Callout>

Expand Down Expand Up @@ -1033,7 +1033,7 @@ questions are answered correctly, allow users to upvote answers, etc. All of
that is possible and you now have the skills and knowledge to go and build
something like it on your own!
<Callout type="success" title="Completed the lab?">
<Callout type="info" title="Completed the lab?">
Push your code to GitHub and
[tell us what you thought of this lesson](https://form.typeform.com/to/IPH0UGz7#answers-lesson=ade5d386-809f-42c2-80eb-a6c04c471f53)!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ objectives:
- Derive PDAs given specific seeds
- Fetch a program's accounts
- Use Borsh to deserialize custom data
description:
Deserialize instructions in JS/TS clients to send to your native program.
description: Deserialize instructions in JS/TS clients to send to your native program.
---

## Summary
Expand Down Expand Up @@ -393,7 +392,7 @@ If you get really stumped, feel free to
As always, get creative with these challenges and take them beyond the
instructions if you want!

<Callout type="success" title="Completed the lab?">
<Callout type="info" title="Completed the lab?">

Push your code to GitHub and
[tell us what you thought of this lesson](https://form.typeform.com/to/IPH0UGz7#answers-lesson=9cb89e09-2c97-4185-93b0-c89f7aca7677)!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ objectives:
- Deserialize instruction data into native Rust data types
- Execute different program logic for different types of instructions
- Explain the structure of a smart contract on Solana
description:
"Learn how native programs distinguish instructions for different functions."
description: "Learn how native programs distinguish instructions for different functions."
---

## Summary
Expand Down Expand Up @@ -366,7 +365,7 @@ There is Rust syntax in this function that we haven't explained yet. The
- [`?` operator](https://doc.rust-lang.org/rust-by-example/error/result/enter_question_mark.html):
Unwraps a `Result` or `Option`. If it's `Ok` or `Some`, it returns the value.
If it's an `Err` or `None`, it propagates the error up to the calling
function.
function.

</Callout>

Expand Down Expand Up @@ -644,7 +643,7 @@ frontend code with your deployed program ID.
Try to do this independently if you can! But if you get stuck, feel free to
reference the [solution code](https://beta.solpg.io/62b0ce53f6273245aca4f5b0).

<Callout type="success" title="Completed the lab?">
<Callout type="info" title="Completed the lab?">

Push your code to GitHub and
[tell us what you thought of this lesson](https://form.typeform.com/to/IPH0UGz7#answers-lesson=74a157dc-01a7-4b08-9a5f-27aa51a4346c)!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ objectives:
- Explain the entry point to a Solana program
- Build and deploy a basic Solana program
- Submit a transaction to invoke our “Hello, world!” program
description:
"Create an onchain program for Solana using native Rust, without Anchor."
description: "Create an onchain program for Solana using native Rust, without Anchor."
---

## Summary
Expand Down Expand Up @@ -384,7 +383,7 @@ examples, so try to avoid copying and pasting.
As always, feel free to get creative with these challenges and go beyond the
basic instructions if you want — most importantly, have fun!

<Callout type="success" title="Completed the lab?">
<Callout type="info" title="Completed the lab?">

Push your code to GitHub and
[tell us what you thought of this lesson](https://form.typeform.com/to/IPH0UGz7#answers-lesson=5b56c69c-1490-46e4-850f-a7e37bbd79c2)!
Expand Down
Loading

0 comments on commit df316fe

Please sign in to comment.