Skip to content

Commit 770fcd2

Browse files
committed
Draft up some initial components for Author
and LessonHeader. Play with in Lesson 4.
1 parent 3a0b705 commit 770fcd2

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

components/mdx/Author.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Box, Text } from '@chakra-ui/react'
2+
3+
interface AuthorProps {
4+
author: string
5+
}
6+
7+
export function Author({ author }: AuthorProps) {
8+
return (
9+
<Box mt="8" py="5">
10+
<Text>[Author Bio Goes Here]</Text>
11+
<Text>{author}</Text>
12+
</Box>
13+
)
14+
}

components/mdx/LessonHeader.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Box, useStyleConfig, Text } from '@chakra-ui/react'
2+
3+
interface LessonHeaderProps {
4+
title: string
5+
author: string
6+
}
7+
8+
export function LessonHeader({ title, author }: LessonHeaderProps) {
9+
const headerStyle = useStyleConfig('LessonHeader')
10+
11+
return (
12+
<Box>
13+
<Box __css={headerStyle}>
14+
<Text>{title}</Text>
15+
</Box>
16+
<div>Author: {author}</div>
17+
</Box>
18+
)
19+
}

pages/lessons/projects/4.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ description:
55
icons: ['solidity', 'hardhat', 'openzeppelin']
66
---
77

8-
# Lesson 4: Testing your TierNFT
8+
import { LessonHeader } from '../../../components/mdx/LessonHeader';
9+
import { Author } from '../../../components/mdx/Author';
10+
11+
<LessonHeader title="Lesson 4: Testing your TierNFT" author="brianfive" />
912

1013
In this lesson, we'll be adding automated tests for our smart contract created
1114
in Lesson 3.
@@ -886,3 +889,5 @@ With TDD:
886889

887890
Go forth, test, and prosper knowing you have confidence in the code you're
888891
deploying into the world.
892+
893+
<Author author="brianfive" />

theme.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ const components = {
133133
},
134134
},
135135
},
136+
LessonHeader: {
137+
baseStyle: {
138+
mt: '1.5em',
139+
fontWeight: 'bold',
140+
fontSize: '1.875rem',
141+
letterSpacing: '-.025em',
142+
color: 'yellow.300',
143+
},
144+
},
136145
}
137146

138147
export const theme = extendTheme({

0 commit comments

Comments
 (0)