Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Commit 50507bb

Browse files
committed
refactor: getting started
1 parent 3932459 commit 50507bb

File tree

13 files changed

+99
-121
lines changed

13 files changed

+99
-121
lines changed

configs/styled-system.sidebar.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
},
7575
{
7676
"title": "Advanced",
77-
"path": "/docs/styled-system/advanced"
77+
"path": "/docs/styled-system/advanced-theming"
7878
}
7979
]
8080
}

content/getting-started/index.mdx

+11-9
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ description: How to install and set up Chakra UI in your project
44
tags: ['principles']
55
---
66

7-
Install Chakra UI in your project by running the following command in your
8-
terminal:
7+
To use Chakra UI in your project, run the following command in your terminal:
98

109
```bash
1110
npm i @chakra-ui/react @emotion/react @emotion/styled framer-motion
@@ -16,9 +15,8 @@ yarn add @chakra-ui/react @emotion/react @emotion/styled framer-motion
1615
```
1716

1817
After installing Chakra UI, you need to set up the `ChakraProvider` at the root
19-
of your application. This can be either in your `index.jsx` or `index.tsx`
20-
21-
Put in the following code:
18+
of your application. This can be either in your `index.jsx`, `index.tsx` or
19+
`App.jsx` depending on the framework you use.
2220

