Skip to content

Commit cd38c8e

Browse files
committed
updated readme, modified code and interfaces
1 parent dabc34c commit cd38c8e

File tree

5 files changed

+25
-14
lines changed

5 files changed

+25
-14
lines changed

README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# React & nextJs Gist Loader
22

3-
- A library made using tsdx that help you to add gist in react and next on client side with username and avatar.
3+
- A package help you to add github gist in react and next on client side with username and avatar.
4+
5+
## Demo
6+
7+
https://www.myselfraj.com/eg/gist
8+
49

510
## Setup
611

@@ -11,6 +16,7 @@ npm i "@myselfraj/react-nextjs-github-gist"
1116
## Usage
1217

1318
```
19+
"use client"
1420
import GitGist from "@myselfraj/react-nextjs-github-gist";
1521
1622
//Somewhere in component or page
@@ -22,19 +28,19 @@ You can get the id from the Github url, kindly check the URL sample https://gist
2228
## Default Configuration
2329

2430
If no props are passed to ```<GitGist id="MUST" />```, below is the default configuration applied.
25-
**id is must**
2631
```
2732
<GitGist
2833
file = "",
2934
width = '100%',
3035
height = '600px',
31-
getProfile = 'false', //this give avatar and name of the owner of gist
36+
getProfile = 'false', //disables the feature that retrieves the avatar and name of the gist owner. Still you need to pass "UserName" manually, This Will depereacted in future releases to support UserName in advance Mode
3237
userName = '' //pass the username of the gist owner
3338
/>
3439
```
3540

36-
currently because of CORS i am unable to fetch the userame from git, yet i will figure out some way in future releases, so for now lets do manual work.
37-
Thnx to tleunen code.
41+
Currently, due to CORS (Cross-Origin Resource Sharing) restrictions, I am unable to fetch the username from GitHub using the Gist API. However, I plan to find a solution for this in future releases. In the meantime, we will have to resort to manual work. That's why you need to pass the **userName** parameter manually.
42+
43+
3844

3945

4046
---
@@ -45,10 +51,18 @@ Thnx to tleunen code.
4551
3. Create pull request
4652
4. We will review it and will merge it.
4753

48-
>> We are using Tsdx, to build you can use ```npm run build```
54+
> We are using Tsdx.
4955
56+
### Love it Drop a star on github
5057

58+
https://github.com/chapeee/react-nextjs-github-gist
5159

5260
## Authors
5361

54-
- [@chapeee](https://github.com/chapeee/)
62+
- [@chapeee](https://github.com/chapeee/)
63+
64+
## Connect with me
65+
[LinkedIn](https://www.linkedin.com/in/myselfraj/)
66+
67+
68+
Thanks to tleunen's code.

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.0.12",
2+
"version": "1.1.1",
33
"license": "MIT",
44
"main": "dist/index.js",
55
"typings": "dist/index.d.ts",
@@ -60,10 +60,7 @@
6060
"typescript": "^5.3.3"
6161
},
6262
"dependencies": {
63-
"axios": "^1.6.7",
64-
"html-creator": "^0.7.2",
65-
"react-axios": "^2.0.6",
66-
"react-iframe": "^1.8.5"
63+
"axios": "^1.6.7"
6764
},
6865
"repository": {
6966
"type": "git",

src/Git.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect, useRef, useState } from 'react';
22
import GitUserInfo from './Utils/Profile';
3-
import CreateIframe from './Utils/CreateIfram';
3+
import CreateIframe from './Utils/CreateIframe';
44
import { GistProps } from './Interfaces/Git'
55

66
function createGitGistUrl(id: string, file?: string): string {
File renamed without changes.

src/Utils/Profile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function GitUserInfo({ gistUsername }: GitUserInfoProps) {
4040
<p style={{ padding: '5px' }}>Gist By. {userInfo.name}</p>
4141
</div>
4242
) : (
43-
<div>Loading...</div>
43+
<div></div>
4444
)}
4545
</div>
4646
);

0 commit comments

Comments
 (0)