mirror of
https://github.com/abhijithvijayan/web-extension-starter.git
synced 2025-10-07 07:22:37 +02:00
chore: add sample UI
This commit is contained in:
parent
892797233b
commit
9dc1446c07
@ -1 +1,3 @@
|
||||
document.body.style.filter = 'invert(1)';
|
||||
|
||||
export {};
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
|
||||
const Options = () => {
|
||||
const Options: React.FC = () => {
|
||||
return <div>Hello World</div>;
|
||||
};
|
||||
|
||||
|
||||
@ -1,7 +1,40 @@
|
||||
import React from 'react';
|
||||
import { browser, Tabs } from 'webextension-polyfill-ts';
|
||||
|
||||
const Popup = () => {
|
||||
return <div>Hello world</div>;
|
||||
function openWebPage(url: string): Promise<Tabs.Tab> {
|
||||
return browser.tabs.create({ url });
|
||||
}
|
||||
|
||||
const Popup: React.FC = () => {
|
||||
return (
|
||||
<section id="popup">
|
||||
<h2>WEB-EXTENSION-STARTER</h2>
|
||||
<div className="links__holder">
|
||||
<ul>
|
||||
<li>
|
||||
<button
|
||||
type="button"
|
||||
onClick={(): Promise<Tabs.Tab> => {
|
||||
return openWebPage('https://github.com/abhijithvijayan/web-extension-starter');
|
||||
}}
|
||||
>
|
||||
GitHub
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
type="button"
|
||||
onClick={(): Promise<Tabs.Tab> => {
|
||||
return openWebPage('https://www.buymeacoffee.com/abhijithvijayan');
|
||||
}}
|
||||
>
|
||||
Buy Me A Coffee
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
};
|
||||
|
||||
export default Popup;
|
||||
|
||||
@ -6,3 +6,34 @@ body {
|
||||
color: $black;
|
||||
background-color: $greyWhite;
|
||||
}
|
||||
|
||||
|
||||
#popup {
|
||||
min-width: 350px;
|
||||
padding: 30px 20px;
|
||||
|
||||
h2 {
|
||||
font-size: 25px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.links__holder {
|
||||
ul {
|
||||
display: flex;
|
||||
margin-top: 1em;
|
||||
justify-content: space-around;
|
||||
|
||||
li {
|
||||
button {
|
||||
border-radius: 8%;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
background-color: rgba(0, 0 ,255, 0.7);
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
padding: 8px 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user