Skip to content

Commit 84a7a93

Browse files
authored
style: add a link on the logo to redirect to the GitHub homepage (Jonghakseo#751)
1 parent 41950aa commit 84a7a93

File tree

5 files changed

+25
-6
lines changed

5 files changed

+25
-6
lines changed

pages/devtools-panel/src/Panel.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ const Panel = () => {
77
const theme = useStorage(exampleThemeStorage);
88
const isLight = theme === 'light';
99
const logo = isLight ? 'devtools-panel/logo_horizontal.svg' : 'devtools-panel/logo_horizontal_dark.svg';
10+
const goGithubSite = () =>
11+
chrome.tabs.create({ url: 'https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite' });
1012

1113
return (
1214
<div className={`App ${isLight ? 'bg-slate-50' : 'bg-gray-800'}`}>
1315
<header className={`App-header ${isLight ? 'text-gray-900' : 'text-gray-100'}`}>
14-
<img src={chrome.runtime.getURL(logo)} className="App-logo" alt="logo" />
16+
<button onClick={goGithubSite}>
17+
<img src={chrome.runtime.getURL(logo)} className="App-logo" alt="logo" />
18+
</button>
1519
<p>
1620
Edit <code>pages/devtools-panel/src/Panel.tsx</code>
1721
</p>

pages/new-tab/src/NewTab.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ const NewTab = () => {
99
const theme = useStorage(exampleThemeStorage);
1010
const isLight = theme === 'light';
1111
const logo = isLight ? 'new-tab/logo_horizontal.svg' : 'new-tab/logo_horizontal_dark.svg';
12+
const goGithubSite = () =>
13+
chrome.tabs.create({ url: 'https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite' });
1214

1315
console.log(t('hello', 'World'));
14-
1516
return (
1617
<div className={`App ${isLight ? 'bg-slate-50' : 'bg-gray-800'}`}>
1718
<header className={`App-header ${isLight ? 'text-gray-900' : 'text-gray-100'}`}>
18-
<img src={chrome.runtime.getURL(logo)} className="App-logo" alt="logo" />
19+
<button onClick={goGithubSite}>
20+
<img src={chrome.runtime.getURL(logo)} className="App-logo" alt="logo" />
21+
</button>
1922
<p>
2023
Edit <code>pages/new-tab/src/NewTab.tsx</code>
2124
</p>

pages/options/src/Options.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ const Options = () => {
77
const theme = useStorage(exampleThemeStorage);
88
const isLight = theme === 'light';
99
const logo = isLight ? 'options/logo_horizontal.svg' : 'options/logo_horizontal_dark.svg';
10+
const goGithubSite = () =>
11+
chrome.tabs.create({ url: 'https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite' });
1012

1113
return (
1214
<div className={`App ${isLight ? 'text-gray-900 bg-slate-50' : 'text-gray-100 bg-gray-800'}`}>
13-
<img src={chrome.runtime.getURL(logo)} className="App-logo" alt="logo" />
15+
<button onClick={goGithubSite}>
16+
<img src={chrome.runtime.getURL(logo)} className="App-logo" alt="logo" />
17+
</button>
1418
<p>
1519
Edit <code>pages/options/src/Options.tsx</code>
1620
</p>

pages/popup/src/Popup.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const Popup = () => {
1414
const theme = useStorage(exampleThemeStorage);
1515
const isLight = theme === 'light';
1616
const logo = isLight ? 'popup/logo_vertical.svg' : 'popup/logo_vertical_dark.svg';
17+
const goGithubSite = () =>
18+
chrome.tabs.create({ url: 'https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite' });
1719

1820
const injectContentScript = async () => {
1921
const [tab] = await chrome.tabs.query({ currentWindow: true, active: true });
@@ -38,7 +40,9 @@ const Popup = () => {
3840
return (
3941
<div className={`App ${isLight ? 'bg-slate-50' : 'bg-gray-800'}`}>
4042
<header className={`App-header ${isLight ? 'text-gray-900' : 'text-gray-100'}`}>
41-
<img src={chrome.runtime.getURL(logo)} className="App-logo" alt="logo" />
43+
<button onClick={goGithubSite}>
44+
<img src={chrome.runtime.getURL(logo)} className="App-logo" alt="logo" />
45+
</button>
4246
<p>
4347
Edit <code>pages/popup/src/Popup.tsx</code>
4448
</p>

pages/side-panel/src/SidePanel.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ const SidePanel = () => {
77
const theme = useStorage(exampleThemeStorage);
88
const isLight = theme === 'light';
99
const logo = isLight ? 'side-panel/logo_vertical.svg' : 'side-panel/logo_vertical_dark.svg';
10+
const goGithubSite = () =>
11+
chrome.tabs.create({ url: 'https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite' });
1012

1113
return (
1214
<div className={`App ${isLight ? 'bg-slate-50' : 'bg-gray-800'}`}>
1315
<header className={`App-header ${isLight ? 'text-gray-900' : 'text-gray-100'}`}>
14-
<img src={chrome.runtime.getURL(logo)} className="App-logo" alt="logo" />
16+
<button onClick={goGithubSite}>
17+
<img src={chrome.runtime.getURL(logo)} className="App-logo" alt="logo" />
18+
</button>
1519
<p>
1620
Edit <code>pages/side-panel/src/SidePanel.tsx</code>
1721
</p>

0 commit comments

Comments
 (0)