Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
andreancardona committed Oct 31, 2023
1 parent 5a88e1e commit 8d12444
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/pages/developing/react-tutorial/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ page.
### React

This is a web development tutorial that uses the Carbon React components built
with [Next.js](https://nextjs.org/). If you're just getting started with React and enjoy
learning-by-doing, check out the official React
with [Next.js](https://nextjs.org/). If you're just getting started with React
and enjoy learning-by-doing, check out the official React
[intro tutorial](https://react.dev/learn/tutorial-tic-tac-toe). You'll want to
supplement that with their
[step-by-step guide](https://react.dev/blog/2023/03/16/introducing-react-dev).
Expand Down
5 changes: 3 additions & 2 deletions src/pages/developing/react-tutorial/step-1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ that we'll use as a starting point for each step.

To begin, fork
[carbon-tutorial-nextjs](https://github.com/carbon-design-system/carbon-tutorial-nextjs)
using your GitHub account. Please note when forking you must untick “Copy the main branch only” so you can access all branches / steps of the tutorial.
using your GitHub account. Please note when forking you must untick “Copy the
main branch only” so you can access all branches / steps of the tutorial.

### Clone

Go to your forked repository, copy the SSH or HTTPS URL and in your terminal run
the two commands to get the repository in your local file system and enter that
directory.
directory.

```bash
git clone [your fork SSH/HTTPS]
Expand Down
3 changes: 2 additions & 1 deletion src/pages/developing/react-tutorial/step-2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,8 @@ page.

## Add repo page grid

Now in our `RepoPage`component in the `src/app/repos/page.js` file we'll import our `Grid` components at the top:
Now in our `RepoPage`component in the `src/app/repos/page.js` file we'll import
our `Grid` components at the top:

```javascript path=src/app/repos/page.js
'use client';
Expand Down
24 changes: 13 additions & 11 deletions src/pages/developing/react-tutorial/step-3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,9 @@ belong to the `carbon-design-system` Github organization. We'll do this by using
a `useEffect` hook that will use octokit to query Github's API
[repositories endpoint](https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-organization-repositories).

Let's declare a `useEffect` hook immediately below the component definition and above the return.
We'll use this to query Github's API when the component first renders:
Let's declare a `useEffect` hook immediately below the component definition and
above the return. We'll use this to query Github's API when the component first
renders:

```javascript path=src/app/repos/page.js
function RepoPage() {
Expand All @@ -176,8 +177,8 @@ function RepoPage() {
}, []);
```
At this point, if you navigate to the Repositories page `/repos` in your running app
and view your browser's console (e.g.
At this point, if you navigate to the Repositories page `/repos` in your running
app and view your browser's console (e.g.
[Chrome DevTools](https://developer.chrome.com/docs/devtools/)), you should see
the response from GitHub!
Expand All @@ -186,7 +187,8 @@ the response from GitHub!
Our last column in the data table will be a comma-separated list of repository
and home page links, so let's create a component called `LinkList`.
Import `Link` at the top of `/app/repos/page.js`. The imports should look like this.
Import `Link` at the top of `/app/repos/page.js`. The imports should look like
this.
```javascript path=src/app/repos/page.js
import { Link, Grid, Column } from '@carbon/react';
Expand Down Expand Up @@ -278,12 +280,12 @@ To complete our `getCarbonRepos` function, let's set the loading state to false
right after the `else` statement:
```javascript path=src/app/repos/page.js
if (res.status === 200) {
setRows(getRowItems(res.data));
} else {
setError('Error obtaining repository data');
}
setLoading(false);
if (res.status === 200) {
setRows(getRowItems(res.data));
} else {
setError('Error obtaining repository data');
}
setLoading(false);
```
Finally, let's modify our component's `return()` statement to display different
Expand Down
2 changes: 1 addition & 1 deletion src/pages/developing/react-tutorial/step-4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ With the new components:
<InfoCard
heading="Carbon is Consistent"
body="Based on the comprehensive IBM Design Language, every element and component of Carbon was designed from the ground up to work elegantly together to ensure consistent, cohesive user experiences."
icon={() => <Globe size={32} />}
icon={() => <Globe size={32} />}
/>
</InfoSection>
```
Expand Down
4 changes: 2 additions & 2 deletions src/pages/developing/react-tutorial/wrapping-up.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Wrapping up
description:
Welcome to Carbon! This tutorial will guide you in creating a React app using Next.js with the
Carbon Design System.
Welcome to Carbon! This tutorial will guide you in creating a React app using
Next.js with the Carbon Design System.
tabs:
['Overview', 'Step 1', 'Step 2', 'Step 3', 'Step 4', 'Step 5', 'Wrapping up']
---
Expand Down

0 comments on commit 8d12444

Please sign in to comment.