Skip to content

Commit

Permalink
try using acorn components
Browse files Browse the repository at this point in the history
  • Loading branch information
dermeck committed Dec 8, 2024
1 parent 0b47b13 commit 161a4b7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sidebar/SubscribeView/SubscribeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { DetectedFeeds } from './DetectedFeeds/DetectedFeeds';
import { Button } from '../../base-components/Button/Button';
import { Header } from '../../base-components/Header/Header';
import { clsx } from 'clsx';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
import M from 'moz-button';
const isValidURL = (str: string) => {
const res = str.match(
/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g,
Expand Down Expand Up @@ -62,6 +63,8 @@ export const SubscribeView = (props: SubscribeViewProps) => {
<Button variant="toolbar" title="Back to Feed List" onClick={props.onClose}>
<ArrowLeft size={22} />
</Button>
<M>moep</M>

<h1 className="subscribe-view__title">Add New Feed</h1>
</Header>
<div className="subscribe-view__content">
Expand Down
1 change: 1 addition & 0 deletions src/sidebar/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8" />
<meta name="color-scheme" content="light dark" />
<link rel="stylesheet" href="sidebar-styles.css" />
<!-- <script type="module" src="chrome://global/content/elements/moz-button.mjs"></script> -->
</head>
<body>
<div id="sidebar-root"></div>
Expand Down
1 change: 1 addition & 0 deletions test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module 'moz-button';
8 changes: 8 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ module.exports = (env) => ({

resolve: {
extensions: ['.ts', '.tsx', '.js'],
alias: {
'moz-button': path.resolve('chrome://global/content/elements/moz-button.mjs'),
},
},

externalsType: 'import',
externals: {
'moz-button': 'chrome://global/content/elements/moz-button.mjs',
},

plugins: [
Expand Down

0 comments on commit 161a4b7

Please sign in to comment.