Skip to content

Commit 1ffae68

Browse files
committed
refactor(all files): code refactoring in general
1 parent 8d0ba5c commit 1ffae68

File tree

8 files changed

+15
-14
lines changed

8 files changed

+15
-14
lines changed

commit.cmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx cz && exit

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-automated-repos",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Github-automated-repos is the lib that gives you the power to manage the view of your projects on your website in one place!",
55
"main": "index.js",
66
"scripts": {

src/components/ProjectIcons.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ import React from 'react';
33
import { IconsData } from '../hooks/useGithubAutomatedRepos';
44

55
type Props = {
6-
iconItem: string;
6+
itemTopics: string;
77
className?: string;
88
};
99

1010
/**
11-
* @param {string} iconItem - Mandatory: ex.: item.topics.map(topics)... iconItem={topics}
11+
* @param {string} itemTopics - Mandatory: ex.: item.topics.map(topics)...
1212
* @param {string} className - Optional: style className.
1313
* @returns {<img/>} - Return tag img, project svg icon.
1414
*/
1515

16-
export function ProjectIcons({ iconItem, className }: Props) {
16+
export function ProjectIcons({ itemTopics, className }: Props) {
1717
const { projectIcons } = IconsData();
1818
return (
1919
<div>
20-
{projectIcons[iconItem as never] ? (
21-
<img className={className} alt={projectIcons[iconItem as never]} src={projectIcons[iconItem as never]} />
20+
{projectIcons[itemTopics as never] ? (
21+
<img className={className} alt={projectIcons[itemTopics as never]} src={projectIcons[itemTopics as never]} />
2222
) : (
2323
<> </>
2424
)}

src/components/StackIcons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type Props = {
88
};
99

1010
/**
11-
* @param {string} itemTopics - Mandatory: ex.: item.topics.map(itemTopics) ... iconStack={itemTopics}
11+
* @param {string} itemTopics - Mandatory: ex.: item.topics.map(itemTopics) ...
1212
* @param {string} className - Optional: style className.
1313
* @returns {<img/>} - Return tag img, stack svg icon.
1414
*/

src/components/StackText/StackText.tsx renamed to src/components/StackLabels/StackLabels.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ type Props = {
99
};
1010

1111
/**
12-
* @param {string} itemTopics - Mandatory: ex.: item.topics.map(itemTopics)... iconText={itemTopics}
12+
* @param {string} itemTopics - Mandatory: ex.: item.topics.map(itemTopics)... itemTopics={itemTopics}
1313
* @param {string} className - Optional: style className.
1414
* @returns {<p/>} - Return tag p, stack text.
1515
*/
16-
export function StackText({ itemTopics, className = 'styleStackText' }: Props) {
16+
export function StackLabels({ itemTopics, className = 'styleStackLabels' }: Props) {
1717
const { projectIcons, stackIcons } = IconsData();
1818

1919
if (projectIcons[itemTopics as never]) {

src/components/StackText/styles.ts renamed to src/components/StackLabels/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const css = `
2-
.styleStackText {
2+
.styleStackLabels {
33
font-weight: 500;
44
color: white;
55
width: 85px;

src/hooks/useGithubAutomatedRepos.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { useEffect, useState } from 'react';
2020

2121
export interface IGithubRepos {
2222
name: string;
23-
topics: [];
23+
topics: string[];
2424
html_url: string;
2525
description: string;
2626
id: number;
@@ -32,7 +32,7 @@ export interface IGithubRepos {
3232
* @param {string} keyWordDeploy - Insert a keyword chosen by you. - This key is responsible for managing your projects on GitHub in topics field Ex.: https://github.com/DIGOARTHUR/github-automated-repos#--about-library-.
3333
* @returns {(IGithubRepos[])} - Returns an array with the properties: name, topics, html_url, description, id, homepage.
3434
*/
35-
export function useGithubAutomatedRepos(usernameGitHub: string, keyWordDeploy: string) {
35+
export function useGitHubAutomatedRepos(usernameGitHub: string, keyWordDeploy: string) {
3636
const [repository, setRepository] = useState<IGithubRepos[]>([]);
3737
useEffect(() => {
3838
fetch(`https://api.github.com/users/${usernameGitHub}/repos?sort=created&per_page=999`)

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export { ProjectIcons } from './components/ProjectIcons';
22
export { StackIcons } from './components/StackIcons';
3-
export { StackText } from './components/StackText/StackText';
4-
export { IGithubRepos, useGithubAutomatedRepos, IconsData } from './hooks/useGithubAutomatedRepos';
3+
export { StackLabels } from './components/StackLabels/StackLabels';
4+
export { IGithubRepos, useGitHubAutomatedRepos, IconsData } from './hooks/useGithubAutomatedRepos';

0 commit comments

Comments
 (0)