-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.ts
52 lines (47 loc) · 1007 Bytes
/
settings.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import {render} from "../../../index.js"
import {downloadUserData, uploadUserData} from "../services/settings.js"
import {lineContainerCSS, lineTextCSS} from "./modal-style.js"
import {ACTION_BUTTON} from "./app-style.js"
import {version} from "./version.js"
const settingsStyle = () => render`
<style>
ul.settings li {
border-bottom: 1px solid lightgrey;
${lineContainerCSS}
}
ul.settings li p {
${lineTextCSS}
}
ul.settings li #version {
width: auto;
font-size: 1.5rem;
line-height: 2;
}
</style>
`
export const settings = (): string => render`
<ul class="settings">
<li>
<p>Backup</p>
<button ::click=${downloadUserData} class="${ACTION_BUTTON}">
↧
</button>
</li>
<li>
<p>Restore</p>
<label for="restore-backup" class="${ACTION_BUTTON}">
↥
<input
type="file"
accept=".json"
id="restore-backup"
::change=${uploadUserData}
/>
</label>
</li>
<li>
${version()}
</li>
</ul>
${settingsStyle()}
`