Skip to content

Commit a4bd206

Browse files
authored
Merge pull request #240 from Markkos89/staging
[STAGING] Feat: UI and api calls improvements
2 parents f2833cc + 5adb604 commit a4bd206

File tree

19 files changed

+230
-111
lines changed

19 files changed

+230
-111
lines changed

src/contexts/AppContextProvider.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
} from "@/interfaces";
1313
import { useSession } from "next-auth/react";
1414
import { api } from "@/utils/api";
15+
import { useAccount } from "wagmi";
1516

1617
interface IProps {
1718
children: ReactNode;
@@ -24,6 +25,7 @@ export function AppContextProvider({ children }: IProps) {
2425
const [sessionDataUser, setSessionDataUser] = useState<any>(null);
2526

2627
const { data: sessionData } = useSession();
28+
const { address } = useAccount();
2729

2830
useEffect(() => {
2931
if (sessionData?.user && sessionData.user !== sessionDataUser) {
@@ -42,7 +44,7 @@ export function AppContextProvider({ children }: IProps) {
4244
undefined, // no input
4345
{
4446
// Disable request if no session data
45-
enabled: !!sessionDataUser,
47+
enabled: !!sessionDataUser && !!address,
4648
refetchOnWindowFocus: false,
4749
},
4850
);
@@ -78,7 +80,6 @@ export function AppContextProvider({ children }: IProps) {
7880
useEffect(() => {
7981
void fetchFromDirs();
8082
}, []);
81-
0;
8283

8384
// - Get All lessons to get the Id's
8485
const { data: allLessonsData } = api.lessons.getAll.useQuery();

src/pages/docs/index.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
import Layout from "../../components/Layout";
2+
3+
<Layout
4+
title="Dapp Page"
5+
description="A page for your dapp."
6+
>
7+
18
# Contributor Docs
29

310
Our Academy website and all lesson content are in GitHub.
@@ -11,3 +18,5 @@ to get started.
1118
- [How do I find and manage day-to-day project tasks?](/docs/day-to-day)
1219
- [How do I author content? What is the review process?](/docs/content)
1320
- [How do I sponsor content?](/docs/sponsor)
21+
22+
</Layout>

src/pages/lessons/fundamentals/cli_lesson.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ authors: ["piablo", "georgemac510"]
88
---
99

1010
import { LessonHeader } from "../../../components/mdx/LessonHeader";
11+
import Layout from "../../../components/Layout";
1112

13+
<Layout
14+
title="Dapp Page"
15+
description="A page for your dapp."
16+
>
1217
<LessonHeader title="Navigating in a CLI for beginners" />
1318

1419
A CLI is an invaluable tool for development. It's actually quite straightforward
@@ -483,3 +488,5 @@ Some basic commands for CLI:
483488
And a more extensive list of <a style={{textDecoration: 'underline'}}
484489
href="https://support.apple.com/guide/terminal/keyboard-shortcuts-trmlshtcts/mac"
485490
target="\_blank"> CLI commands</a>
491+
492+
</Layout>

src/pages/lessons/fundamentals/code-editors.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ author: "georgemac510"
77
---
88

99
import { LessonHeader } from "../../../components/mdx/LessonHeader";
10+
import Layout from "../../../components/Layout";
1011

12+
<Layout
13+
title="Dapp Page"
14+
description="A page for your dapp."
15+
>
1116
<LessonHeader title="Code Editors (IDEs)" />
1217

1318
## What is an IDE?
@@ -87,3 +92,5 @@ To help you make an informed decision, check for the following features:
8792

8893
There are several other cool, free IDEs on the market such as NetBeans,
8994
TextMate, Bluefish and many others to choose from. Happy coding!! 👍 😀
95+
96+
</Layout>

src/pages/lessons/fundamentals/connect-with-rpc.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ author: "georgemac510"
66
---
77

88
import { LessonHeader } from "../../../components/mdx/LessonHeader";
9+
import Layout from "../../../components/Layout";
910

11+
<Layout
12+
title="Dapp Page"
13+
description="A page for your dapp."
14+
>
1015
<LessonHeader title="Connecting to a Network via RPC" />
1116

1217
**Remote Procedure Call (RPC)** could be classified as a type of API
@@ -65,3 +70,5 @@ below:
6570
ON AND THE POP-UP MESSAGE IN METAMASK WHEN CONNECTING YOUR WALLET. IF YOU ARE ON
6671
THE WRONG WEBSITE AND YOU ALLOW ACCESS TO YOUR METAMASK WALLET, YOU MAY BE
6772
ALLOWING HACKERS ACCESS TO YOUR WALLET. BE SAFE!! ALWAYS DOUBLE-CHECK!!**
73+
74+
</Layout>

src/pages/lessons/fundamentals/decentralized-storage.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ author: ["georgemac510", "pbillingsby"]
66
---
77

88
import { LessonHeader } from "../../../components/mdx/LessonHeader";
9+
import Layout from "../../../components/Layout";
910

11+
<Layout
12+
title="Dapp Page"
13+
description="A page for your dapp."
14+
>
1015
<LessonHeader title="Decentralized Storage with Arweave and IPFS/Filecoin" />
1116

1217
Among the many use cases for these great technologies, the most common are for
@@ -117,3 +122,5 @@ we are “trusting” to stay online and continue to render service.
117122
**Decentralized web networks such as IPFS/Filecoin and Arweave solve this
118123
centralization** **problem by distributing the data to nodes and eliminate a
119124
central point of failure.**
125+
126+
</Layout>

src/pages/lessons/fundamentals/install-npm.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ author: "georgemac510"
66
---
77

88
import { LessonHeader } from "../../../components/mdx/LessonHeader";
9+
import Layout from "../../../components/Layout";
910

11+
<Layout
12+
title="Dapp Page"
13+
description="A page for your dapp."
14+
>
1015
<LessonHeader title="How to install node.js and npm" />
1116

1217
![NPM Overload Joke](/assets/lessons/install_npm/npm-jokes-1.png)
@@ -224,3 +229,5 @@ few easy steps, you will be up and running! 🏃🏾‍♀️
224229

225230
You made it to the end of our nodejs and npm installation with nvm tutorial!
226231
Congratulations!! 🎉💥🥇
232+
233+
</Layout>

src/pages/lessons/fundamentals/nft-hosting.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ author: "georgemac510"
77
---
88

99
import { LessonHeader } from "../../../components/mdx/LessonHeader";
10+
import Layout from "../../../components/Layout";
1011

12+
<Layout
13+
title="Dapp Page"
14+
description="A page for your dapp."
15+
>
1116
<LessonHeader title="NFT hosting through OpenSea and Rarible" />
1217

1318
## What are NFTs?
@@ -103,3 +108,5 @@ vote on DAO self-governance proposals.
103108

104109
Both of these platforms are continually being improved with additional
105110
functionality, stronger security and a better user experience.💥
111+
112+
</Layout>

src/pages/lessons/fundamentals/open_zeppelin.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ author: ["piablo", "7i7o"]
66
---
77

88
import { LessonHeader } from "../../../components/mdx/LessonHeader";
9+
import Layout from "../../../components/Layout";
910

11+
<Layout
12+
title="Dapp Page"
13+
description="A page for your dapp."
14+
>
1015
<LessonHeader title="Open Zeppelin Smart Contract Concepts" />
1116

1217
We are going to stand on the shoulder of giants and leverage the power of open
@@ -53,3 +58,5 @@ our own, like inheriting those good qualities of our favourite relatives!
5358
It’s very rare in the Ethereum smart contract development sphere to see a smart
5459
contract that doesn’t include at least one line of code stating
5560
`import 'OpenZeppelin_something_or_other.sol';`!
61+
62+
</Layout>

src/pages/lessons/fundamentals/testnets.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ author: "piablo"
66
---
77

88
import { LessonHeader } from "../../../components/mdx/LessonHeader";
9+
import Layout from "../../../components/Layout";
910

11+
<Layout
12+
title="Dapp Page"
13+
description="A page for your dapp."
14+
>
1015
<LessonHeader title="Test, test, test, testnets" />
1116

1217
**TL'DR**
@@ -71,3 +76,5 @@ for testnets, we would never have known if _The Merge_ of Ethereum was possible.
7176
If we want to ensure global adoption of web3, every single one of us has the
7277
responsibility of making it secure. A testnet is the gateway to our collective
7378
success. Let’s BUIDL safely for our seven billion friends.
79+
80+
</Layout>

0 commit comments

Comments
 (0)