diff options
author | 2021-05-03 12:26:10 -0600 | |
---|---|---|
committer | 2021-05-03 12:26:10 -0600 | |
commit | 94038d329705acb79a0f804458821d43f59121db (patch) | |
tree | 0f11c52b13a6de9344a83c900466b1bceb888bbe /examples/snowpack/src | |
parent | c93201a909105bb0ef75278d9635de4b5b8734e7 (diff) | |
download | astro-94038d329705acb79a0f804458821d43f59121db.tar.gz astro-94038d329705acb79a0f804458821d43f59121db.tar.zst astro-94038d329705acb79a0f804458821d43f59121db.zip |
Format (#167)
Diffstat (limited to 'examples/snowpack/src')
-rw-r--r-- | examples/snowpack/src/components/CompanyLogo.jsx | 2 | ||||
-rw-r--r-- | examples/snowpack/src/components/PluginSearchPage.jsx | 6 | ||||
-rw-r--r-- | examples/snowpack/src/components/docsearch.js | 31 | ||||
-rw-r--r-- | examples/snowpack/src/data/version.js | 4 | ||||
-rw-r--r-- | examples/snowpack/src/pages/guides/web-worker.md | 2 |
5 files changed, 27 insertions, 18 deletions
diff --git a/examples/snowpack/src/components/CompanyLogo.jsx b/examples/snowpack/src/components/CompanyLogo.jsx index 98be3f2eb..fc652f864 100644 --- a/examples/snowpack/src/components/CompanyLogo.jsx +++ b/examples/snowpack/src/components/CompanyLogo.jsx @@ -1,4 +1,4 @@ -import {h} from 'preact'; +import { h } from 'preact'; export default function CompanyLogo({ user }) { return ( diff --git a/examples/snowpack/src/components/PluginSearchPage.jsx b/examples/snowpack/src/components/PluginSearchPage.jsx index 51c7e6b0f..4ed46cb74 100644 --- a/examples/snowpack/src/components/PluginSearchPage.jsx +++ b/examples/snowpack/src/components/PluginSearchPage.jsx @@ -117,5 +117,9 @@ function PluginSearchPageLive() { } export default function PluginSearchPage(props) { - return import.meta.env.astro ? <div>Loading...</div> : <PluginSearchPageLive {...props} /> + return import.meta.env.astro ? ( + <div>Loading...</div> + ) : ( + <PluginSearchPageLive {...props} /> + ); } diff --git a/examples/snowpack/src/components/docsearch.js b/examples/snowpack/src/components/docsearch.js index d7ae95f30..f2b9e6441 100644 --- a/examples/snowpack/src/components/docsearch.js +++ b/examples/snowpack/src/components/docsearch.js @@ -1,17 +1,20 @@ import docsearch from 'docsearch.js/dist/cdn/docsearch.min.js'; -customElements.define('doc-search', class extends HTMLElement { - connectedCallback() { - if(!this._setup) { - const apiKey = this.getAttribute('api-key'); - const selector = this.getAttribute('selector'); - docsearch({ - apiKey: apiKey, - indexName: 'snowpack', - inputSelector: selector, - debug: true // Set debug to true if you want to inspect the dropdown - }); - this._setup = true; +customElements.define( + 'doc-search', + class extends HTMLElement { + connectedCallback() { + if (!this._setup) { + const apiKey = this.getAttribute('api-key'); + const selector = this.getAttribute('selector'); + docsearch({ + apiKey: apiKey, + indexName: 'snowpack', + inputSelector: selector, + debug: true, // Set debug to true if you want to inspect the dropdown + }); + this._setup = true; + } } - } -});
\ No newline at end of file + }, +); diff --git a/examples/snowpack/src/data/version.js b/examples/snowpack/src/data/version.js index 19a63491c..53f8ca53e 100644 --- a/examples/snowpack/src/data/version.js +++ b/examples/snowpack/src/data/version.js @@ -1,2 +1,4 @@ -const snowpackManifest = JSON.parse(fs.readFileSync(path.join(__dirname, '../../snowpack/package.json'), 'utf8')); +const snowpackManifest = JSON.parse( + fs.readFileSync(path.join(__dirname, '../../snowpack/package.json'), 'utf8'), +); export default snowpackManifest.version; diff --git a/examples/snowpack/src/pages/guides/web-worker.md b/examples/snowpack/src/pages/guides/web-worker.md index 4329c489a..56bce9774 100644 --- a/examples/snowpack/src/pages/guides/web-worker.md +++ b/examples/snowpack/src/pages/guides/web-worker.md @@ -28,4 +28,4 @@ const worker = new Worker(new URL('./esm-worker.js', import.meta.url), { name: 'my-worker', type: 'module', }); -```
\ No newline at end of file +``` |