2321
```jsx live=false
2422
import * as React from 'react'
@@ -45,11 +43,15 @@ guides for these frameworks:
4543

4644
## Learn
4745

48-
If you're new here, watch our free courses below
46+
Watch our official courses and dive into dozens of videos that will teach you
47+
everything you need to know about Chakra UI, from basics to advanced concepts.
4948

50-
<EggheadCourseBanner href='https://egghead.io/courses/build-a-modern-user-interface-with-chakra-ui-fac68106' />
49+
<FeaturesCourses />
5150

5251
## Contribute
5352

54-
Please see our [contribution guidelines](/getting-started/contributing) to learn
55-
how you can contribute to this project.
53+
Whether you're a beginner or advanced Chakra UI user, joining our community is
54+
the best way to connect with like-minded people who build great products with
55+
the library.
56+
57+
[Join our Discord](https://chakra-ui.com/discord)

next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = withContentlayer({
1515
'avatars1.githubusercontent.com',
1616
'avatars2.githubusercontent.com',
1717
'avatars3.githubusercontent.com',
18+
'res.cloudinary.com',
1819
],
1920
},
2021
productionBrowserSourceMaps: true,
Loading
259 KB
Loading

public/egghead-banner/chakra.svg

-10
This file was deleted.

public/egghead-banner/egghead.svg

-13
This file was deleted.

public/egghead-banner/lazar.png

-26.8 KB
Binary file not shown.

src/components/framework-link.tsx

+16-20
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
import {
2-
Box,
3-
Center,
4-
Link as ChakraLink,
5-
SimpleGrid,
6-
Text,
7-
} from '@chakra-ui/react'
1+
import { Box, Link as ChakraLink, SimpleGrid, Text } from '@chakra-ui/react'
82
import Link from 'next/link'
9-
import React from 'react'
103
import {
114
BlitzSvg,
125
CreateReactAppSvg,
@@ -21,21 +14,24 @@ const FrameworkLink = (props) => {
2114
const { accentColor, href, children, name } = props
2215
return (
2316
<Link passHref href={href}>
24-
<ChakraLink textDecoration='none' _hover={{ textDecoration: 'none' }}>
25-
<Box boxShadow='md' bg='white' borderRadius='xl' pt='4'>
17+
<ChakraLink
18+
bg='white'
19+
display='block'
20+
shadow='md'
21+
textDecoration='none'
22+
borderRadius='xl'
23+
overflow='hidden'
24+
transform='auto'
25+
transition='all 0.1s ease-in-out'
26+
_hover={{ textDecoration: 'none', translateY: '-2px', shadow: 'md' }}
27+
>
28+
<Box pt='4'>
2629
{children}
27-
28-
<Center
29-
bg={accentColor}
30-
borderBottomStartRadius='lg'
31-
borderBottomEndRadius='lg'
32-
height='30px'
33-
mt='4'
34-
>
35-
<Text color='white' fontSize='sm' fontWeight='bold'>
30+
<Box bg={accentColor} mt='4' py='1' color='white'>
31+
<Text textAlign='center' fontSize='sm' fontWeight='bold'>
3632
{name}
3733
</Text>
38-
</Center>
34+
</Box>
3935
</Box>
4036
</ChakraLink>
4137
</Link>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { Box, LinkBox, LinkOverlay, SimpleGrid, Text } from '@chakra-ui/react'
2+
import NextImage from 'next/image'
3+
4+
const CourseBanner = ({
5+
href,
6+
image,
7+
title,
8+
description,
9+
}: {
10+
image: string
11+
title: string
12+
description: string
13+
href: string
14+
}) => {
15+
return (
16+
<LinkBox role='group' mt='10'>
17+
<Box mb='4' rounded='lg' overflow='hidden'>
18+
<NextImage
19+
src={image}
20+
alt='Egghead Logo'
21+
layout='responsive'
22+
width='400'
23+
height='200'
24+
/>
25+
</Box>
26+
27+
<LinkOverlay href={href} target='_blank'>
28+
<Text as='h3' fontWeight='semibold'>
29+
{title}
30+
</Text>
31+
</LinkOverlay>
32+
33+
<Text mt='2' mb='4' fontSize='sm' color='fg-muted'>
34+
{description}
35+
</Text>
36+
</LinkBox>
37+
)
38+
}
39+
40+
export const FeaturesCourses = () => {
41+
return (
42+
<SimpleGrid columns={{ base: 1, lg: 2 }} spacing={{ base: '4', md: '8' }}>
43+
<CourseBanner
44+
image='/course-banners/egghead-course.png'
45+
title='Egghead Course'
46+
description='In this free course, you will learn the basics of Chakra UI and how to build well-designed, accessible user interfaces with speed!'
47+
href='https://egghead.io/courses/build-a-modern-user-interface-with-chakra-ui-fac68106'
48+
/>
49+
<CourseBanner
50+
image='/course-banners/chakra-ui-for-beginners.png'
51+
title='Chakra UI for beginners'
52+
description='The complete course for absolute beginners to understand how Chakra UI works and get started building.'
53+
href='https://www.chakrauiforbeginners.com/'
54+
/>
55+
</SimpleGrid>
56+
)
57+
}
58+
59+
export default CourseBanner

src/components/mdx-components/egghead-course-banner/index.tsx

-65
This file was deleted.

src/components/mdx-components/mdx-components.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import PropsTable from '../props-table'
44
import CarbonAd from './carbon-ad'
55
import CodeBlock from './codeblock/codeblock'
66
import ComponentLinks from './component-links'
7-
import EggheadCourseBanner from './egghead-course-banner'
7+
import { FeaturesCourses } from './course-banner'
88
import IconsList from './icons-list'
99
import {
1010
ColorPalette,
@@ -89,7 +89,7 @@ export const MDXComponents = {
8989
ColorPalette,
9090
ColorPalettes,
9191
ColorWrapper,
92-
EggheadCourseBanner,
92+
FeaturesCourses,
9393
SandpackEmbed: (props) => (
9494
<Box my={6}>
9595
<SandpackEmbed {...props} />

src/components/sidebar/sidebar.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,15 @@ const MainNavLink = ({ href, icon, children, isActive }: MainNavLinkProps) => {
125125
color={active ? 'accent' : 'fg-muted'}
126126
_hover={{ color: active ? undefined : 'fg' }}
127127
>
128-
<Center w='6' h='6' bg='accent-static' rounded='base' color='white'>
128+
<Center
129+
w='6'
130+
h='6'
131+
borderWidth='1px'
132+
bg={active ? 'accent-static' : 'transparent'}
133+
borderColor={active ? 'accent-static' : undefined}
134+
rounded='base'
135+
color={active ? 'white' : 'accent'}
136+
>
129137
{icon}
130138
</Center>
131139
<span>{children}</span>

0 commit comments

Comments
 (0)