Skip to content

Commit eca3d2f

Browse files
authored
docs: update Readme
1 parent 5a96f88 commit eca3d2f

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

README.md

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ EXEMPLO
2828

2929

3030

31-
32-
33-
3431
<!------------------------------------ LANGUAGE BUTTONS-->
3532
<div align="right">
3633
<a href="https://github.com/DIGOARTHUR/github-automated-repos#readme">
@@ -112,9 +109,9 @@ EXEMPLO
112109
hook config.
113110

114111
```typescript
115-
import {useGithubAutomatedRepos} from "github-automated-repos";
112+
import {useGithubAutomatedRepos} from "github-automated-repos";
116113

117-
const data = useGithubAutomatedRepos("GitHubUsername", "KeyWord");
114+
const data = useGithubAutomatedRepos("GitHubUsername", "KeyWord");
118115

119116
```
120117

@@ -153,7 +150,6 @@ const data = useGithubAutomatedRepos("GitHubUsername", "KeyWord");
153150

154151
- ## <a href="https://github.com/DIGOARTHUR/github-automated-repos#--sobre-a-aplicação-">About Library</a>
155152
- ## <a href="https://github.com/DIGOARTHUR/github-automated-repos#--library-">Library</a>
156-
- ### <a href="https://github.com/DIGOARTHUR/github-automated-repos#install-1">Install</a>
157153
- ### <a href="https://github.com/DIGOARTHUR/github-automated-repos#import-1">Import</a>
158154
- ### <a href="https://github.com/DIGOARTHUR/github-automated-repos#fill-in-the-fields-in-the-github-repository-1">Fill in the fields in the github repository</a>
159155
- ### <a href="https://github.com/DIGOARTHUR/github-automated-repos#code-example-1">Code Example</a>
@@ -199,17 +195,30 @@ const data = useGithubAutomatedRepos("GitHubUsername", "KeyWord");
199195
```
200196
### The package imports four elements:
201197

202-
- `ProjectIcon` component that renders the icons of the projects that come from data returned from the dataGithubRepos function as the Topics property. Check the [Project Icons](https://github-automated-repos.vercel.app/documentation/projectIcons) tab!
198+
- `useGithubAutomatedRepos` hook responsible for automating the repositories. It returns a function called dataGithubRepos, which takes two parameters: data (data that comes from the GitHub API) and the keyword (the latter responsible for showing the project on your website from the moment it is declared in the Topics field of the your Github repository). The dataGithubRepos returns, so optimized, an array of objects containing 6 properties: id, html_url, homepage, topics, name and description.
199+
200+
```tsx
201+
const data = useGithubAutomatedRepos("GitHubUsername", "KeyWord");
202+
```
203+
204+
- `StackIcons` component returns, based on the iteration of the topics array, icons of the stacks used in your project. Insert the stacks used in the topics field of your repository. Check the [Stack Icons](https://github-automated-repos.vercel.app/documentation/stackIcons) tab!
203205

204-
- `StackIcon` component that renders the icons of the stacks that come from data returned from the dataGithubRepos function as the Topics property. Check the [Stack Icons](https://github-automated-repos.vercel.app/documentation/stackIcons) tab!
206+
```tsx
207+
<StackIcons key={ } itemTopics={ } className={ } />
208+
```
209+
210+
- `StackLabels` component returns, based on the iteration of the topics array, labels of the stacks used in your project. Insert the stacks used in the topics field of your repository. Check the [Stack Icons](https://github-automated-repos.vercel.app/documentation/stackIcons) tab!
205211

206-
- `IGithubRepos` interface for the application in Typescript. Used to type the useState that will receive the array.
212+
```tsx
213+
<StackLabes key={ } itemTopics={ } className={ } />
214+
```
207215

208-
- `useGithubAutomatedRepos` hook responsible for automating the repositories. It returns a function called dataGithubRepos, which takes two parameters: data (data that comes from the GitHub API) and the keyword (the latter responsible for showing the project on your website from the moment it is declared in the Topics field of the your Github repository). The dataGithubRepos returns, so optimized, an array of objects containing 6 properties: id, html_url, homepage, topics, name and description.
216+
- `ProjectIcons` component returns, based on the iteration of the topics array, icons to represent your project. The project tag must be inserted in the topics field of your repository. Check the [Project Icons](https://github-automated-repos.vercel.app/documentation/projectIcons) tab!
217+
218+
```tsx
219+
<ProjectIcons key={ } itemTopics={ } className={ } />
220+
```
209221

210-
```javascript
211-
const { dataReposGithub } = useGithubAutomatedRepos()
212-
```
213222

214223
## Fill in the fields in the github repository
215224

@@ -309,19 +318,10 @@ const data = useGithubAutomatedRepos("GitHubUsername", "KeyWord");
309318

310319
```typescript
311320
import './App.css';
312-
import { useEffect, useState } from 'react';
313-
import { useGithubAutomatedRepos, ProjectIcon, StackIcon } from 'github-automated-repos/index';
321+
import { useGithubAutomatedRepos, ProjectIcons, StackIcons, StackLabels, } from 'github-automated-repos';
314322
function App() {
315323
{/*useGithubAutomatedRepos hook*/ }
316-
const { dataReposGithub } = useGithubAutomatedRepos()
317-
const [repository, setRepository] = useState<IGithubRepos[]>([])
318-
319-
useEffect(() => {
320-
{/*Put here your github Name*/ }
321-
fetch('https://api.github.com/users/usernameGitHub/repos?sort=created&per_page=999')
322-
.then(response => response.json())
323-
.then(data => setRepository(dataReposGithub(data, 'deploy'))); {/*<-- keyWord*/}
324-
}, [])
324+
const data = useGithubAutomatedRepos("GitHubUsername", "KeyWord");
325325

326326
return (
327327
<div className="App">
@@ -330,10 +330,10 @@ const data = useGithubAutomatedRepos("GitHubUsername", "KeyWord");
330330
return (
331331
<div key={item.id}>
332332

333-
{/*Project Icon*/}
333+
{/*Project Icons*/}
334334
{item.topics.map((icon) => {
335335
return (
336-
<ProjectIcon key={icon} className="project_Icon" iconItem={icon} />
336+
<ProjectIcons key={icon} className="project_Icon" iconItem={icon} />
337337
)
338338
})}
339339

@@ -354,7 +354,8 @@ const data = useGithubAutomatedRepos("GitHubUsername", "KeyWord");
354354
{/*Stacks Icon*/}
355355
{item.topics.map((icon) => {
356356
return (
357-
<StackIcon key={icon} className="stack_Icon" iconItem={icon} />
357+
<StackIcons key={icon} className="stack_Icon" itemTopics={icon} />
358+
<StackText key={topics} itemTopics={topics} />
358359
)
359360
})}
360361

0 commit comments

Comments
 (0)