Skip to content

Commit 31db7fc

Browse files
committed
refactor: popup
1 parent 7c800a7 commit 31db7fc

File tree

6 files changed

+67
-53
lines changed

6 files changed

+67
-53
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,18 @@
1818

1919
</div>
2020

21-
## Shortcut key
22-
23-
Macbook: `Cmd + '` or `ctrl + '`
24-
25-
Window: `ctrl + '`
26-
2721
## Made with
2822

2923
- <img src="https://img.icons8.com/?size=2x&id=t5K2CR8feVdX&format=png" width="18" height="18"/> Made with **[React 18](https://reactjs.org)**
3024
- <img src="https://img.icons8.com/?size=2x&id=uJM6fQYqDaZK&format=png" width="18" height="18"/> Made with [TypeScript](https://www.typescriptlang.org/) Support!
3125
- πŸ› οΈ [Devtools](https://developer.chrome.com/docs/extensions/mv3/devtools/) supported
3226
- <img src="https://img.icons8.com/?size=2x&id=nvw4LO3DfcyI&format=png" width="18" height="18"/> Using **[Webpack](https://webpack.js.org/)**
3327

34-
### Would you like to support me?
35-
36-
<div align="center">
37-
<a href="https://github.com/numandev1?tab=followers">
38-
<img src="https://img.shields.io/github/followers/numandev1?label=Follow%20%40numandev1&style=social" height="36" />
39-
</a>
40-
<a href="https://twitter.com/numandev1/">
41-
<img src="https://img.shields.io/twitter/follow/numandev1?label=Follow%20%40numandev1&style=social" height="36" />
42-
</a>
43-
<a href="https://www.youtube.com/@numandev?sub_confirmation=1"><img src="https://img.shields.io/youtube/channel/subscribers/UCYCUspfN7ZevgCj3W5GlFAw?style=social" height="36" /><a/>
44-
</br>
45-
<a href="https://www.buymeacoffee.com/numan.dev" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
46-
</div>
47-
48-
## Consider supporting with a ⭐️ [Star on GitHub](https://github.com/numandev1/github-emojis-extension/stargazers)
49-
50-
## ⏳ Installation Instructions
51-
52-
### Chrome
53-
54-
#### Chrome Web Store
28+
## ⏳ Installation
5529

56-
Go to the [Chrome Web Store page for _Github Emoji_](https://chrome.google.com/webstore/detail/ecldoejhjmekemajgjjalfgkhgmfjgcl) and install normally.
30+
##### Install from Chrome Web Store
5731

58-
After installing, make sure to reload your Github URL or restart Chrome!
32+
[![Chrome Web Store](https://img.shields.io/static/v1?style=for-the-badge&message=Install+From+Chrome+Web+Store&color=4285F4&logo=Google+Chrome&logoColor=FFFFFF&label=)](https://chrome.google.com/webstore/detail/ecldoejhjmekemajgjjalfgkhgmfjgcl)
5933

6034
#### Manual/Development
6135

@@ -69,6 +43,30 @@ After installing, make sure to reload your Github URL or restart Chrome!
6943
3. Click on `Load unpacked extension`
7044
4. Select the `build` folder.
7145

46+
## Shortcut key
47+
48+
Macbook: `Cmd + '` or `ctrl + '`
49+
50+
Window: `ctrl + '`
51+
52+
### Would you like to support me?
53+
54+
<div align="center">
55+
<a href="https://github.com/numandev1?tab=followers">
56+
<img src="https://img.shields.io/github/followers/numandev1?label=Follow%20%40numandev1&style=social" height="36" />
57+
</a>
58+
</br>
59+
<a href="https://twitter.com/numandev1/">
60+
<img src="https://img.shields.io/twitter/follow/numandev1?label=Follow%20%40numandev1&style=social" height="36" />
61+
</a>
62+
</br>
63+
<a href="https://www.youtube.com/@numandev?sub_confirmation=1"><img src="https://img.shields.io/youtube/channel/subscribers/UCYCUspfN7ZevgCj3W5GlFAw?style=social" height="36" /><a/>
64+
</br>
65+
<a href="https://www.buymeacoffee.com/numan.dev" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
66+
</div>
67+
68+
#### Consider supporting with a ⭐️ [Star on GitHub](https://github.com/numandev1/github-emojis-extension/stargazers)
69+
7270
## Contribution Guide
7371

7472
1. Follow [Manual/Development](#manualdevelopment) steps

β€Žpackage.jsonβ€Ž

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-emoji-extension",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "Use emojis in github Issues/PR",
55
"license": "MIT",
66
"repository": {
@@ -11,7 +11,7 @@
1111
"build": "node utils/build.js",
1212
"start": "node utils/webserver.js",
1313
"prettier": "prettier --write '**/*.{js,jsx,ts,tsx,json,css,scss,md}'",
14-
"prepare:prod": "NODE_ENV=production npm run build"
14+
"zip": "NODE_ENV=production ./node_modules/.bin/webpack --config ./utils/build.js --mode production"
1515
},
1616
"dependencies": {
1717
"arrive": "^2.4.1",
@@ -61,5 +61,20 @@
6161
"webpack-cli": "^4.10.0",
6262
"webpack-dev-server": "^4.11.1",
6363
"zip-webpack-plugin": "^4.0.1"
64-
}
64+
},
65+
"keywords": [
66+
"github",
67+
"react",
68+
"javascript",
69+
"emoji",
70+
"chrome",
71+
"extension",
72+
"reactjs",
73+
"browser-extension",
74+
"google-browser-extension",
75+
"emojis",
76+
"webstore",
77+
"extension-chrome",
78+
"cli"
79+
]
6580
}

β€Žsrc/pages/Content/hooks/useDebouncedCallback.tsβ€Ž

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import {useRef, useEffect, useMemo} from 'react';
1+
// @ts-nocheck
2+
import { useRef, useEffect, useMemo } from 'react';
23

34
export interface CallOptions {
45
leading?: boolean;
@@ -87,12 +88,12 @@ export interface DebouncedState<T extends (...args: any[]) => ReturnType<T>>
8788
* const status = debounced.pending() ? "Pending..." : "Ready"
8889
*/
8990
export default function useDebouncedCallback<
90-
T extends (...args: any[]) => ReturnType<T>,
91+
T extends (...args: any[]) => ReturnType<T>
9192
>(func: T, wait?: number, options?: Options): DebouncedState<T> {
92-
const lastCallTime = useRef(null);
93+
const lastCallTime = useRef<any>(null);
9394
const lastInvokeTime = useRef(0);
94-
const timerId = useRef(null);
95-
const lastArgs = useRef<unknown[]>([]);
95+
const timerId = useRef<any>(null);
96+
const lastArgs = useRef<any>([]);
9697
const lastThis = useRef<unknown>();
9798
const result = useRef<ReturnType<T>>();
9899
const funcRef = useRef(func);
@@ -107,13 +108,13 @@ export default function useDebouncedCallback<
107108
throw new TypeError('Expected a function');
108109
}
109110

110-
wait = +wait || 0;
111+
wait = +(wait || 0);
111112
options = options || {};
112113

113114
const leading = !!options.leading;
114115
const trailing = 'trailing' in options ? !!options.trailing : true; // `true` by default
115116
const maxing = 'maxWait' in options;
116-
const maxWait = maxing ? Math.max(+options.maxWait || 0, wait) : null;
117+
const maxWait: any = maxing ? Math.max(+options.maxWait || 0, wait) : null;
117118

118119
useEffect(() => {
119120
mounted.current = true;

β€Žsrc/pages/Popup/Popup.cssβ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,11 @@
4646
}
4747

4848
.mt-20 {
49+
margin-top: 20px;
50+
}
51+
52+
h4 {
53+
margin: 0;
4954
margin-top: 10px;
55+
margin-bottom: 10px;
5056
}

β€Žsrc/pages/Popup/Popup.tsxβ€Ž

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,28 @@ const Popup = () => {
99
<img src={logo} className="App-logo" alt="logo" />
1010
<a
1111
className="App-link"
12-
href="https://github.com/numandev1/github-emojis-extension/stargazers"
12+
href="https://chrome.google.com/webstore/detail/ecldoejhjmekemajgjjalfgkhgmfjgcl"
1313
target="_blank"
1414
rel="noopener noreferrer"
1515
>
16-
<h4>Consider supporting with a Star ⭐️</h4>
16+
<img src="https://img.shields.io/static/v1?style=for-the-badge&message=Review+On+WebStore&color=4285F4&logo=Google+Chrome&logoColor=FFFFFF&label=" />
1717
</a>
1818
<a
19-
href="https://github.com/numandev1/github-emoji-extension/stargazers"
19+
className="App-link"
20+
href="https://github.com/numandev1/github-emojis-extension/stargazers"
2021
target="_blank"
2122
rel="noopener noreferrer"
2223
>
23-
<img
24-
src="https://img.shields.io/github/stars/numandev1/github-emoji-extension?style=for-the-badge&logo=github"
25-
height="20"
26-
/>
24+
<h4>support with a Star on Github ⭐️</h4>
2725
</a>
2826
<a
29-
className="mt-20"
3027
href="https://github.com/numandev1?tab=followers"
3128
target="_blank"
3229
rel="noopener noreferrer"
3330
>
3431
<img
3532
src="https://img.shields.io/github/followers/numandev1?label=Follow%20%40numandev1&style=social"
36-
height="20"
33+
height="25"
3734
/>
3835
</a>
3936
<a

β€Žutils/build.jsβ€Ž

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ process.env.BABEL_ENV = 'production';
33
process.env.NODE_ENV = 'production';
44
process.env.ASSET_PATH = '/';
55

6-
var webpack = require('webpack'),
7-
path = require('path'),
6+
var path = require('path'),
87
fs = require('fs'),
98
config = require('../webpack.config'),
109
ZipPlugin = require('zip-webpack-plugin');
@@ -22,6 +21,4 @@ config.plugins = (config.plugins || []).concat(
2221
})
2322
);
2423

25-
webpack(config, function (err) {
26-
if (err) throw err;
27-
});
24+
module.exports = config;

0 commit comments

Comments
Β (0)