Skip to content

Commit 7dc3050

Browse files
committed
UPDATE hardcoded links to json
1 parent d3d286a commit 7dc3050

File tree

4 files changed

+23
-19
lines changed

4 files changed

+23
-19
lines changed

config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"server": false,
33
"port": 2323,
44
"tabURL": "",
5+
"docs": "https://google.com",
6+
"docsInstall": "https://instagram.com",
57
"state": true,
68
"theme": "dark",
79
"page": "auth",

src/comps/Header.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import './Icon.js'
33
import manifest from '../../manifest.json' assert {type: 'json'}
44

55
chrome.storage.local.get(function(result) {
6-
let theme,page,state
6+
let theme,page,state,docs = result.docs
77

88
result.state === true ? state = 'toggle_on': state = 'toggle_off'
99
result.theme === 'dark' ? theme = 'light_mode': theme = 'dark_mode'
@@ -12,7 +12,7 @@ chrome.storage.local.get(function(result) {
1212
const header =
1313
`<header>
1414
<div>
15-
<snipx-logo text="${manifest.name}"></snipx-logo>
15+
<snipx-logo href="${docs}" text="${manifest.name}"></snipx-logo>
1616
</div>
1717
<div>
1818
<snipx-icon icon="${state}"></snipx-icon>

src/comps/Logo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default class SnipxLogo extends HTMLElement {
22
constructor() {
33
super()
4-
this.innerHTML = `<a href="https://google.com" target="_blank">${this.getAttribute('text')}</a>`
4+
this.innerHTML = `<a href="${this.getAttribute('href')}" target="_blank">${this.getAttribute('text')}</a>`
55
}
66
}
77

src/pages/Auth.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
// wrap in a chrome.storage.local.get()
2-
// use link from config file
3-
const auth =
4-
`<main id="auth">
5-
<p>Your server isn't running.</p>
6-
<a href="https://google.com" target="_blank">How to run SnipX</a>
7-
</main>`
8-
9-
export default class SnipxAuth extends HTMLElement {
10-
constructor() {
11-
super()
12-
this.innerHTML = auth
13-
}
14-
}
15-
16-
window.customElements.define('snipx-auth', SnipxAuth)
1+
export default (function() {
2+
chrome.storage.local.get(function(result) {
3+
const auth =
4+
`<main id="auth">
5+
<p>Your server isn't running.</p>
6+
<a href="${result.docsInstall}" target="_blank">How to run SnipX</a>
7+
</main>`
8+
9+
class SnipxAuth extends HTMLElement {
10+
constructor() {
11+
super()
12+
this.innerHTML = auth
13+
}
14+
}
15+
16+
window.customElements.define('snipx-auth', SnipxAuth)
17+
})
18+
})()

0 commit comments

Comments
 (0)