Skip to content

Commit a44641a

Browse files
committed
Create contributors metadata (as an ESM module)
in a new "data" folder.
1 parent cb7b110 commit a44641a

File tree

4 files changed

+27
-23
lines changed

4 files changed

+27
-23
lines changed

components/mdx/Author.tsx

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,13 @@
11
import { Box, Text, Link, HStack, Avatar } from '@chakra-ui/react'
22
import NextLink from 'next/link'
3+
import { contributors } from '@data/contributors'
34

45
interface AuthorProps {
56
handle: string
67
}
78

8-
interface AuthorDetails {
9-
displayName: string
10-
moreInfoUrl?: string
11-
avatarUrl?: string
12-
about?: string
13-
}
14-
15-
interface AuthorLookup {
16-
[key: string]: AuthorDetails
17-
}
18-
19-
const authors: AuthorLookup = {
20-
brianfive: {
21-
displayName: 'Brian Gershon',
22-
moreInfoUrl: 'https://brianfive.xyz',
23-
avatarUrl: 'https://brianfive.xyz/profile.png',
24-
about:
25-
'Brian has been a member of the DeveloperDAO since November 2021, and enjoys building Web3 user experiences and smart contracts. Also active with Next.js, React and Serverless.',
26-
},
27-
}
28-
299
export function Author({ handle }: AuthorProps) {
30-
const author = authors[handle]
10+
const author = contributors[handle]
3111
if (!author) {
3212
return null
3313
}

data/contributors.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export interface ContributorDetails {
2+
displayName: string
3+
moreInfoUrl?: string
4+
avatarUrl?: string
5+
about?: string
6+
}
7+
8+
export interface ContributorLookup {
9+
[key: string]: ContributorDetails
10+
}
11+
12+
export const contributors: ContributorLookup = {
13+
brianfive: {
14+
displayName: 'Brian Gershon',
15+
moreInfoUrl: 'https://brianfive.xyz',
16+
avatarUrl: 'https://brianfive.xyz/profile.png',
17+
about:
18+
'Brian has been a member of the DeveloperDAO since November 2021, and enjoys building Web3 user experiences and smart contracts. Also active with Next.js, React and Serverless.',
19+
},
20+
}

pages/lessons/projects/4.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ icons: ['solidity', 'hardhat', 'openzeppelin']
88
import { LessonHeader } from '../../../components/mdx/LessonHeader'
99
import { Author } from '../../../components/mdx/Author'
1010

11-
<LessonHeader title="Lesson 4: Testing your TierNFT" discussionUrl="https://developerdao.peeranha.io/discussions/1372/testing-solidity-contracts" />
11+
<LessonHeader
12+
title="Lesson 4: Testing your TierNFT"
13+
discussionUrl="https://developerdao.peeranha.io/discussions/1372/testing-solidity-contracts"
14+
/>
1215

1316
In this lesson, we'll be adding automated tests for our smart contract created
1417
in Lesson 3.

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"paths": {
1919
"@components/*": ["components/*"],
2020
"@lib/*": ["lib/*"],
21+
"@data/*": ["data/*"],
2122
"@utils/*": ["utils/*"],
2223
"@theme": ["theme"]
2324
}

0 commit comments

Comments
 (0)